diff options
author | Jonas Smedegaard <dr@jones.dk> | 2013-03-09 17:19:05 +0100 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2013-03-13 11:33:10 +0100 |
commit | 049467f2dec0cf511b403dde9b9b07c6abf5cbc9 (patch) | |
tree | 2d84414b881864db893f67eb6c87b46876e6a0e9 /src/share/ma/setup | |
parent | 0c081207c94b0ed338a704fafac10166ce98bba7 (diff) |
Simplify arguments passed to su_monkeysphere_user() and gpg_sphere
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).
Diffstat (limited to 'src/share/ma/setup')
-rw-r--r-- | src/share/ma/setup | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/share/ma/setup b/src/share/ma/setup index e65f875..6745da7 100644 --- a/src/share/ma/setup +++ b/src/share/ma/setup @@ -99,7 +99,7 @@ EOF # check the owner trust log debug "checking gpg_sphere owner trust set properly..." local ORIG_TRUST - if ORIG_TRUST=$(gpg_sphere "--export-ownertrust" | grep '^[^#]') ; then + if ORIG_TRUST=$(gpg_sphere --export-ownertrust | grep '^[^#]') ; then if [ "${CORE_FPR}:6:" != "$ORIG_TRUST" ] ; then failure "Monkeysphere authentication trust sphere should explicitly trust the core. It does not have proper ownertrust settings." fi @@ -112,7 +112,7 @@ EOF # our preferences are reasonable (i.e. 3 marginal OR 1 fully # trusted certifications are sufficient to grant full validity. log debug "checking trust model for authentication ..." - local TRUST_MODEL=$(gpg_sphere "--with-colons --list-keys" 2>/dev/null \ + local TRUST_MODEL=$(gpg_sphere --with-colons --list-keys 2>/dev/null \ | head -n1 | grep "^tru:" | cut -d: -f3,6,7) log debug "sphere trust model: $TRUST_MODEL" if [ "$TRUST_MODEL" != '1:3:1' ] ; then |