You are not logged in.

#1 2019-09-19 22:47:30

cadilhac
Member
Registered: 2012-04-27
Posts: 19

xdm's default PATH masks /usr/local/bin

This is on a fresh install, and I use xdm-archlinux.

My $PATH is populated with the following on starting a session via XDM:

  /bin:/usr/bin:/usr/bin:/usr/ucb:/usr/local/sbin:/usr/local/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

The first bit, up to /usr/ucb, is inserted by xdm, and the rest by /etc/profile*—which carefully adds its stuff towards the end of $PATH to not override previous directories.

As a result, /usr/bin programs have precedence over /usr/local/bin ones.

Is this a bug?

Offline

#2 2019-09-20 07:45:44

seth
Member
Registered: 2012-09-03
Posts: 51,046

Re: xdm's default PATH masks /usr/local/bin

This would happen because xdm sets a PATH and the way /etc/profile acts, it'll not add duplicates and append stuff.
If you run "PATH= /usr/bin/bash -l" you should get a proper PATH again.

"man xdm" reveals that this can be impacted by "DisplayManager.DISPLAY.userPath" (also see systemPath) in the resource - you could file a bug to xdm-archlinux to clear the path.

Offline

#3 2019-09-20 14:41:27

cadilhac
Member
Registered: 2012-04-27
Posts: 19

Re: xdm's default PATH masks /usr/local/bin

Thanks seth!

Now, whose fault is it, really?  XDM, xdm-archlinux, or filesystem (that owns /etc/profile)?  I'd gladly report a bug, but not sure for which package. 

Surely, even if you don't install xdm-archlinux (which is supposed to be a cosmetic package), you can expect the default install of xdm to not screw up PATH in that way, so I'd be inclined to think that /etc/profile ought to be changed. 

In the meantime, my .xsession now starts by sanitizing $PATH and putting /usr/bin and /bin at the end.  Thoughts?

Last edited by cadilhac (2019-09-20 16:45:40)

Offline

#4 2019-09-20 15:00:22

seth
Member
Registered: 2012-09-03
Posts: 51,046

Re: xdm's default PATH masks /usr/local/bin

Now, who's fault is it, really?

The answer to that question is always "yours" :-P

The behaviors of xdm and /etc/profile are both (unaware of each other) reasonable enough, but they collide.
The interface is archlinux, but as you pointed out, rather the xorg-xdm package (since the other one is just to prove that xdm does not *have* to be ugly)
Changing /etc/profile would have far more widespread consequnces and it doesn't know that the environment is "pre-polluted", notably it cannot determine whether the "pollution" is intentional or actual pollution.

Offline

#5 2019-09-20 16:50:27

cadilhac
Member
Registered: 2012-04-27
Posts: 19

Re: xdm's default PATH masks /usr/local/bin

Fair point, one taken.  However, I'm not "just" installing xdm, I'm installing the archlinux-packaged version of it, so I should reasonably expect that the glue is there to make them work in symbiosis.  My hunch is that xorg-xdm should be packaged in such a way that the default userPath/systemPath is unpolluted.  If you agree, I can go ahead a fill a bug report to xorg-xdm (and potentially xdm-archlinux, depending on how the default is implemented).

Offline

#6 2019-09-20 20:19:18

seth
Member
Registered: 2012-09-03
Posts: 51,046

Re: xdm's default PATH masks /usr/local/bin

Though you don't need my agreement at all, that's pretty much the position I tried to convey in post #4, yes.

I'd say that a solution in xorg-xdm would be preferable, defining DEF_SYSTEM_PATH resp. rather DEF_USER_PATH (which would be your case and systemPath might be required depending on how the xdm setup scripts are executed) for the compiler should do.

Offline

#7 2019-09-20 20:37:16

cadilhac
Member
Registered: 2012-04-27
Posts: 19

Re: xdm's default PATH masks /usr/local/bin

Ahah, well, I'd rather follow the advice of someone with experience.  Alright, all set: https://bugs.archlinux.org/task/63867

Thanks!

Offline

Board footer

Powered by FluxBB