audit small applets and mark some of them as NOFORK.

Put big scary warnings in relevant places.
This commit is contained in:
Denis Vlasenko
2007-04-10 15:43:37 +00:00
parent ff131b980d
commit 99912ca733
41 changed files with 173 additions and 128 deletions

View File

@@ -10,11 +10,12 @@
/* BB_AUDIT SUSv3 compliant */
/* http://www.opengroup.org/onlinepubs/007904975/utilities/rmdir.html */
#include <stdlib.h>
#include <unistd.h>
#include <libgen.h>
#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);