Running a command as a different user w/o starting the login shell
Is there a straightforward manner?
I know about su -c user, but that will try to start the login shell. If the login shell is set to /sbin/nologin (As it often is for cron/daemon users) it won't work.
I actually solved this problem already using a very simple C program using setgid(), setuid(), and system(). But I find it hard to believe that I'm the first one with this issue and that this is the easiest way ...
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.