diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-10 15:43:37 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-10 15:43:37 +0000 |
commit | 99912ca733dd960f5589227fd999c86e73c8e894 (patch) | |
tree | 9df947fc08884d498cf76a02204d74b121064134 /coreutils/rm.c | |
parent | ff131b980d524a33d8a43cefe65e14f64a43f2da (diff) | |
download | busybox-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/rm.c')
-rw-r--r-- | coreutils/rm.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/coreutils/rm.c b/coreutils/rm.c index 1883feed8..6f32e7dc5 100644 --- a/coreutils/rm.c +++ b/coreutils/rm.c | |||
@@ -15,9 +15,10 @@ | |||
15 | * Size reduction. | 15 | * Size reduction. |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include <unistd.h> | ||
19 | #include "busybox.h" | 18 | #include "busybox.h" |
20 | 19 | ||
20 | /* This is a NOFORK applet. Be very careful! */ | ||
21 | |||
21 | int rm_main(int argc, char **argv); | 22 | int rm_main(int argc, char **argv); |
22 | int rm_main(int argc, char **argv) | 23 | int rm_main(int argc, char **argv) |
23 | { | 24 | { |
@@ -27,14 +28,15 @@ int rm_main(int argc, char **argv) | |||
27 | 28 | ||
28 | opt_complementary = "f-i:i-f"; | 29 | opt_complementary = "f-i:i-f"; |
29 | opt = getopt32(argc, argv, "fiRr"); | 30 | opt = getopt32(argc, argv, "fiRr"); |
31 | argv += optind; | ||
30 | if(opt & 1) | 32 | if(opt & 1) |
31 | flags |= FILEUTILS_FORCE; | 33 | flags |= FILEUTILS_FORCE; |
32 | if(opt & 2) | 34 | if(opt & 2) |
33 | flags |= FILEUTILS_INTERACTIVE; | 35 | flags |= FILEUTILS_INTERACTIVE; |
34 | if(opt & 12) | 36 | if(opt & 12) |
35 | flags |= FILEUTILS_RECUR; | 37 | flags |= FILEUTILS_RECUR; |
36 | 38 | ||
37 | if (*(argv += optind) != NULL) { | 39 | if (*argv != NULL) { |
38 | do { | 40 | do { |
39 | const char *base = bb_get_last_path_component(*argv); | 41 | const char *base = bb_get_last_path_component(*argv); |
40 | 42 | ||