diff options
author | Denys Vlasenko | 2017-08-06 21:53:39 +0200 |
---|---|---|
committer | Denys Vlasenko | 2017-08-06 21:53:39 +0200 |
commit | bfc66d49806a4305014b12bbe078484b2da6f93f (patch) | |
tree | a8dafa2ba1bb61d3fbe37fbeb03c68ee31180757 | |
parent | 9536ef7c9855172d25223242eba7b7692339e3d8 (diff) | |
download | busybox-bfc66d49806a4305014b12bbe078484b2da6f93f.zip busybox-bfc66d49806a4305014b12bbe078484b2da6f93f.tar.gz |
nbd-client: make it NOEXEC, stop using argc
function old new delta
nbdclient_main 484 492 +8
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | NOFORK_NOEXEC.lst | 2 | ||||
-rw-r--r-- | networking/nbd-client.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/NOFORK_NOEXEC.lst b/NOFORK_NOEXEC.lst index 63ec086..9c8df23 100644 --- a/NOFORK_NOEXEC.lst +++ b/NOFORK_NOEXEC.lst @@ -241,7 +241,7 @@ mpstat - longterm: "mpstat 1" runs indefinitely mt - rare mv - noexec candidate, runner nameif - noexec. openlog(), leaks: config_open2+ioctl_or_perror_and_die -nbd-client +nbd-client - noexec nc - runner netstat - runner with -c nice - noexec. spawner diff --git a/networking/nbd-client.c b/networking/nbd-client.c index a5e25e6..cf18572 100644 --- a/networking/nbd-client.c +++ b/networking/nbd-client.c @@ -7,7 +7,7 @@ #include <netinet/tcp.h> #include <linux/fs.h> -//applet:IF_NBDCLIENT(APPLET_ODDNAME(nbd-client, nbdclient, BB_DIR_USR_SBIN, BB_SUID_DROP, nbdclient)) +//applet:IF_NBDCLIENT(APPLET_NOEXEC(nbd-client, nbdclient, BB_DIR_USR_SBIN, BB_SUID_DROP, nbdclient)) //kbuild:lib-$(CONFIG_NBDCLIENT) += nbd-client.o @@ -43,7 +43,7 @@ //blocksizes other than 1024 without patches int nbdclient_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; -int nbdclient_main(int argc, char **argv) +int nbdclient_main(int argc UNUSED_PARAM, char **argv) { unsigned long timeout = 0; #if BB_MMU @@ -61,7 +61,7 @@ int nbdclient_main(int argc, char **argv) BUILD_BUG_ON(offsetof(struct nbd_header_t, data) != 8+8+8+4); // Parse command line stuff (just a stub now) - if (argc != 4) + if (!argv[1] || !argv[2] || !argv[3] || argv[4]) bb_show_usage(); #if !BB_MMU |