aboutsummaryrefslogtreecommitdiff
path: root/coreutils/rmdir.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-04-10 15:43:37 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-04-10 15:43:37 +0000
commit99912ca733dd960f5589227fd999c86e73c8e894 (patch)
tree9df947fc08884d498cf76a02204d74b121064134 /coreutils/rmdir.c
parentff131b980d524a33d8a43cefe65e14f64a43f2da (diff)
downloadbusybox-w32-99912ca733dd960f5589227fd999c86e73c8e894.tar.gz
busybox-w32-99912ca733dd960f5589227fd999c86e73c8e894.tar.bz2
busybox-w32-99912ca733dd960f5589227fd999c86e73c8e894.zip
audit small applets and mark some of them as NOFORK.
Put big scary warnings in relevant places.
Diffstat (limited to 'coreutils/rmdir.c')
-rw-r--r--coreutils/rmdir.c10
1 files changed, 5 insertions, 5 deletions
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 @@
10/* BB_AUDIT SUSv3 compliant */ 10/* BB_AUDIT SUSv3 compliant */
11/* http://www.opengroup.org/onlinepubs/007904975/utilities/rmdir.html */ 11/* http://www.opengroup.org/onlinepubs/007904975/utilities/rmdir.html */
12 12
13#include <stdlib.h>
14#include <unistd.h>
15#include <libgen.h> 13#include <libgen.h>
16#include "busybox.h" 14#include "busybox.h"
17 15
16/* This is a NOFORK applet. Be very careful! */
17
18
18int rmdir_main(int argc, char **argv); 19int rmdir_main(int argc, char **argv);
19int rmdir_main(int argc, char **argv) 20int rmdir_main(int argc, char **argv)
20{ 21{
@@ -24,7 +25,6 @@ int rmdir_main(int argc, char **argv)
24 char *path; 25 char *path;
25 26
26 flags = getopt32(argc, argv, "p"); 27 flags = getopt32(argc, argv, "p");
27
28 argv += optind; 28 argv += optind;
29 29
30 if (!*argv) { 30 if (!*argv) {
@@ -37,7 +37,7 @@ int rmdir_main(int argc, char **argv)
37 /* Record if the first char was a '.' so we can use dirname later. */ 37 /* Record if the first char was a '.' so we can use dirname later. */
38 do_dot = (*path == '.'); 38 do_dot = (*path == '.');
39 39
40 do { 40 while (1) {
41 if (rmdir(path) < 0) { 41 if (rmdir(path) < 0) {
42 bb_perror_msg("'%s'", path); /* Match gnu rmdir msg. */ 42 bb_perror_msg("'%s'", path); /* Match gnu rmdir msg. */
43 status = EXIT_FAILURE; 43 status = EXIT_FAILURE;
@@ -53,7 +53,7 @@ int rmdir_main(int argc, char **argv)
53 } 53 }
54 } 54 }
55 break; 55 break;
56 } while (1); 56 }
57 57
58 } while (*++argv); 58 } while (*++argv);
59 59