new NOFORKs: clear, nproc, tty, uname, arch, unlink, which

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2017-08-03 03:29:32 +02:00
parent 39701204cf
commit 819b47aa35
7 changed files with 414 additions and 8 deletions

View File

@@ -12,7 +12,7 @@
//config: which is used to find programs in your PATH and
//config: print out their pathnames.
//applet:IF_WHICH(APPLET(which, BB_DIR_USR_BIN, BB_SUID_DROP))
//applet:IF_WHICH(APPLET_NOFORK(which, which, BB_DIR_USR_BIN, BB_SUID_DROP, which))
//kbuild:lib-$(CONFIG_WHICH) += which.o
@@ -56,6 +56,8 @@ int which_main(int argc UNUSED_PARAM, char **argv)
char *p;
path = tmp = xstrdup(env_path);
//NOFORK FIXME: nested xmallocs (one is inside find_executable())
//can leak memory on failure
while ((p = find_executable(*argv, &tmp)) != NULL) {
missing = 0;
puts(p);