[NTLUG:Discuss] Restore owners

Wayne Walker wwalker at bybent.com
Sat Mar 29 20:57:03 CDT 2008


The following commands will return the data about files installed via
RPM

By file: 

rpm -qf --dump /bin/ls | grep ^/bin/ls\ 

or 

By entire package:
rpm -q --dump sendmail-cf

THE FOLLWING WERE NOT TESTED!!  But should work maybe with minor
modifications

chmod `rpm -qf --dump /bin/ls | grep ^/bin/ls\  | awk '{print $5}'`
chown `rpm -qf --dump /bin/ls | grep ^/bin/ls\  | awk '{print $6}'`
chgrp `rpm -qf --dump /bin/ls | grep ^/bin/ls\  | awk '{print $7}'`

On Thu, Mar 06, 2008 at 11:49:51AM -0600, Greg Edwards wrote:
> How can I restore ownerships on a block of files on a RHEL system?  I
> know that this question has been asked before but I couldn't find it in
> the archives.
> 
>  
> 
> IIRC, RH keeps a file that is part of the security monitoring system and
> logs the ownerships as of yesterday.  I don't remember where this is
> kept and if RH has a command that will restore the ownerships in bulk.
> If I have the file I can write my own script to get it fixed.
> 
>  
> 
> This was a case of fat fingers and trying to work faster that I think!!!
> I was 1 dir up from where I should have been and changed everything in
> /usr/lib, ugh!!
> 
>  
> 
> TIA
> 
>  
> 
> --
> 
> Greg Edwards
> 
>  
> 
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss

-- 

Wayne Walker

wwalker at bybent.com                    Do you use Linux?!
http://www.bybent.com                 Get Counted!  http://counter.li.org/
Perl - http://www.perl.org/           Perl User Groups - http://www.pm.org/
Jabber:  wwalker at jabber.bybent.com   AIM:     lwwalkerbybent
IRC:     wwalker on freenode.net



More information about the Discuss mailing list