- Package:
- base-files
- Source:
- base-files
- Description:
- Debian base system miscellaneous files
- Submitter:
- Lee Garrett
- Date:
- 2025-09-03 17:43:02 UTC
- Severity:
- normal
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 in advance! Greets, Lee
El 6/11/24 a las 15:42, Lee Garrett escribió: 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.
Hello. Given that some distributions (for example, Ubuntu) do not have any PATH at all in /etc/profile, I consider reasonable to assume that by the time /etc/profile is read, PATH contains /usr/bin at least. So, if PATH is undefined or does not include /usr/bin, it's probably a symptom that there is something wrong somewhere. Modifying /etc/profile as suggested would just hide the problem and make the file more complex without a real need. Thanks.