3 Nov
2013
3 Nov
'13
6:06 p.m.
On Sun, Nov 3, 2013 at 11:14 AM, Thomas Bächler <thomas@archlinux.org> wrote:
+switch_user() { + local user + + user=$(whoami) + if [[ $user != $DBSCRIPTS_USER ]]; then + exec sudo -u $DBSCRIPTS_USER "$@" + fi +}
Instead of using sudo and adding a convenience hack to the binary, could we use setuid? E.g. The binaries are chown dbscripts_packages:dev (or dbscripts_community:tu) and chmod 4554. Or is the distinction of EUID/RUID a problem here?