summaryrefslogtreecommitdiff
path: root/src/share/ma
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2013-03-08 19:29:38 +0100
committerJonas Smedegaard <dr@jones.dk>2013-03-09 02:29:30 +0100
commit24a0dde01d3b64d36773e06eeb300d94992b2886 (patch)
tree38ad3bea0c509cee312e1da6b3ecea3155ddbbfe /src/share/ma
parent71576e054b4d47085f7620749660ca2bf1df47b0 (diff)
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.
Diffstat (limited to 'src/share/ma')
-rw-r--r--src/share/ma/add_certifier2
-rw-r--r--src/share/ma/update_users2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/share/ma/add_certifier b/src/share/ma/add_certifier
index 3ce5000..de8b1d1 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}/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."
diff --git a/src/share/ma/update_users b/src/share/ma/update_users
index a70d000..1330c8d 100644
--- a/src/share/ma/update_users
+++ b/src/share/ma/update_users
@@ -79,7 +79,7 @@ for uname in $unames ; do
# process authorized_user_ids file, as monkeysphere user
su_monkeysphere_user \
- ". ${SYSSHAREDIR}/common; STRICT_MODES='$STRICT_MODES' process_authorized_user_ids -" \
+ ". ${SYSSHAREDIR}/process_authorized_user_ids '$STRICT_MODES' -" \
< "$authorizedUserIDs" \
> "$tmpAuthorizedKeys"