Age | Commit message (Collapse) | Author |
|
|
|
NB! There seems to be many more of these, e.g. revealed by this command:
git grep '[^="]$(' -- '*/*'
|
|
|
|
It is a healthy coding practice to keep each argument separate when
executing system calls, i.e. quote each variable separately instead of
relying on whitespace to indicate argument separation.
Quoting shell-inside-shell is tricky to do right, but not impossible:
Bourne-derived shells treat single-quoting literally, which means that
shell command arguments (i.e. an array of strings) should be safe to
serialize (dual-quote) using these simple rules:
b) each single-quote inside each string is escaped as '\''
a) each string is surrounded by single-quotes
This patch applies above single-quote serialization for
su_monkeysphere_user().
This appears to break for commands that start with variable
assignment, like:
PAGER=cat git diff
So as long as we do not use that form, su_monkeysphere_user() should
not treat its variables any worse than previous non-quoting.
|
|
The previous changeset ("simplify arguments passed to
su_monkeysphere_user and gpg_sphere") changes the semantics for m-a
gpg-cmd by making it take its arguments separately, rather than as a
single string.
|
|
It is a healthy coding practice to keep each argument separate when
executing system calls, i.e. quote each variable separately instead of
relying on whitespace to indicate argument separation.
This patch improves argument passing like this:
a) Each argument is passed individually (not all as a single string)
b) Arguments containing no variables are not quoted
c) Dynamic arguments are double-quoted ( "$@" )
Due to su_monkeysphere_user() expanding arguments using "$*" (not "$@")
arguments are collapsed into single strings, and this change is
therefore mostly¹ cosmetic.
It does improve clarity, however. Also, it eases switching to safer
quoted arguments in the future.
¹ma/update_users had $STRICT_MODES properly dual-quoted line 82 which is
dropped with this change (to keep patches simple). Next patch will
restore proper quoting generally (i.e. including this one now relaxed).
|
|
It is a healthy coding practice to keep each argument separate when
executing system calls, i.e. quote each variable separately instead of
relying on whitespace to indicate argument separation.
Quoting shell-inside-shell is tricky to do right, and gets trickier when
more than a single command is wrapped together.
This patch simplifies convoluted shell calls to contain only one command
each.
Example:
before: bash -c ". .../common; process_authorized_user_ids -"
after: bash -c ".../common process_authorized_user_ids -"
|
|
if you want to just launch a subshell that invokes a single function
(e.g. foobar) from monkeysphere's common source, you should now be
able to do so with:
${SYSSHAREDIR}/common foobar
|
|
files (thanks, Jonas!)
|
|
|
|
|
|
which apparently does not retrieve keys from gpg --search if the --batch argument is also present)
|
|
arguments
|
|
|
|
|
|
just https (invoke it like "make-x509-certreqs imap" for imap:// keys, etc)
|
|
|
|
we don't repeat users.
|
|
way to ensure m-a u is executed on the right users.
|
|
implementation
|
|
PGPExtension embedded in them from https monkeysphere-host keys.
|
|
|
|
|
|
|
|
|
|
the script works. Location of key files to monitor is more
configurable by the sys admin. All changed files treated the
same for simplicity. Added debug mode.
|
|
with regard to different operating systems. And, monitoring
/etc/passwd is not recommended, so removed from description.
|
|
immediately incorporated)
|
|
|
|
subkey a reasonable name instead of the empty string
|
|
|
|
|
|
|
|
|
|
functional change)
|
|
|
|
|
|
(e.g. only line in file is removed)
|
|
After the last big code cleanup, the bookkeeping of numbers of
processed/valid keys was removed. This was done because most things
don't use that info, and it was confusing return codes of top-level
functions.
The one thing that did use that, though, was the ssh_proxycommand. We
fix this by using a global variable to keep track of the number of
processed and valid keys. The proxy command can now easily determine
when it should output it's marginal ui block.
|
|
|
|
also move hashing of known_hosts lines into ssh2known_hosts function
|
|
|
|
|
|
|
|
|
|
|
|
This method uses grep -F to find the full line to match, and then
second call to grep -v -F to actually remove the line. For
known_hosts, we use two piped grep -F calls. No rexexp are used, and
only one extra call to grep is required for known_hosts line removal.
There is still an issue here about sub-string matches, but there is at
least no regression over early versions.
|
|
we create a new function here, touch_key_file_or_fail, which will
touch a new key file if there isn't one already present. This is now
used in the update_authorized_keys and update_known_hosts functions
when looking for authorized_keys and known_hosts respectively.
Closes Debian 600644
|
|
|
|
tmp file into place
|