From 3ca6564c2d95d12dff83cc645c280aa734ad19f8 Mon Sep 17 00:00:00 2001 From: Joe Rayhawk Date: Wed, 11 May 2011 21:56:42 -0700 Subject: Making rebuildrepo user-usable and user-safe. --- pinyadmin/sbin/rebuildrepo | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pinyadmin/sbin') 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; }; -- cgit v1.2.3