[Bug 2049529] Re: Ubuntu delta causes `can't open /dev/null: No such file or directory` errors in minimal environments (chroot/unshare)
Launchpad Bug Tracker
2049529 at bugs.launchpad.net
Wed Jan 22 12:42:34 UTC 2025
This bug was fixed in the package shadow - 1:4.16.0-7ubuntu1
---------------
shadow (1:4.16.0-7ubuntu1) plucky; urgency=medium
* Merge with Debian unstable. Remaining changes (LP: #2089923):
- d/p/* : Enable private home directories by default
- debian/{source_shadow.py,login.defs.install}: Add apport hook
- debian/patches/1010_extrausers.patch:
+ Add support to passwd for libnss-extrausers
+ Add automatic detection of "extrausers" for usermod -G
- d/p/1011_extrausers_toggle.patch: extrausers support for useradd/groupadd
- d/p/1012_extrausers_chfn.patch: --extrausers support for chfn tool
- d/p/1013_extrausers_deluser.patch: --extrausers support for userdel
- d/p/1014_extrausers_delgroup.patch: --extrausers support for groupdel
- d/p/1016_extrausers_gpasswd.patch: extrausers support for gpasswd
- d/p/506_relaxed_usernames.patch, d/t/{control,numeric-username}:
- d/t/smoke: Extend for extrausers support
- Add some cursory tests for the extrausers features
- d/p/lp2063200: fix useradd group validation with extrausers (LP 2063200)
* New Changes:
- d/tests: make 'upstream' tests work with current sources layout
* Drop Changes:
- d/p/1015_add_zsys_support.patch: zsys to handle home dir if available
Reason: buggy and unmaintained zsys integration (LP: #2049529)
shadow (1:4.16.0-7) unstable; urgency=medium
[ Florent 'Skia' Jacquet ]
* d/patches: fix 'upstream' test suite
shadow (1:4.16.0-6) unstable; urgency=medium
* Add NEWS entry about faillog (Closes: #1074320)
shadow (1:4.16.0-5) unstable; urgency=medium
[ Chris Hofstaedtler ]
* Always build with btrfs support on linux-any (Closes: #856557)
* debputy.manifest: merge path-metadata entries
* login.defs: remove info about write(1)
Which is not part of Debian trixie. (Closes: #1087519)
[ Pino Toscano ]
* Include <utmpx.h>, fixing the build on GNU/Hurd
shadow (1:4.16.0-4) unstable; urgency=medium
* Drop Debian-only cppw, cpgr tools (Closes: #750752)
* Stop patching login, not installed anymore
* Define LOGIN_NAME_MAX on HURD
* Remove libsystemd-dev Build-Depends.
Only necessary for login(1).
* Stop building programs we do not install
shadow (1:4.16.0-3) unstable; urgency=medium
* Upload to unstable.
* Fix FTBFS on hurd.
DEB_HOST_ARCH_OS was unset.
shadow (1:4.16.0-2) experimental; urgency=medium
* passwd: switch Depends from login to login.defs
login will again be installed on fewer systems, but existing installs
will retain it (it is Protected: yes).
* Drop login package, to allow takeover by util-linux.
Move shadow.mo to Package: passwd, have passwd Replaces: older login.
* login.defs: ship manpage
* Re-add workarounds for tests in tests/tests directory.
4.15.3 fixed this, but 4.16.0 happened earlier.
shadow (1:4.16.0-1) experimental; urgency=medium
* New upstream version 4.16.0
* Rebase patches
* Split /etc/login.defs into its own binary package (Closes: #1074394)
* Rename libsubid4 to libsubid5 (soname bump)
* d/watch: add versionmangle for -rc
-- Florent 'Skia' Jacquet <florent.jacquet at canonical.com> Mon, 02 Dec
2024 12:39:54 +0100
** Changed in: shadow (Ubuntu)
Status: Confirmed => Fix Released
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to shadow in Ubuntu.
https://bugs.launchpad.net/bugs/2049529
Title:
Ubuntu delta causes `can't open /dev/null: No such file or directory`
errors in minimal environments (chroot/unshare)
Status in adduser package in Ubuntu:
Confirmed
Status in shadow package in Ubuntu:
Fix Released
Status in adduser source package in Noble:
Confirmed
Status in shadow source package in Noble:
Confirmed
Bug description:
Hi,
I was digging into fixing `autopkgtest`'s `unshare` testsuite, and the
rabbit hole led me here.
Here is a very quick reproducer, first:
Start a fresh Ubuntu VM. Here is a quick path, but other ways should do fine:
```
$ cd /tmp
$ autopkgtest-buildvm-ubuntu-cloud -a amd64 -r noble
$ kvm -m 1G -snapshot -hda autopkgtest-noble-amd64.img
```
Now in the VM:
```
$ sudo apt install -y mmdebstrap
$ mmdebstrap noble /tmp/rootfs
[...]
$ sudo useradd --create-home --root /tmp/rootfs user1
can't open /dev/null: No such file or directory
```
The line `can't open /dev/null: No such file or directory` is printed
on `stderr`, and that's unexpected by the part of the code I was
debugging in the first place.
Digging a bit led me to that line that does the printing:
https://git.launchpad.net/ubuntu/+source/shadow/tree/debian/patches/1015_add_zsys_support.patch#n69
There seem to me that there are multiple issues with that patch:
* Why try to call `zsysctl` in every case without first checking that it would be relevant: ZFS is not even installed on the VM we just created, less alone it has any ZFS volume/pool/whatever.
* Obviously, when creating a user in a `chroot`, `/dev/null` won't exist unless mapped, and `useradd` is perfectly aware of that, because it even does the `chroot` call itself! But why even try to mess with ZFS in the `chroot` case in the first place?
From what history @brian-murray told me, this patch was part of some
ZFS experimentation in the past. Maybe that experimentation is now
finished, and that patch could be dropped? At the very least it needs
improvements, imho.
EDIT: Just for context on why this issue appears only now: I was
trying to fix the `unshare` testsuite in `autopkgtest`, which is
pretty recent (2022) (https://salsa.debian.org/ci-
team/autopkgtest/-/commit/d1671f94f68bce9a0c6793310a9f8b79b4e919a5)
even upstream on Debian, and has never worked yet on Ubuntu.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/adduser/+bug/2049529/+subscriptions
More information about the foundations-bugs
mailing list