From 17bf9d23b3ee9485567b6a27a78f8e7c3bab9e9b Mon Sep 17 00:00:00 2001 From: Florent Villard Date: Wed, 11 Oct 2006 05:49:07 +0000 Subject: add initdb command --- iurt_root_command | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'iurt_root_command') diff --git a/iurt_root_command b/iurt_root_command index 8be134a..fa6a3b6 100644 --- a/iurt_root_command +++ b/iurt_root_command @@ -74,9 +74,7 @@ $run{todo} = [ ]; ], "[-r] ... ]", "Remove files", \&rm, "Removing files" ], - [ "", "initdb", [ - - ], "]", + [ "", "initdb", 1 , "]", "perform a rpm --initdb in the chroot.", \&initdb, "Initializing the rpm database" ], [ "v", "verbose", 1, "", @@ -128,17 +126,17 @@ sub mkdir { sub initdb { my ($run, $chroot) = @_; if (-d $chroot && $chroot !~ /chroot|unionfs/) { - print {$run{LOG}} "ERROR $program_name: rpm --initddb not authorized in $chroot\n"; + print {$run{LOG}} "ERROR $program_name: rpm --initdb not authorized in $chroot\n"; return 0 } - !system("rpm", "--initddb", "--root", "$chroot") + !system("rpm", "--initdb", "--root", "$chroot") } sub rm { my ($run, $opt, @files) = @_; my $ok = 1; my $done; - my $unauthorized = "/root|/dev|/var|/lib|/usr"; + my $unauthorized = "^(/etc|/root|/dev|/var|/lib|/usr)"; foreach my $f (@files) { if (-d $f) { if (!$opt->{recursive}) { -- cgit v1.2.1