aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-06-04 05:17:35 +0000
committerEric Andersen <andersen@codepoet.org>2000-06-04 05:17:35 +0000
commit46a38dbb9b1a5ecec99dda2eb42b456e5ac76c26 (patch)
tree69a3a8a92331a87aa25ed311321b87fbd656eca4
parentef4268efa7474ba84dc02ffc29030ad6407fedcb (diff)
downloadbusybox-w32-46a38dbb9b1a5ecec99dda2eb42b456e5ac76c26.tar.gz
busybox-w32-46a38dbb9b1a5ecec99dda2eb42b456e5ac76c26.tar.bz2
busybox-w32-46a38dbb9b1a5ecec99dda2eb42b456e5ac76c26.zip
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
-rw-r--r--coreutils/mkfifo.c2
-rw-r--r--mkfifo.c2
2 files changed, 2 insertions, 2 deletions
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)
60 argc--; 60 argc--;
61 argv++; 61 argv++;
62 } 62 }
63 if (argc < 1) 63 if (argc < 1 || *argv[0] == '-')
64 usage(mkfifo_usage); 64 usage(mkfifo_usage);
65 if (mkfifo(*argv, mode) < 0) { 65 if (mkfifo(*argv, mode) < 0) {
66 perror("mkfifo"); 66 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)
60 argc--; 60 argc--;
61 argv++; 61 argv++;
62 } 62 }
63 if (argc < 1) 63 if (argc < 1 || *argv[0] == '-')
64 usage(mkfifo_usage); 64 usage(mkfifo_usage);
65 if (mkfifo(*argv, mode) < 0) { 65 if (mkfifo(*argv, mode) < 0) {
66 perror("mkfifo"); 66 perror("mkfifo");