From 0c081207c94b0ed338a704fafac10166ce98bba7 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Fri, 8 Mar 2013 19:29:38 +0100 Subject: Pass only single commands through su wrapper 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 -" --- src/share/mh/add_revoker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/share/mh/add_revoker') diff --git a/src/share/mh/add_revoker b/src/share/mh/add_revoker index 41cf090..5a2032c 100644 --- a/src/share/mh/add_revoker +++ b/src/share/mh/add_revoker @@ -52,7 +52,7 @@ if [ -f "$revokerKeyID" -o "$revokerKeyID" = '-' ] ; 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" < "$revokerKeyID") + "${SYSSHAREDIR}/common list_primary_fingerprints" < "$revokerKeyID") 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