diff options
author | Joe Rayhawk <jrayhawk@omgwallhack.org> | 2011-05-11 21:56:42 -0700 |
---|---|---|
committer | Joe Rayhawk <jrayhawk@omgwallhack.org> | 2011-05-11 21:56:42 -0700 |
commit | 3ca6564c2d95d12dff83cc645c280aa734ad19f8 (patch) | |
tree | 6ceacee15e63bf9a3a44235676a7e09135e63b9c /pinyadmin/sbin | |
parent | d3d06161d535d965867902f84b6e2ac558ce10c6 (diff) | |
download | piny-code-3ca6564c2d95d12dff83cc645c280aa734ad19f8.tar.gz piny-code-3ca6564c2d95d12dff83cc645c280aa734ad19f8.zip |
Making rebuildrepo user-usable and user-safe.
Diffstat (limited to 'pinyadmin/sbin')
-rwxr-xr-x | pinyadmin/sbin/rebuildrepo | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pinyadmin/sbin/rebuildrepo b/pinyadmin/sbin/rebuildrepo index 9d4e359..2ddc33b 100755 --- a/pinyadmin/sbin/rebuildrepo +++ b/pinyadmin/sbin/rebuildrepo @@ -5,10 +5,17 @@ use warnings; use Piny; +my $env = Piny::Environment->instance( ); + foreach my $reponame ( @ARGV ) { my $repo = Piny::Repo->new( $reponame ); + if ( $env->user->uid != 0 and $repo->owner->uid != $env->user->uid ) { + print STDERR "You are not the owner of $reponame!\n"; + exit 1; + }; + $repo->rebuild; }; |