#1124822 mmdebstrap: support subid delegation via nsswitch

Package:
mmdebstrap
Source:
mmdebstrap
Submitter:
Tobias Wiese
Date:
2026-10-05 03:49:02 UTC
Severity:
normal
Tags:
#1124822#5
Date:
2026-01-07 03:30:32 UTC
From:
To:
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

#1124822#10
Date:
2026-10-04 05:26:36 UTC
From:
To:
Hi Tobias,

does this change by Simone Caronni do what you ask?

https://gitlab.mister-muffin.de/josch/mmdebstrap/commit/966c51cec2b9ccd87707cbf305a0719d63beacec

Thanks!

cheers, josch

#1124822#15
Date:
2026-10-04 13:47:19 UTC
From:
To:
Hi josch,

It's similar, and it should be enough for my use case.

From 966c51cec2b9ccd87707cbf305a0719d63beacec:

This explicitly checks nsswitch.conf if subids are delegated to a plugin
called 'sss' (i.e. the one for sss(d)), and only then uses getsubids(1).
This means that this doesn't work for other subid plugins.

My patch doesn't care about the configured plugin and therefore also
delegates the scanning of /etc/subuid and /etc/subgid to getsubids if
the 'files' plugin is used.

If not delegating to getsubids when using the files plugin is preferred,
I propose to instead check if the plugin is not 'files'. Maybe a change
similar to this (untested):


Regards,

Tobias Wiese

#1124822#18
Date:
2026-10-05 03:47:35 UTC
From:
To:
Hi Tobias,

Quoting Tobias Wiese (2026-10-04 15:47:19)

could you discuss and agree with Simone Caronni (in CC) about the best way
forward here? I have no use nor expertise regarding nsswitch.conf and would
rely on contributors like you two to tell me what the best way forward would be
to allow your use-case for this.

Thanks!

cheers, josch