aboutsummaryrefslogtreecommitdiffstats
path: root/bin/setuidgid
diff options
context:
space:
mode:
Diffstat (limited to 'bin/setuidgid')
-rwxr-xr-xbin/setuidgid7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/setuidgid b/bin/setuidgid
new file mode 100755
index 0000000..be4e0a9
--- /dev/null
+++ b/bin/setuidgid
@@ -0,0 +1,7 @@
+#!/bin/sh -e
+
+test "$#" -ge 2 || { echo "setuidgid: too few arguments" 1>&2 ; exit 100 ; }
+
+wd=$(pwd)
+
+exec su -s /bin/sh -p -c "PATH=$PATH ; export PATH ; cd $wd ; exec \"\$0\" \"\$@\"" -- "$@"