From: Eric Andersen Date: Sun, 4 Jun 2000 05:17:35 +0000 (-0000) Subject: Don't allow mkfifo to create files such as "--help" X-Git-Tag: 0_45~84 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=46a38dbb9b1a5ecec99dda2eb42b456e5ac76c26;p=oweals%2Fbusybox.git Don't allow mkfifo to create files such as "--help" This patch checks if the name of FIFO to be created begins with "-" and calls usage() if it does. Regards, Pavel Roskin --- diff --git a/coreutils/mkfifo.c b/coreutils/mkfifo.c index ef3d667e2..46b1343cd 100644 --- a/coreutils/mkfifo.c +++ b/coreutils/mkfifo.c @@ -60,7 +60,7 @@ extern int mkfifo_main(int argc, char **argv) argc--; argv++; } - if (argc < 1) + if (argc < 1 || *argv[0] == '-') usage(mkfifo_usage); if (mkfifo(*argv, mode) < 0) { perror("mkfifo"); diff --git a/mkfifo.c b/mkfifo.c index ef3d667e2..46b1343cd 100644 --- a/mkfifo.c +++ b/mkfifo.c @@ -60,7 +60,7 @@ extern int mkfifo_main(int argc, char **argv) argc--; argv++; } - if (argc < 1) + if (argc < 1 || *argv[0] == '-') usage(mkfifo_usage); if (mkfifo(*argv, mode) < 0) { perror("mkfifo");