]> Sergey Matveev's repositories - public-inbox.git/commitdiff
script/lei: umask(077) before execve
authorEric Wong <e@80x24.org>
Fri, 17 Sep 2021 12:12:30 +0000 (07:12 -0500)
committerEric Wong <e@80x24.org>
Fri, 17 Sep 2021 21:49:42 +0000 (21:49 +0000)
While my MUA also runs umask(077) unconditionally, not all
MUAs do.  Additionally, pagers may support writing its buffer
to disk, so ensure anything else we spawn has umask(077).

script/lei

index 2d84487a89dc5d27acd2771339b4525463198b30..591013e3804ab6979f429e2aa00f6fba351cf26a 100755 (executable)
@@ -53,6 +53,7 @@ my $exec_cmd = sub {
                }
                my %env = map { split(/=/, $_, 2) } splice(@argv, $argc);
                @ENV{keys %env} = values %env;
+               umask 077;
                exec(@argv);
                warn "exec: @argv: $!\n";
                POSIX::_exit(1);