Skip to content

Commit db94949

Browse files
authored
install: -m MODE validation (#980)
* Passing an empty string as a mode was being accepted and interpreted as -m0 * Empty string is not a valid mode specifier so catch it early * I found this when testing against GNU and OpenBSD versions
1 parent 991d131 commit db94949

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bin/install

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ if ($opt{d} and grep($_, @opt{qw/ C c D p /}) > 0) {
5454
warn "$Program: -d not allowed with -[CcDp]\n";
5555
usage();
5656
}
57+
if (defined $opt{'m'} && length($opt{'m'}) == 0) {
58+
warn "$Program: invalid file mode: ''\n";
59+
exit 1;
60+
}
5761

5862
$opt{C}++ if $opt{p};
5963
$Debug = 1 if $opt{D};

0 commit comments

Comments
 (0)