From 99912ca733dd960f5589227fd999c86e73c8e894 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Tue, 10 Apr 2007 15:43:37 +0000 Subject: audit small applets and mark some of them as NOFORK. Put big scary warnings in relevant places. --- coreutils/rmdir.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'coreutils/rmdir.c') diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c index 8cbd6f1fa..7f3253017 100644 --- a/coreutils/rmdir.c +++ b/coreutils/rmdir.c @@ -10,11 +10,12 @@ /* BB_AUDIT SUSv3 compliant */ /* http://www.opengroup.org/onlinepubs/007904975/utilities/rmdir.html */ -#include -#include #include #include "busybox.h" +/* This is a NOFORK applet. Be very careful! */ + + int rmdir_main(int argc, char **argv); int rmdir_main(int argc, char **argv) { @@ -24,7 +25,6 @@ int rmdir_main(int argc, char **argv) char *path; flags = getopt32(argc, argv, "p"); - argv += optind; if (!*argv) { @@ -37,7 +37,7 @@ int rmdir_main(int argc, char **argv) /* Record if the first char was a '.' so we can use dirname later. */ do_dot = (*path == '.'); - do { + while (1) { if (rmdir(path) < 0) { bb_perror_msg("'%s'", path); /* Match gnu rmdir msg. */ status = EXIT_FAILURE; @@ -53,7 +53,7 @@ int rmdir_main(int argc, char **argv) } } break; - } while (1); + } } while (*++argv); -- cgit v1.2.3