diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2021-02-24 21:06:48 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2021-02-24 21:08:28 +0100 |
commit | faab30461b0f2b920e3dd19489ce458c0b38e6d9 (patch) | |
tree | 0b7a760c5dac69f245a91185cbaa9c3183947eae /lacme | |
parent | d1a862d9cb98a54e12c9fdbc405b896f3f0efcfe (diff) |
If restricting access via umask() fails, don't include errno in the error message.
errno is not set on umask failure, see
https://perldoc.perl.org/functions/umask.
Diffstat (limited to 'lacme')
-rwxr-xr-x | lacme | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -376,14 +376,14 @@ sub spawn_webserver() { if ($domain == AF_UNIX) { # bind(2) with a loose umask(2) to allow anyone to connect - my $umask = umask(0111) // die "umask: $!"; + my $umask = umask(0111) // die; my $path = Socket::unpack_sockaddr_un($sockaddr); bind($sock, $sockaddr) or die "Couldn't bind to $p: $!"; push @CLEANUP, sub() { print STDERR "Unlinking $path\n" if $OPTS{debug}; unlink $path or warn "Warning: Couldn't unlink $path: $!"; }; - umask($umask) // die "umask: $!"; + umask($umask) // die; } else { bind($sock, $sockaddr) or die "Couldn't bind to $p: $!"; |