diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-10 19:43:37 +0400 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-10 19:43:37 +0400 |
commit | 99912ca733dd960f5589227fd999c86e73c8e894 (patch) | |
tree | 9df947fc08884d498cf76a02204d74b121064134 /coreutils/cat.c | |
parent | ff131b980d524a33d8a43cefe65e14f64a43f2da (diff) |
audit small applets and mark some of them as NOFORK.
Put big scary warnings in relevant places.
Diffstat (limited to 'coreutils/cat.c')
-rw-r--r-- | coreutils/cat.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/coreutils/cat.c b/coreutils/cat.c index 7bab325ef..eb141dc79 100644 --- a/coreutils/cat.c +++ b/coreutils/cat.c @@ -12,17 +12,23 @@ #include "busybox.h" +/* This is a NOFORK applet. Be very careful! */ + + int bb_cat(char **argv) { static const char *const argv_dash[] = { "-", NULL }; + FILE *f; int retval = EXIT_SUCCESS; - if (!*argv) argv = (char**) &argv_dash; + if (!*argv) + argv = (char**) &argv_dash; do { f = fopen_or_warn_stdin(*argv); if (f) { + /* This is not an xfunc - never exits */ off_t r = bb_copyfd_eof(fileno(f), STDOUT_FILENO); fclose_if_not_stdin(f); if (r >= 0) |