aboutsummaryrefslogtreecommitdiffstats
path: root/lacme
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2021-02-24 21:28:31 +0100
committerGuilhem Moulin <guilhem@fripost.org>2021-02-24 21:32:06 +0100
commitea5a51ecaa72c8277b4f878cf3635025d757fa37 (patch)
treee77cc5853aa5a8b284e1588b999ee1bc670bd5b4 /lacme
parentc6a4aaa6128d55ba5f7f3cd2bd75f789f69ae407 (diff)
lacme: Return an error when the 'mode'/'chown' isn't a number.
oct("foobar") is 0, definitely not what we want.
Diffstat (limited to 'lacme')
-rwxr-xr-xlacme3
1 files changed, 2 insertions, 1 deletions
diff --git a/lacme b/lacme
index 2d9202d..b52cddd 100755
--- a/lacme
+++ b/lacme
@@ -689,7 +689,8 @@ sub install_cert(%) {
my $mode;
if ((my $m = $args{mode}) ne "") {
- $mode = oct($m) // die;
+ die "Not an octal string: $m\n" unless $m =~ /^[0-9]+$/;
+ $mode = oct($m);
} else {
my $umask = umask() // die;
$mode = 0644 &~ $umask;