Your message dated Wed, 04 Nov 2026 15:05:28 +0000
with message-id <[email protected]>
and subject line Bug#1124822: fixed in mmdebstrap 1.7.0-1
has caused the Debian Bug report #1124822,
regarding mmdebstrap: support subid delegation via nsswitch
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.)


-- 
1124822: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1124822
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: mmdebstrap
Version: 1.5.7-1+deb13u1
Severity: wishlist
Tags: patch upstream

Hi,

newuidmap / newgidmap consult /etc/nsswitch.conf to decide where to
get information on allowed sbuids from.
The /etc/subuid and /etc/subgid files are only used if the subid filed
in /etc/nsswitch.conf is either unset or set to files (see subuid(5)).
Otherwise the information is retrived by calling some function in a
shared object file derived from the subid value in /etc/nsswitch.conf.

I propose the retrieve the subuids/subgids by calling the getsubids
command included in the uidmap package.

I proposed a similar change to sbuild here:
https://salsa.debian.org/debian/sbuild/-/merge_requests/222


Regards,

Tobias Wiese
>From 1e5a477b197f166e14fcd53abba2a71a3566656d Mon Sep 17 00:00:00 2001
Message-ID: <1e5a477b197f166e14fcd53abba2a71a3566656d.1767754632.git.tob...@tobiaswiese.com>
From: Tobias Wiese <[email protected]>
Date: Wed, 7 Jan 2026 03:57:03 +0100
Subject: [PATCH] Support subid delegation via /etc/nsswitch.conf

newuidmap / newgidmap consult /etc/nsswitch.conf to decide where to
get information on allowed sbuids from.
The /etc/subuid and /etc/subgid files are only used if the subid filed
in /etc/nsswitch.conf is either unset or set to files (see subuid(5)).
Otherwise the information is retrived by calling some function in a
shared object file derived from the subid value in /etc/nsswitch.conf.

This will use the getsubids command to retrieve the subids that will
also be used by newuidmap/newgidmap.

This does not create an additional package dependency as getsubids is
included in the uidmap package, as is newuidmap / newgidmap.

Alternatives:
- do ffi in perl to load and call the libsubid plugin

Test Plan:
build a chroot tar with mmdebstrap on a systems with subids managed by
files and sssd using unshare mode.

Signed-off-by: Tobias Wiese <[email protected]>
---
 mmdebstrap | 79 ++++++++++--------------------------------------------
 1 file changed, 14 insertions(+), 65 deletions(-)

diff --git a/mmdebstrap b/mmdebstrap
--- a/mmdebstrap
+++ b/mmdebstrap
@@ -1429,7 +1429,7 @@ sub read_subuid_subgid {
     my $verbose  = shift;
     my @result   = ();
     my $username = getpwuid $REAL_USER_ID;
-    my ($subid, $num_subid, $fh, $n);
+    my ($fh, $line, $subid, $num_subid);
 
     local *maybe_warn = sub {
         my $msg = shift;
@@ -1439,82 +1439,31 @@ sub read_subuid_subgid {
             debug $msg;
         }
     };
-    if (!-e "/etc/subuid") {
-        maybe_warn("/etc/subuid doesn't exist");
-        return;
-    }
-    if (!-r "/etc/subuid") {
-        maybe_warn("/etc/subuid is not readable");
-        return;
-    }
 
-    open $fh, "<", "/etc/subuid"
-      or maybe_warn("cannot open /etc/subuid for reading: $!");
-    if (!$fh) {
-        return;
-    }
-    while (my $line = <$fh>) {
-        ($n, $subid, $num_subid) = split(/:/, $line, 3);
-        last if ($n eq $username);
-    }
-    close $fh;
-    if (!length $subid) {
-        maybe_warn("/etc/subuid is empty");
+    unless (open $fh, "-|", "getsubids", $username) {
+        maybe_warn("cannot execute getsubids: $!");
         return;
     }
-    if ($n ne $username) {
-        maybe_warn("no entry in /etc/subuid for $username");
+    $line = <$fh>;
+    unless (close $fh and defined($line)) {
+        maybe_warn("No subuid entry for $username");
         return;
     }
+
+    (undef, undef, $subid, $num_subid) = split(/ /, $line, 4);
     push @result, ["u", 0, $subid, $num_subid];
 
-    if (scalar(@result) < 1) {
-        maybe_warn("/etc/subuid does not contain an entry for $username");
-        return;
-    }
-    if (scalar(@result) > 1) {
-        maybe_warn("/etc/subuid contains multiple entries for $username");
+    open $fh, "-|", "getsubids", "-g", $username
+      or die "cannot execute getsubids: $!";
+    $line = <$fh>;
+    unless (close $fh and defined($line)) {
+        maybe_warn("No subgid entry for $username");
         return;
     }
 
-    if (!-e "/etc/subgid") {
-        maybe_warn("/etc/subgid doesn't exist");
-        return;
-    }
-    if (!-r "/etc/subgid") {
-        maybe_warn("/etc/subgid is not readable");
-        return;
-    }
-
-    open $fh, "<", "/etc/subgid"
-      or maybe_warn("cannot open /etc/subgid for reading: $!");
-    if (!$fh) {
-        return;
-    }
-    while (my $line = <$fh>) {
-        ($n, $subid, $num_subid) = split(/:/, $line, 3);
-        last if ($n eq $username);
-    }
-    close $fh;
-    if (!length $subid) {
-        maybe_warn("/etc/subgid is empty");
-        return;
-    }
-    if ($n ne $username) {
-        maybe_warn("no entry in /etc/subgid for $username");
-        return;
-    }
+    (undef, undef, $subid, $num_subid) = split(/ /, $line, 4);
     push @result, ["g", 0, $subid, $num_subid];
 
-    if (scalar(@result) < 2) {
-        maybe_warn("/etc/subgid does not contain an entry for $username");
-        return;
-    }
-    if (scalar(@result) > 2) {
-        maybe_warn("/etc/subgid contains multiple entries for $username");
-        return;
-    }
-
     return @result;
 }
 
-- 
2.47.3


--- End Message ---
--- Begin Message ---
Source: mmdebstrap
Source-Version: 1.7.0-1
Done: Johannes Schauer Marin Rodrigues <[email protected]>

We believe that the bug you reported is fixed in the latest version of
mmdebstrap, 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.
Johannes Schauer Marin Rodrigues <[email protected]> (supplier of updated 
mmdebstrap 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: SHA512

Format: 1.8
Date: Wed, 04 Nov 2026 15:51:39 +0100
Source: mmdebstrap
Architecture: source
Version: 1.7.0-1
Distribution: unstable
Urgency: medium
Maintainer: Johannes Schauer Marin Rodrigues <[email protected]>
Changed-By: Johannes Schauer Marin Rodrigues <[email protected]>
Closes: 1036151 1082899 1091442 1106755 1121344 1124822 1129567 1131026 1132514 
1135727 1139592 1140780
Changes:
 mmdebstrap (1.7.0-1) unstable; urgency=medium
 .
   * New upstream version 1.7.0
   * debian/tests/control:
      - document autopkgtest triggers on systemd, procps, manpages and passwd
      - add autopkgtest trigger on libarchive-tools and tar
      - add dependency on erofs-utils and libarchive-tools for erofs and cpio
        output formats
      - remove isc-dhcp-client which got removed from Debian, see #1143544
   * Cleanup dpkg and debconf *-old backup files (Closes: #1082899)
   * place DPkg::Pre-Install-Pkgs workaround into a new config file (Closes:
     #1091442)
   * Better honor TMPDIR without relying on Perl's File::Spec->tmpdir fallback
     to /tmp
     Thanks to Leo (Meng Hsi) Li (Closes: #1135727)
   * Fix Acquire::Languages example (Closes: #1131026)
   * Also mention the abbreviation --hook-dir (Closes: #1140780)
   * mmdebstrap-autopkgtest-build-qemu: add sshkey to user
     Thanks to Jochen Sprickerhof (Closes: #1106755)
   * Create pax tar archives with --sparse (Closes: #1129567)
   * Also cleanup /etc/hostid (Closes: #1036151)
   * Check if keyring can be read from inside the unshared user namespace
     (Closes: #1139592)
   * Fix handling of files in --dpkgopt and --aptopt if no trailing newline
     Thanks to Josh Triplett (Closes: #1132514)
   * Divert start-stop-daemon
     Thanks to Helmut Grohne (Closes: #1121344)
   * Support subid delegation via nsswitch
     Thanks to Simone Caronni (Closes: #1124822)
   * Fix(cleanup/reproducible/machine-id): preserve permissions of machine-id
     Thanks to Elkhan Mammadli
   * Accept SHA512 from apt in eatmydata hook
     Thanks to May Durst
   * Explain bad or missing TMPDIR
     Thanks to Tj
   * Prefer keyrings with .pgp extension over .gpg
     Thanks to Guillem Jover
   * debian/patches: drop all patches (applied upstream)
   * tests/skip-tar-in-mknod: cherry-pick upstream fix
   * README.md: strongly worded exclusion of contributions not created by humans
Checksums-Sha1:
 12663bd68e28758b6a55abe82da1dbe68492add8 2648 mmdebstrap_1.7.0-1.dsc
 80d08f908933545208fcddf27df2b739d45f1b27 183982 mmdebstrap_1.7.0.orig.tar.gz
 3c84e315deffe7e83799ed08a2b4707ea8a3bd29 21096 mmdebstrap_1.7.0-1.debian.tar.xz
Checksums-Sha256:
 7229edcc2e60d4ade71dc636a925032938cf5daa56d39183b916263bd04d773f 2648 
mmdebstrap_1.7.0-1.dsc
 af4d10d87f71d5b94ad5272a002231150c7817e21fa3deda9f67775f43005327 183982 
mmdebstrap_1.7.0.orig.tar.gz
 0d537d1efbf2db027d1ca24349ca91d53959ec948907644b3995065030d9b8e8 21096 
mmdebstrap_1.7.0-1.debian.tar.xz
Files:
 e71f55140f31d656231ab79cb44f0f08 2648 admin optional mmdebstrap_1.7.0-1.dsc
 a868a4fb345da21e0be1790336fcde6f 183982 admin optional 
mmdebstrap_1.7.0.orig.tar.gz
 89d8b70df548ec26d36694419ef52177 21096 admin optional 
mmdebstrap_1.7.0-1.debian.tar.xz

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

iQIzBAEBCgAdFiEElFhU6KL81LF4wVq58sulx4+9g+EFAmrrRqIACgkQ8sulx4+9
g+HRPw/+NMh+AHeWsQ16SLcQnReoMGksE6msYwvmDve5xoEAkmz2e7tfSwvdzmnF
0GFiOu2yT9qJjUlHHsQ1bRQNNazUDsjHTQd/bqw2c1RfPNYH+RhzjV4QOWTK8CAY
k+VAsvexlwPp4nWfTHjH2zdERAyrSoumu6gdNl5cvekDhdSsSBN32ZhleUjN7wrW
iGx53aliCzUFdn9G8XmUWev6JVaeJ2BeHiUhnXqR+Eylt58HprXsBI9u36nSuNrg
Si+QHRVo0mSo1rr2D2moRiRhmvOF3fdbn/o9h144SMPUsKmOJAltt1RgJKLdLxNE
Ptagacbe3NhJyLY2H4WRfx5Z/k3jjs1YE/Ifq1Ekoaakmj13dhilaYo04+5axKk5
g00b3nckHM/zSciwxQu9Lv41MyCdQjPiYeOLZDWTAyl2LKjwQSCTzlh+0xnH6lkV
dwHirUky5hFfUAdRQsiMtpd7geMu6mgkgGZtXIHXSvA90amGT96p3IPGufBlCMc0
dhLRTf8uNTZ//obhEExNAaHJMCD1HZ8f1o38mPSmZsy7KvLTkKsSy05hAM692j8c
bGLrmXAtMjonPSj39NJVor6PVVBmGf3TsSKubCc0vrE3hNWtIOt3Mz2MDPjVG+PF
+jNnW2FNBdWv/7qMFpf910rbR+NNKuO/xwrRTpMQtopf5UpE5Uk=
=2gNa
-----END PGP SIGNATURE-----

Attachment: pgp617TFm6KMr.pgp
Description: PGP signature


--- End Message ---

Reply via email to