(No, it was not me who made this necessary. Yes, we did reinstall the machine anyway.)
#!/bin/bash while read p; do rpm -V $p > /dev/null && continue echo "fixing $p's file ownership..." while read x x u g x x x x n x; do chown -h $u:$g $n done < <(rpm -qlv $p) done < <(rpm -qa)
I like your script, it is ingenius -- but maybe this would have been sufficien :) for p in $(rpm -qa); do rpm --setperms $p; done for p in $(rpm -qa); do rpm --setugids $p; done
rpm --help | grep set
ReplyDelete--setperms set permissions of files in a package
--setugids set user/group ownership of files in a package
that wouldnt have helped you?
I like your script, it is ingenius -- but maybe this would have been sufficien :)
ReplyDeletefor p in $(rpm -qa); do rpm --setperms $p; done
for p in $(rpm -qa); do rpm --setugids $p; done
Hehe, you know, I never stop learning about these things. Next time (let's hope this never happens) I'll read the manpage first... ;)
ReplyDelete