From e5c77507a158f4184cb47d3040a89de9b809cfce Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Mon, 11 Jun 2012 22:33:57 +0200 Subject: [PATCH] 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. --- vm-systemd/misc-post.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vm-systemd/misc-post.sh b/vm-systemd/misc-post.sh index dbefd43..b86e6a7 100755 --- a/vm-systemd/misc-post.sh +++ b/vm-systemd/misc-post.sh @@ -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