18 Jan
2002
18 Jan
'02
10:39
Steven Marcus
I made a typo which resulted in chown -R xxx:yyy /
The owner and group information was changed on /bin /dev and /etc before my frantic control-c stopped the process.
I have rpm -Va --nomd5 and have a list of files whose owner and/or group need to be changed back.
Have a look at the following (slow) script. You can supply your list of files there by replacing "find" with "cat filelist". #!/bin/bash find /dev /etc -print \ | while read fname; do ans=$(rpm -qf --queryformat "%{FILEUSERNAME}.%{FILEGROUPNAME}" "$fname" 2>/dev/null) if [[ $? -eq 0 ]]; then echo "chown $ans $fname" fi done There are more ways how to fix the ownership. -- Alexandr.Malusek@imv.liu.se