[handle spaces in arguments
timo.lindfors@iki.fi**20080411100827] {
hunk ./sido 2
-rm -f ~/.sido/cmd.sig
-p="`which "$1"`"
-shift
-echo "$p $@" | tr ' \n' '\0' > ~/.sido/cmd
+
+# write command to file
+
+argc=0
+echo > ~/.sido/cmd
+for i in "$@"; do
+    if [ $argc = 0 ]; then
+	echo -n "`which "$i"`" > ~/.sido/cmd
+    else
+	echo -n "$i" >> ~/.sido/cmd
+    fi
+    echo -en "\0" >> ~/.sido/cmd
+    argc=`expr $argc + 1`
+done
+
+# ask user to sign it
+
hunk ./sido 20
+
+# wait for signature
+
hunk ./sido 26
-sudo /home/lindi/tmp/sido/sido-run /home/lindi/.sido/keyring /home/lindi/.sido/cmd.sig "$p" "$@"
+
+# pass command and signature to sido-run (we can't be trusted to verify it)
+
+xargs -0 sudo /home/lindi/tmp/sido/sido-run /home/lindi/.sido/keyring.gpg /home/lindi/.sido/cmd.sig < ~/.sido/cmd
+
}
