Package: sbuild
Version: 0.89.3+deb13u1~bpo12+2
Severity: wishlist
X-Debbugs-Cc: [email protected]

Whilst checking a fix for an armhf FTBFS (time_t64 related) in package
w3cam being recovered by the Salvage Team I hit an error that took some
time to understand using sbuild + unshare with NFS.

It is due to NFS (v4.2) not supporting sub[ug]id since the server side has no
notion that a (user) namespace is used by the client process.

On both server and client both the user ID and the sub[ig]id ranges are
identical (1000 -> 100000,65536).

I had hoped to be able to use idmapd.conf on the server to define an id
translation but from what I can see it will only translate name<>name
not uid<>uid, and mapping won't work either since maps are name<>uid.

Detecting it can be done with something like:

findmnt --noheading --type nfs4 --output SOURCE "${unshare_tmpdir_template}" || 
{ echo "error"; exit 1; }

That would need translating to Perl of course!

Client's /var/log/syslog sees:

 nfsidmap[28528]: name_lookup: nfs4_uid_to_name: for 100000 failed: Unknown 
error -2

+==============================================================================+
| w3cam 0.7.2-6.4 (armhf)                      Mon, 27 Oct 2025 14:18:55 +0000 |
+==============================================================================+

Package: w3cam
Version: 0.7.2-6.4
Source Version: 0.7.2-6.4
Distribution: unstable
Machine Architecture: armhf
Host Architecture: armhf
Build Architecture: armhf
Build Type: full

chown: changing ownership of 
'/srv/NAS/Sunny/SourceCode/builds/tmp.sbuild.TivYsuQN': Invalid argument
bad exit status (1): unshare --map-user 0 --map-group 0 --map-users 100000,1,1 
--map-groups 100000,1,1 chown 1:1 
/srv/NAS/Sunny/SourceCode/builds/tmp.sbuild.TivYsuQN
E: Error creating chroot session: skipping w3cam


The scenario is my workstation (Sunny using Bookworm, amd64) exports my 
SourceCode
directory tree where each package has its own sub-dir using NFSv4.2. 
Additionally it 
has a ${NAS}/SourceCode/builds/ directory for out-of-tree build product.

In the instant case I needed to do a test build on real armhf
architecture so used a RasPi host ("Noc") that mounts the NFS export
mounted at the same path.

After some 'fun' getting the sbuild installed and its config copied over from 
Sunny and changing
from:

 $unshare_tmpdir_template = '/dev/shm/tmp.sbuild.XXXXXXXX';

to:

 $unshare_tmpdir_template = 
'/srv/NAS/Sunny/SourceCode/builds/tmp.sbuild.XXXXXXXX';

it caused the above quoted error. The error also occurs outside of sbuild
when attempting:

 unshare --map-user 0 --map-group 0 --map-users 100000,1,1 --map-groups 
100000,1,1 chown 1:1 /srv/NAS/Sunny/SourceCode/builds/tmp.sbuild.TivYsuQN


-- System Information:
Debian Release: 12.12
  APT prefers oldstable-updates
  APT policy: (500, 'oldstable-updates'), (500, 'oldstable-security-debug'), 
(500, 'oldstable-security'), (500, 'oldstable-proposed-updates-debug'), (500, 
'oldstable-proposed-updates'), (500, 'oldstable-debug'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.16.8+debian+tj (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/bash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages sbuild depends on:
ii  adduser         3.134
ii  libsbuild-perl  0.89.3+deb13u1~bpo12+2
ii  perl            5.36.0-7+deb12u3

Versions of packages sbuild recommends:
ii  autopkgtest  5.28
ii  debootstrap  1.0.128+nmu2+deb12u2
ii  iproute2     6.1.0-3
ii  mmdebstrap   1.5.6-4~bpo12+1
ii  schroot      1.6.13-3+b2
ii  uidmap       1:4.13+dfsg1-1+deb12u1

Versions of packages sbuild suggests:
ii  e2fsprogs  1.47.0-2+b2
ii  kmod       30+20221128-1
ii  wget       1.21.3-1+deb12u1

-- no debconf information

Reply via email to