image.in, stage2: reworked TCB fixup hook

The issue at hand is that:

/etc/tcb/USER/shadow gets USER:auth ownership (OK);
/etc/tcb/USER/shadow- backup file is root:root (broken);
/etc/tcb/USER/shadow.lock file is also root:root (broken).

This is observed for all pseudousers created by package installation
process within working chroots as well as for users created by deflogin
feature; the problem is that e.g. echo USER:PASS | chpasswd will break.

Looks like the cuplrit might be fakeroot/faked.
This commit is contained in:
Michael Shigorin 2015-11-16 20:24:25 +03:00
parent e02d0cf9f1
commit 5427f3afdc
3 changed files with 10 additions and 8 deletions

View File

@ -1,8 +0,0 @@
#!/bin/sh -e
# /etc/tcb/<user>/shadow* permissions can be wrong
# if an account was created from installed package
cd /etc/tcb
for u in *; do
chown "$u":auth "$u"/shadow*
done

View File

@ -0,0 +1,5 @@
#!/bin/sh -e
# drop intermediate files not needed in the image
# which receive broken permissions in fakeroot environment
rm -f /etc/tcb/*/shadow{-,.lock}

View File

@ -0,0 +1,5 @@
#!/bin/sh -e
# drop intermediate files not needed in the image
# which receive broken permissions in fakeroot environment
rm -f /etc/tcb/*/shadow{-,.lock}