Your message dated Sun, 9 Dec 2012 14:45:37 +0100 (CET)
with message-id <[email protected]>
and subject line Re: Bug#694152: /etc/profile requires reasonable PATH for 
setting PATH
has caused the Debian Bug report #694152,
regarding /etc/profile requires reasonable PATH for setting PATH
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
694152: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=694152
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: base-files
Version: 6.12
Severity: minor
File: /etc/profile

/etc/profile, the file which should define reasonable PATH settings eg
for `/bin/bash -l` (as it would be invoked when chrooting in from an
exotic environment) depends on PATH being set in order to set PATH:

> if [ "`id -u`" -eq 0 ]; then
>   PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
> else
>   PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
> fi

while this does work by silently failing and taking one of the options
if `id` is not found, it would be preferrable to explicitly use
`/usr/bin/id`.

an example of when this can be important is when chrooting in from an
android system with its PATH configured to only strange locations.


-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.5-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages base-files depends on:
ii  gawk [awk]  1:4.0.1+dfsg-2
ii  mawk [awk]  1.3.3-17

base-files recommends no packages.

base-files suggests no packages.

-- no debconf information

Attachment: signature.asc
Description: Digital signature


--- End Message ---
--- Begin Message ---
On Sat, 24 Nov 2012, chrysn wrote:

> Package: base-files
> Version: 6.12
> Severity: minor
> File: /etc/profile
> 
> /etc/profile, the file which should define reasonable PATH settings eg
> for `/bin/bash -l` (as it would be invoked when chrooting in from an
> exotic environment) depends on PATH being set in order to set PATH:
> 
> > if [ "`id -u`" -eq 0 ]; then
> >   PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
> > else
> >   PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
> > fi
> 
> while this does work by silently failing and taking one of the options
> if `id` is not found, it would be preferrable to explicitly use
> `/usr/bin/id`.
> 
> an example of when this can be important is when chrooting in from an
> android system with its PATH configured to only strange locations.

Sorry for the delay in processing this bug.

I see the problem that you are trying to fix, but I don't see
that the proposed fix is a good one.

You define /etc/profile as "the file which should define reasonable
PATH settings". However, that's not exact. The file which "should"
define the PATH is really /etc/login.defs.

I once tried to remove the PATH setting from /etc/profile in favour of
/etc/login.defs but this broke ssh in some unexpected way and I had to
restore the previous setting (I don't remember bug numbers right now
but they are certainly in the BTS archive).

As a result, the PATH is currently defined in two stages and
/etc/profile expects a PATH which is not crazy enough to not include
basic utilities like the ones found in coreutils.


The reason why your proposed solution is not a good one is that there
is a general rule saying "command paths should not be hardcoded
because it defeats the purpose of having a PATH at all". This is
explicitly written in policy for maintainer scripts, but it is still a
good general rule everywhere else.


So, if you are using base-files in strange environments that do not
allow you to have a working /etc/login.defs, please consider using the
profile.d mechanism to override /etc/profile. Bear in mind that the
PATH setting in /etc/profile may not always be there.

Thanks.

--- End Message ---

Reply via email to