ktsuss wrapper
Posted: Sat Nov 07, 2009 8:25 pm
I've finally found a simple, low dependency replacement for gksu/kdesu for use with pcmanfm.
The only problem is it doesn't handle input from pcmanfm very well (or any gui sending multiple arguments it seams - e.g. pcmanfm --no-desktop '/tmp').
I've managed to write a wrapper script to aid in this task based on a few other scripts hidden on the net. I've been using it for a few days with pcmanfm and emelfm2 without any issue's so I thought I'd post it here encase anyone else finds it useful.
To make use of this script you will obviously need ktsuss and compile pcmanfm with --with-preferable-sudo=ktsuss-wrapper
The only problem is it doesn't handle input from pcmanfm very well (or any gui sending multiple arguments it seams - e.g. pcmanfm --no-desktop '/tmp').
I've managed to write a wrapper script to aid in this task based on a few other scripts hidden on the net. I've been using it for a few days with pcmanfm and emelfm2 without any issue's so I thought I'd post it here encase anyone else finds it useful.
Code: Select all
#!/bin/sh
# /usr/bin/ktsuss-wrapper
PATH="${PATH}:/sbin:/usr/sbin:/usr/local/sbin"
CMD="$*"
BIN="$1"
if [ -x "`type -path ktsuss`" ]; then
KTSUSS="`type -path ktsuss` -u root"
else
echo "ktsuss-wrapper: \`ktsuss' command not found"
exit 1
fi
if [ "$UID" = "0" ]; then
KTSUSS=""
fi
if [ -x "`type -path $BIN`" ]; then
eval $KTSUSS $CMD
else
echo "ktsuss-wrapper: \`$BIN' command not found"
exit 1
fi