OSDN Git Service

main.c: fix non-root usage when installed suid root
authorPatrick Ohly <patrick.ohly@intel.com>
Tue, 9 Feb 2016 15:43:35 +0000 (16:43 +0100)
committerRob Landley <rob@landley.net>
Thu, 11 Feb 2016 04:32:37 +0000 (22:32 -0600)
commit62b53ed9e64e40d2534f1239c4b314d84e79f15f
tree7f2fa04b2e905432b7693cf41e075b7638cfcd38
parente2d042c8e868a129396f03ec759e2ccdb8304833
main.c: fix non-root usage when installed suid root

When toybox is installed suid root and invoked by a non-root user for
commands which do not require root privileges, it drops the root
privileges during initialization.

However, since commit afba5b8efd the result check of setuid() was
inverted such that it aborted on success, making toybox unusuable for
non-root users.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
main.c