diff --git a/debian/qubes-core-agent.preinst b/debian/qubes-core-agent.preinst index 7270880..9203259 100755 --- a/debian/qubes-core-agent.preinst +++ b/debian/qubes-core-agent.preinst @@ -59,7 +59,15 @@ if [ "$1" = "install" ] ; then fi if [ "$1" = "upgrade" ] ; then - true + ## Fix static gid issue for in place template upgrades. + ## https://github.com/QubesOS/qubes-issues/issues/1105 + if grep -q ^qubes:x:98: /etc/group ; then + if ! grep -q :980: /etc/group ; then + if groupmod -g 980 qubes ; then + find / -gid 98 ! -type l -exec chgrp --verbose qubes {} \; 2>/dev/null || true + fi + fi + fi fi # dh_installdeb will replace this with shell code automatically