diff options
author | Florent Villard <warly@mandriva.com> | 2006-10-11 05:49:07 +0000 |
---|---|---|
committer | Florent Villard <warly@mandriva.com> | 2006-10-11 05:49:07 +0000 |
commit | 17bf9d23b3ee9485567b6a27a78f8e7c3bab9e9b (patch) | |
tree | 4d9034a679b0ad8d489c6a21d7123ad80a511fc4 /iurt_root_command | |
parent | e0506d99106f53f4ff6073358d9913edcd568182 (diff) | |
download | iurt-17bf9d23b3ee9485567b6a27a78f8e7c3bab9e9b.tar iurt-17bf9d23b3ee9485567b6a27a78f8e7c3bab9e9b.tar.gz iurt-17bf9d23b3ee9485567b6a27a78f8e7c3bab9e9b.tar.bz2 iurt-17bf9d23b3ee9485567b6a27a78f8e7c3bab9e9b.tar.xz iurt-17bf9d23b3ee9485567b6a27a78f8e7c3bab9e9b.zip |
add initdb command
Diffstat (limited to 'iurt_root_command')
-rw-r--r-- | iurt_root_command | 10 |
1 files changed, 4 insertions, 6 deletions
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] <file1> <file2> ... <filen>]", "Remove files", \&rm, "Removing files" ], - [ "", "initdb", [ - - ], "<chroot>]", + [ "", "initdb", 1 , "<chroot>]", "perform a rpm --initdb in the chroot.", \&initdb, "Initializing the rpm database" ], [ "v", "verbose", 1, "<verbose level>", @@ -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}) { |