Re: HOME as ~ in default PATH inherited from /etc/login.conf doesn't work for tcsh

From: Jackie <jiangjun12321_at_yahoo.com>
Date: Wed, 18 Oct 2023 11:32:13 UTC
<div dir='auto'>Ok so this is very interesting. I did two different tests.<div dir="auto"><br></div><div dir="auto">First I pkg install slim and XDM as my login managers / display managers. I did not have a ~/.xinitrc file so slim just say failed to execute login command. In XDM when I put down my username and password I just get login to a CWM session with a xterm window. I issued echo $PATH and saw ~ was expanded to HOME correctly. I stop all DMs and issued startx command from tty, CWM started with 3 xterm windows, ~ also expanded as HOME. Cool.</div><div dir="auto"><br></div><div dir="auto">I then issued xinit mate-session in tty as MATE is my default DE when using lightdm. This time in MATE session, I also get ~ as HOME in my PATH. So far so good.</div><div dir="auto"><br></div><div dir="auto">Logout, start lightdm DM and login, ~ shown as ~ in my PATH.&nbsp;</div><div dir="auto"><br></div><div dir="auto">Does this indicate there is a issue with lightDM processing environment variables? Thanks!</div></div><div class="gmail_extra"><br><div class="gmail_quote">2023年10月18日 13:28,Jackie &lt;jiangjun12321@yahoo.com&gt;写道:<br type="attribution" /><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div dir="auto"><div class="elided-text">This is odd. I tried with a VM running lastest FreeBSD RELEASE 13.2-p4, but without X environment yet. Nothing about $PATH is set in dot files either and login at tty get ~ expanded to $HOME. </div><div dir="auto" class="elided-text">I was using a desktop running the same version of FreeBSD. Although I use lightdm to login to a MATE desktop environment. Will do more tests tonight when I get home. </div><div dir="auto" class="elided-text"><blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">On Tue, Oct 17, 2023 at 09:43:03PM &#43;0800, Jackie wrote:
<br />

<br />
&gt;What shell are you using as default? Can you confirm that you didn&#39;t 
<br />
&gt;set PATH in any other dot files or in /etc files?
<br />

<br />
I use bash, and set PATH in ~/.login_conf.
<br />

<br />
However, I can&#39;t reproduce your problem.  I moved aside ~/.login_conf 
<br />
and its .db, changed my login shell to tcsh, logged out and in, and got 
<br />
the PATH from /etc/login.conf, with ~/bin expanded.  So I don&#39;t know 
<br />
what&#39;s going on.
<br />

<br />
I did this with FreeBSD 13.2 and tcsh 6.22.04, which apparently comes 
<br />
with base FreeBSD (it&#39;s in /bin).
<br />

<br />
Runnings &#34;strings&#34; on /etc/login.conf.db shows :path&#61;...~/bin:, so the 
<br />
expansion is not done when converting the text file to a database.  I 
<br />
guess it&#39;s done during login or shell startup.
<br />

<br />
I run X and log in through xdm.  Maybe logging in some other way -- 
<br />
console? -- behaves differently?
<br />

<br />
</p>
</blockquote></div><br /></div></div></blockquote></div><br></div>