[Mageia-dev] default $PATH after UsrMove

Luc Menut lmenut at free.fr
Sun Nov 11 19:04:08 CET 2012


Hi,

After UsrMove, /bin and /sbin are symlinks to /usr/bin and /usr/sbin.
For the moment, the default $PATH in cauldron is still /bin:/usr/bin:... 
for normal users, and /sbin:/usr/sbin/... for root, so that 'which 
a-binary' report that all /usr/[s]bin/... binaries are located in /bin 
or /sbin instead.
(some discussions about this on fedora devel mailing list [1]).

While it is not optimal to prefer the indirect path via symlink instead 
of the direct /usr/[s]bin/ path, it can trigger weird bugs difficult to 
detect, when there is automatic prefix detection based on the location 
of a binary (either at buildtime or at runtime).
eg. bug #7119 is due to an incorrect detection of the X11 prefix at 
buildtime; it is detected as "/" instead of "/usr", so that 
systemsettings searchs evdev.xml at "/share/X11/xkb/rules/evdev.xml" 
instead of "/usr/share/X11/xkb/rules/evdev.xml".
It seems to introduce non-optimal path for interpreter program in 
shebang line for some perl or python scripts [1].

So, we should probably drop /bin and /sbin from all search paths, in 
shadow-utils (/etc/login.defs), util-linux ("/bin/su - " doesn't use 
/etc/login.defs), openssh, ...

I think that we should drop these dirs from our defaults $PATH, before a 
future mass rebuild.

WDYT?



Regards,
Luc


[1] from Fedora
http://lists.fedoraproject.org/pipermail/devel/2012-February/162720.html
http://lists.fedoraproject.org/pipermail/devel/2012-September/171559.html
http://lists.fedoraproject.org/pipermail/devel/2012-October/173220.html
https://bugzilla.redhat.com/show_bug.cgi?id=797557

[2] on my system, grep "#\!/bin/perl" /usr/bin/*
/usr/bin/aclocal:#!/bin/perl -w
/usr/bin/aclocal-1.12:#!/bin/perl -w
/usr/bin/aclocal-1.8:#!/bin/perl -w
/usr/bin/aclocal-1.9:#!/bin/perl -w
/usr/bin/automake:#!/bin/perl -w
/usr/bin/automake-1.12:#!/bin/perl -w
/usr/bin/automake-1.8:#!/bin/perl -w
/usr/bin/automake-1.9:#!/bin/perl -w
/usr/bin/c_rehash:#!/bin/perl5
/usr/bin/diffpp:#!/bin/perl
/usr/bin/gdialog:#!/bin/perl
/usr/bin/sliceprint:#!/bin/perl
/usr/bin/xscreensaver-getimage-file:#!/bin/perl5 -w
/usr/bin/xscreensaver-getimage-video:#!/bin/perl5 -w
/usr/bin/xscreensaver-text:#!/bin/perl5 -w

grep "#\!/bin/python" /usr/bin/*
/usr/bin/bzr:#!/bin/python
/usr/bin/cheetah:#!/bin/python
/usr/bin/cheetah-analyze:#!/bin/python
/usr/bin/cheetah-compile:#!/bin/python
/usr/bin/django-admin.py:#!/bin/python
/usr/bin/easy_install:#!/bin/python
/usr/bin/easy_install-2.7:#!/bin/python
/usr/bin/mako-render:#!/bin/python
/usr/bin/manhole:#!/bin/python
/usr/bin/mgarepo:#!/bin/python
/usr/bin/ndiff:#!/bin/python
/usr/bin/pyhtmlizer:#!/bin/python
/usr/bin/tap2deb:#!/bin/python
/usr/bin/tap2rpm:#!/bin/python
/usr/bin/tapconvert:#!/bin/python
/usr/bin/trial:#!/bin/python
/usr/bin/twistd:#!/bin/python


More information about the Mageia-dev mailing list