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
This commit is contained in:
parent
ef4268efa7
commit
46a38dbb9b
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user