NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Friday July 02, 2004
And so there was this guy who performed a chmod -R 770 /
. That's funny, but what to do when you have to repair the machine ? You can extract all the original permissions from the RPM database
my ($package) = @_;
my $name = $package->fullname;
my @modes = $package->files_mode;
printf "$name:$_:%04o\n",(shift @modes) & 07777 for $package->files;
At least this works on a Mandrakelinux system. URPM.pm, the perl bindings to RPMs, are not backported to CPAN (-- yet).
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.