diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-03 03:29:32 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-03 03:29:32 +0200 |
commit | 819b47aa357c33bf84919495795b36f8c1faa3ac (patch) | |
tree | 7ba0ddb384c2e7fdf581989f66085b95a78e0976 /debianutils/which.c | |
parent | 39701204cfa0f261beb2dc056024634e4c3afd71 (diff) | |
download | busybox-w32-819b47aa357c33bf84919495795b36f8c1faa3ac.tar.gz busybox-w32-819b47aa357c33bf84919495795b36f8c1faa3ac.tar.bz2 busybox-w32-819b47aa357c33bf84919495795b36f8c1faa3ac.zip |
new NOFORKs: clear, nproc, tty, uname, arch, unlink, which
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to '')
-rw-r--r-- | debianutils/which.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/debianutils/which.c b/debianutils/which.c index 3197ddac1..b31d61871 100644 --- a/debianutils/which.c +++ b/debianutils/which.c | |||
@@ -12,7 +12,7 @@ | |||
12 | //config: which is used to find programs in your PATH and | 12 | //config: which is used to find programs in your PATH and |
13 | //config: print out their pathnames. | 13 | //config: print out their pathnames. |
14 | 14 | ||
15 | //applet:IF_WHICH(APPLET(which, BB_DIR_USR_BIN, BB_SUID_DROP)) | 15 | //applet:IF_WHICH(APPLET_NOFORK(which, which, BB_DIR_USR_BIN, BB_SUID_DROP, which)) |
16 | 16 | ||
17 | //kbuild:lib-$(CONFIG_WHICH) += which.o | 17 | //kbuild:lib-$(CONFIG_WHICH) += which.o |
18 | 18 | ||
@@ -56,6 +56,8 @@ int which_main(int argc UNUSED_PARAM, char **argv) | |||
56 | char *p; | 56 | char *p; |
57 | 57 | ||
58 | path = tmp = xstrdup(env_path); | 58 | path = tmp = xstrdup(env_path); |
59 | //NOFORK FIXME: nested xmallocs (one is inside find_executable()) | ||
60 | //can leak memory on failure | ||
59 | while ((p = find_executable(*argv, &tmp)) != NULL) { | 61 | while ((p = find_executable(*argv, &tmp)) != NULL) { |
60 | missing = 0; | 62 | missing = 0; |
61 | puts(p); | 63 | puts(p); |