Uses standard Unix setuid
to change the current process user id and executes the parameters passed.
On other platforms, this usually requires root
authority, but on IBM i we just need *USE
authority
to the user profile. :)
gcc -o sudo sudo.c
$ whoami
kadler
$ ./sudo whoami
qsecofr
$ ./sudo -u dummy
dummy
$ ./sudo -u 1234
otherdummy