comparison main.c @ 769:098ab2654fa0

TOYBOX_DEBUG warns about lack of suid bit when running a STAYROOT command, but it shouldn't warn just because the multiplexer command "toybox" is stayroot.
author Rob Landley <rob@landley.net>
date Thu, 27 Dec 2012 17:09:17 -0600
parents 6a558bf5de65
children 3d7526f6115b
comparison
equal deleted inserted replaced
768:017b8fd3c9ac 769:098ab2654fa0
69 if (CFG_TOYBOX_SUID) { 69 if (CFG_TOYBOX_SUID) {
70 uid_t uid = getuid(), euid = geteuid(); 70 uid_t uid = getuid(), euid = geteuid();
71 71
72 if (!(which->flags & TOYFLAG_STAYROOT)) { 72 if (!(which->flags & TOYFLAG_STAYROOT)) {
73 if (uid != euid) xsetuid(euid=uid); 73 if (uid != euid) xsetuid(euid=uid);
74 } else if (CFG_TOYBOX_DEBUG && uid) error_msg("Not installed suid root"); 74 } else if (CFG_TOYBOX_DEBUG && uid && which != toy_list)
75 error_msg("Not installed suid root");
75 76
76 if ((which->flags & TOYFLAG_NEEDROOT) && euid) error_exit("Not root"); 77 if ((which->flags & TOYFLAG_NEEDROOT) && euid) error_exit("Not root");
77 } 78 }
78 79
79 // Free old toys contents (to be reentrant), but leave rebound if any 80 // Free old toys contents (to be reentrant), but leave rebound if any