Mercurial > hg > toybox
comparison main.c @ 1587:a35ea98b4972 draft
The "re-exec to regain root permissions" logic broke the error message when calling root-only commands through the multiplexer.
It would say "no such command" when it should say "not root".
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 29 Nov 2014 21:11:34 -0600 |
parents | 3c77af6f81cc |
children | 5fac2769a159 |
comparison
equal
deleted
inserted
replaced
1586:6db5787d340b | 1587:a35ea98b4972 |
---|---|
147 static char *toy_paths[]={"usr/","bin/","sbin/",0}; | 147 static char *toy_paths[]={"usr/","bin/","sbin/",0}; |
148 int i, len = 0; | 148 int i, len = 0; |
149 | 149 |
150 toys.which = toy_list; | 150 toys.which = toy_list; |
151 if (toys.argv[1]) { | 151 if (toys.argv[1]) { |
152 toys.optc = 0; | 152 toys.optc = toys.recursion = 0; |
153 toy_exec(toys.argv+1); | 153 toy_exec(toys.argv+1); |
154 if (toys.argv[1][0] == '-') goto list; | 154 if (toys.argv[1][0] == '-') goto list; |
155 | 155 |
156 error_exit("Unknown command %s",toys.argv[1]); | 156 error_exit("Unknown command %s",toys.argv[1]); |
157 } | 157 } |