Way to reproduce it:

1. Install package in the *host* machine:
# apt-get install debian-security-support

2. Enter a sid chroot where debian-security-support has never been installed:
# schroot -c sid

3. Install package inside the chroot:
# apt-get install debian-security-support

The postinst blindly assumes that if the user debian-security-support
exists, then /var/lib/debian-security-support should also exist:

    if ! getent passwd "$USERNAME" > /dev/null; then
       adduser \
       [...]
       --home "$LIB_DIR" \
       [...]
       "$USERNAME"
    fi

But schroot by default copies /etc/passwd from the host machine (where
the user already exists) inside the chroot, breaking the assumption.

Maybe the patch below is enough to fix this.

Thanks.

--- a/debian/debian-security-support.postinst
+++ b/debian/debian-security-support.postinst
@@ -20,6 +20,11 @@ configure)
             "$USERNAME"
     fi
 
+    if [ ! -d "$LIB_DIR" ]; then
+      mkdir "$LIB_DIR"
+      chown $USERNAME:$USERNAME "$LIB_DIR"
+    fi
+
     if [ "$TMPDIR" ] && [ "$(stat --format=%a "$TMPDIR")" != '1777' ] ; then
         export TMPDIR='/tmp'
     fi

Reply via email to