From 049467f2dec0cf511b403dde9b9b07c6abf5cbc9 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 9 Mar 2013 17:19:05 +0100 Subject: Simplify arguments passed to su_monkeysphere_user() and gpg_sphere MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). --- src/share/ma/add_certifier | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/share/ma/add_certifier') diff --git a/src/share/ma/add_certifier b/src/share/ma/add_certifier index 86c2fd4..1d450e7 100644 --- a/src/share/ma/add_certifier +++ b/src/share/ma/add_certifier @@ -101,7 +101,7 @@ if [ -f "$keyID" -o "$keyID" = '-' ] ; then # check the key is ok as monkeysphere user before loading log debug "checking keys in file..." fingerprint=$(su_monkeysphere_user \ - "${SYSSHAREDIR}/common list_primary_fingerprints" < "$keyID") + "${SYSSHAREDIR}/common" list_primary_fingerprints < "$keyID") if [ $(printf "%s" "$fingerprint" | egrep -c '^[A-F0-9]{40}$') -ne 1 ] ; then failure "There was not exactly one gpg key in the file." -- cgit v1.2.3