El 6/11/24 a las 15:42, Lee Garrett escribió:
Package: base-files
Version: 12.4+deb12u8
Severity: normal
X-Debbugs-Cc: [email protected]
Hi,
reproducer for the problem:
$ mkdir tmp
$ sudo debootstrap bookworm tmp/
[...]
$ sudo PATH=not-set-correctly /usr/sbin/chroot tmp/ /bin/bash -l
bash: id: command not found
bash: [: : integer expression expected
PATH is taken from the parent shell, and that's sometimes undefined or
doesn't include /usr/bin/.
As such, the line 4 in /etc/profile should be changed from
if [ "$(id -u)" -eq 0 ]; then
to
if [ "$(/usr/bin/id -u)" -eq 0 ]; then
Thanks for the report, but I believe this is incompatible
with the existing plan to remove PATH from /etc/profile
(some day, maybe for trixie).
When we removed PATH from /etc/profile, we implicitly take for granted that
the PATH is already sane by the time it's executed.
So, instead of making /etc/profile more complex, which I would consider a step
in the wrong direction, I would try to investigate why in your system
the PATH was not sane to begin with.
Thanks.