Move on, nothing to see here.
#!/bin/bashwhile 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)
rpm --help | grep set --setperms set permissions of files in a package --setugids set user/group ownership of files in a packagethat wouldnt have helped you?
I like your script, it is ingenius -- but maybe this would have been sufficien :)for p in $(rpm -qa); do rpm --setperms $p; donefor 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... ;)