diff options
author | Joe Rayhawk <jrayhawk@omgwallhack.org> | 2019-10-28 16:24:10 -0700 |
---|---|---|
committer | Joe Rayhawk <jrayhawk@omgwallhack.org> | 2019-10-28 16:24:10 -0700 |
commit | 6f783f8593a77f083a206df163b1bb4d4dca5769 (patch) | |
tree | 153eebcb7ca19dbb7c974315bb720a03a223fca7 | |
parent | bd830ff672d992254361a9c0d0b412ab74eca79a (diff) | |
download | piny-code-6f783f8593a77f083a206df163b1bb4d4dca5769.tar.gz piny-code-6f783f8593a77f083a206df163b1bb4d4dca5769.zip |
libpiny: repo: local is only for shadow variables. ugh.
-rw-r--r-- | libpiny/lib/Piny/Repo.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm index 67aeed1..e48faf1 100644 --- a/libpiny/lib/Piny/Repo.pm +++ b/libpiny/lib/Piny/Repo.pm @@ -327,13 +327,13 @@ sub rebuild_git { # FIXME: most of these are probably unnecessary to check due to limitations of bare repositories. foreach( "applypatch-msg", "pre-applypatch", "post-applypatch", "pre-commit", "prepare-commit-msg", "commit-msg", "post-commit", "pre-rebase", "post-checkout", "post-merge", "pre-push", "pre-receive", "update", "post-receive", "post-update", "push-to-checkout", "pre-auto-gc", "post-rewrite", "sendemail-validate", "fsmonitor-watchman" ) { - local $link = $s->path . "/hooks/" . $_; + my $link = $s->path . "/hooks/" . $_; while ( -s $link; ) { $link = readlink( $link ); }; - local ( $dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks ) = stat( $link ) or next; - local $name = getpwuid( $uid ) or die "Unable to find name for uid" . $uid . "for hook " . $s->path . "/hooks/" . $_ . "\n"; - local $group = getgrgid( $gid ) or die "Unable to find group for gid" . $gid . "for hook " . $s->path . "/hooks/" . $_ . "\n"; + my ( $dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks ) = stat( $link ) or next; + my $name = getpwuid( $uid ) or die "Unable to find name for uid" . $uid . "for hook " . $s->path . "/hooks/" . $_ . "\n"; + my $group = getgrgid( $gid ) or die "Unable to find group for gid" . $gid . "for hook " . $s->path . "/hooks/" . $_ . "\n"; unless ( $name =~ /^(root|iki-$s->shortname)/ ); ) { warn( "Security warning: $link is not owned by user root or iki-$s->shortname!\n" ); }; |