NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: XDG_RUNTIME_DIR



On Sat, 24 Apr 2021, Steffen Nurpmeso wrote:

If you run Linux you could also use the pam_xdg module i have
written.  For example my /etc/pam.d/common-session is

 session optional pam_xdg.so notroot

 session required    pam_unix.so quiet

and the stuff is as attached.  It handles the other directories of
the standard as well.


This is, I presume, for Linux systems without systemd and pam_env.so?
Because, the vast thing that is systemd, takes care of mounting a /run
and creating user dirs. inside it; and pam_env.so can read
/etc/environment{,.d/*} and /etc/security/pam_env.conf files where you
can set these system-wide env. vars.

I haven't gone through your code in detail, but, I noticed these small
issues:

Line 40: a_RUNTIME_DIR_BASE_MODE should be mode 0700. All dirs. under
/run are set that way, I think.

Line 77: That ORing is a bit of an odd way to set that buffer size (if
that isn't a typo). Maybe comment is as such?

There should be a removal of the dirs. on the user's final session
logout, I think.

Thanks,
-RVP


Home | Main Index | Thread Index | Old Index