diff options
author | Rob Landley <rob@landley.net> | 2012-11-18 18:52:19 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2012-11-18 18:52:19 -0600 |
commit | 6c62448f72ed9fc2b6a59ee09735283c07060cdb (patch) | |
tree | 7db6399267c2e8918c3f9e25c868d6fc5f36519a /main.c | |
parent | 491eb800ef69a5e06f798372db8b32c87051ea90 (diff) | |
download | toybox-6c62448f72ed9fc2b6a59ee09735283c07060cdb.tar.gz toybox-6c62448f72ed9fc2b6a59ee09735283c07060cdb.tar.bz2 toybox-6c62448f72ed9fc2b6a59ee09735283c07060cdb.zip |
Init global context to toybox multiplexer early so error_exit() doesn't segfault trying to print current command name, and change TOYBOX_DEBUG+TOYBOX_SUID complaint about not having the suid bit set to warning rather than exit..
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -71,7 +71,7 @@ void toy_init(struct toy_list *which, char *argv[]) if (!(which->flags & TOYFLAG_STAYROOT)) { if (uid != euid) xsetuid(euid=uid); - } else if (CFG_TOYBOX_DEBUG && uid) error_exit("Not installed suid root"); + } else if (CFG_TOYBOX_DEBUG && uid) error_msg("Not installed suid root"); if ((which->flags & TOYFLAG_NEEDROOT) && euid) error_exit("Not root"); } @@ -113,10 +113,10 @@ void toybox_main(void) static char *toy_paths[]={"usr/","bin/","sbin/",0}; int i, len = 0; + toys.which = toy_list; if (toys.argv[1]) { if (toys.argv[1][0]!='-') { toy_exec(toys.argv+1); - toys.which = toy_list; error_exit("Unknown command %s",toys.argv[1]); } } |