vm: chown /home/user to user if user UID have changed

FC16 and FC17 starts normal users at UID 1000, not 500 as in <=FC15.
This commit is contained in:
Marek Marczykowski 2012-06-11 22:33:57 +02:00
parent 9a028d23c5
commit e9bdc21bc2

View File

@ -30,6 +30,11 @@ if [ -e /dev/xvdb ] ; then
touch /var/lib/qubes/first_boot_completed
fi
# Chown home if user UID have changed - can be the case on template switch
HOME_USER_UID=`ls -dn /home/user | awk '{print $3}'`
if [ "`id -u user`" -ne "$HOME_USER_UID" ]; then
find /home/user -uid "$HOME_USER_UID" -print0 | xargs -0 chown user:user
fi
fi
[ -x /rw/config/rc.local ] && /rw/config/rc.local