Your message dated Fri, 27 Aug 2021 16:48:44 +0000
with message-id <[email protected]>
and subject line Bug#983427: fixed in pam 1.4.0-10
has caused the Debian Bug report #983427,
regarding libpam-runtime: please add support for DPKG_ROOT
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
983427: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983427
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libpam-runtime
Version: 1.4.0-4.1
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: dpkg-root-support

Hi,

since dpkg 1.18.5, dpkg sets the variable DPKG_ROOT when invoking
maintainer scripts. Usually that variable is empty but when calling dpkg
with --root and --force-script-chrootless, dpkg will set DPKG_ROOT to
the new root directory. In that mode, maintainer scripts are called
without chroot(1) around them, and thus have to be able to possibly
operate on the path from DPKG_ROOT instead of working on /. This is
useful for bootstrapping, creating chroots for foreign architectures
where utilities from inside the chroot cannot be executed, avoiding
dependency loops between postinst scripts, installation without
requiring superuser privileges and for creating installations that do
not even contain dpkg. See
https://wiki.debian.org/Teams/Dpkg/Spec/InstallBootstrap for more
information.

To see the problem, you can run:

$ mmdebstrap --mode=chrootless --variant=custom --include=libpam-runtime 
unstable /dev/null
[...]
Setting up libpam-runtime (1.4.0-4.1) ...
open(/var/lib/pam/seen) failed: Permission denied at /usr/sbin/pam-auth-update 
line 232, <STDIN> line 11.
dpkg: error processing package libpam-runtime (--configure):
 installed libpam-runtime package post-installation script subprocess returned 
error exit status 13
Errors were encountered while processing:
 libpam-runtime
E: Sub-process /usr/bin/dpkg returned an error code (1)

The following patch fixes the problem:

diff --git a/debian/libpam-runtime.postinst b/debian/libpam-runtime.postinst
index 518e8d24..053fdae2 100644
--- a/debian/libpam-runtime.postinst
+++ b/debian/libpam-runtime.postinst
@@ -29,7 +29,7 @@ then
        done
 fi
 
-pam-auth-update --package $force
+pam-auth-update --root "$DPKG_ROOT" --package $force
 
 if [ -n "$force" ]; then
        rm -f /etc/pam.d/common-auth.pam-old \
diff --git a/debian/local/pam-auth-update b/debian/local/pam-auth-update
index 6d17ab72..18fd898c 100644
--- a/debian/local/pam-auth-update
+++ b/debian/local/pam-auth-update
@@ -82,6 +82,11 @@ while ($#ARGV >= 0) {
                $force = 1;
        } elsif ($opt eq '--package') {
                $package = 1;
+       } elsif ($opt eq '--root') {
+               my $rootdir = shift @ARGV;
+               $savedir = "$rootdir/$savedir";
+               $confdir = "$rootdir/$confdir";
+               $inputdir = "$rootdir/$inputdir";
        } elsif ($opt eq '--remove') {
                while ($#ARGV >= 0) {
                        last if ($ARGV[0] =~ /^--/);


Possibly, more is needed to correctly implement DPKG_ROOT support, but
with above patch, it is possible to run above mmdebstrap command
successfully.

Thanks!

cheers, josch

--- End Message ---
--- Begin Message ---
Source: pam
Source-Version: 1.4.0-10
Done: Sam Hartman <[email protected]>

We believe that the bug you reported is fixed in the latest version of
pam, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Sam Hartman <[email protected]> (supplier of updated pam package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Thu, 26 Aug 2021 13:43:23 -0600
Source: pam
Architecture: source
Version: 1.4.0-10
Distribution: unstable
Urgency: medium
Maintainer: Steve Langasek <[email protected]>
Changed-By: Sam Hartman <[email protected]>
Closes: 983427 992538 992848
Changes:
 pam (1.4.0-10) unstable; urgency=medium
 .
   * Fix syntax error in libpam0g.postinst when a systemd unit fails,
     Closes: #992538
   * Include upstream patch not to use crypt_checksalt; without this
     passwords set prior to bullseye were considered expired, Closes:
     #992848
   * Support DPKG_ROOT for pam-auth-update, thanks Johannes 'josch' Schauer
     Closes: #983427
Checksums-Sha1:
 f970837f0099a4d9fd912e5995ea0c4f46724cc6 1913 pam_1.4.0-10.dsc
 1c4fca49e211298227430135503a21692aa2e512 120896 pam_1.4.0-10.debian.tar.xz
 dac6c1fc6a9a46f56407dd15e4d16b85bcfed4c1 5083 pam_1.4.0-10_source.buildinfo
Checksums-Sha256:
 66f226023a80a4524e5c0a8a9f280fa7292ecb8dd4bdeacb2a4e6255f87949b8 1913 
pam_1.4.0-10.dsc
 67bc2fba683b98059968b280a3d8f94829fcb625cbc57fdd6ba792c77131d56d 120896 
pam_1.4.0-10.debian.tar.xz
 0e079f673bf3dba9e8dae813779ec408de73ee8ea095d28d18aba94fc14ef097 5083 
pam_1.4.0-10_source.buildinfo
Files:
 98796c1faa79ce850e95d124b9bde815 1913 libs optional pam_1.4.0-10.dsc
 8eb8765442ee5b8743ee08bffbf221f0 120896 libs optional 
pam_1.4.0-10.debian.tar.xz
 25c54077f9d055411d76950decca00f2 5083 libs optional 
pam_1.4.0-10_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iHUEARYIAB0WIQSj2jRwbAdKzGY/4uAsbEw8qDeGdAUCYSkTFQAKCRAsbEw8qDeG
dDELAP9pLJ+4uw/jWstApiOMmIag/84gn6nghvNlAOkIISONewD/YQHIoJVK4Lk3
xrSak3rpN0i63g1PISc39WKATGfeTgY=
=EZhu
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to