]> git.corax.cc Git - toolbox/commitdiff
debian: Don't create/remove groups during upgrades/downgrades
authorMatthias Kruk <m@m10k.eu>
Sat, 22 Jan 2022 07:48:46 +0000 (16:48 +0900)
committerMatthias Kruk <m@m10k.eu>
Sat, 22 Jan 2022 07:54:34 +0000 (16:54 +0900)
The debian maintainer scripts remove and create group during upgrades
and downgrades, causing the group ids to change, locking users out of
/var/lib/toolbox.

This commit modifies the debian maintainer scripts so that they only
remove groups during package removals.

debian/postinst
debian/postrm

index 98ed2e45c607186bdb4997ec628d32348abc52ec..154bcadc20a5e3fd0f974cd131e6008d0c403536 100755 (executable)
@@ -1,6 +1,13 @@
 #!/bin/sh
 
 main() {
+       action="$1"
+
+       # only add groups and stat overrides when installing
+       if [ "$action" != "configure" ]; then
+               return 0
+       fi
+
        # If a group exists, there is a chance that the user
        # has customized directory ownership and permissions,
        # so we don't change it.
index c8c707e0a4c25342ab4a7f9c1a9ded6677c5ed85..6403e9e7153375040eaa71eef1c1c8646de51265 100755 (executable)
@@ -1,6 +1,13 @@
 #!/bin/sh
 
 main() {
+       action="$1"
+
+       # don't remove stat overrides if not uninstalling
+       if [ "$action" != "remove" ]; then
+               return 0
+       fi
+
        if dpkg-statoverride --list /var/lib/toolbox/ipc >/dev/null 2>&1; then
                dpkg-statoverride --remove /var/lib/toolbox/ipc
        fi