]> git.proxmox.com Git - proxmox-backup.git/commitdiff
d/postinst: always fixup termproxy user id and for all users
authorStefan Reiter <s.reiter@proxmox.com>
Tue, 1 Sep 2020 14:50:18 +0000 (16:50 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 1 Sep 2020 16:02:11 +0000 (18:02 +0200)
Anyone with a PAM account and Sys.Console access could have started a
termproxy session, adapt the regex.

Always test for broken entries and run the sed expression to make sure
eventually all occurences of the broken syntax are fixed.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
debian/postinst

index 9ab787989ff63d493affcbdcb556c95d9583206b..adf49da632efa277a29091f14bc8664245589952 100644 (file)
@@ -15,11 +15,10 @@ case "$1" in
        fi
        deb-systemd-invoke $_dh_action proxmox-backup.service proxmox-backup-proxy.service >/dev/null || true
 
-       if test -n "$2"; then
-               if dpkg --compare-versions "$2" 'le' '0.8.10-1'; then
-                       echo "Fixing up termproxy user id in task log..."
-                       flock -w 30 /var/log/proxmox-backup/tasks/active.lock sed -i 's/:termproxy::root: /:termproxy::root@pam: /' /var/log/proxmox-backup/tasks/active
-               fi
+       # FIXME: Remove in future version once we're sure no broken entries remain in anyone's files
+       if grep -q -e ':termproxy::[^@]\+: ' /var/log/proxmox-backup/tasks/active; then
+           echo "Fixing up termproxy user id in task log..."
+           flock -w 30 /var/log/proxmox-backup/tasks/active.lock sed -i 's/:termproxy::\([^@]\+\): /:termproxy::\1@pam: /' /var/log/proxmox-backup/tasks/active
        fi
     ;;