.\"@ pam_xdg - manage XDG Base Directories (runtime dir life time, environ). .\" .\" Copyright (c) 2021 Steffen Nurpmeso . .\" SPDX-License-Identifier: ISC .\" .\" Permission to use, copy, modify, and/or distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. . .Dd January 31, 2021 .Dt PAM_XDG 8 .Os . . .Sh NAME .Nm pam_xdg.so .Nd PAM module that manages XDG Base Directories . . .Sh SYNOPSIS . .Nm .Op Ar rundir .Op Ar notroot . . .Sh DESCRIPTION . .Nm is a PAM module that manages creation of the .Ev XDG_RUNTIME_DIR directory, as well as injection of environment variables denoting all directories specified by the .Lk https://specifications.\:freedesktop.\:org/basedir-\:\ spec/\:basedir-\:spec-\:latest.html "XDG Base Directory Specification" into user sessions. . .Pp When linked into the PAM session system the runtime directory will be created once a user creates his or her first login session. Unless .Ar rundir was given all XDG related environment variables will be created in all user sessions with their default or computed values, otherwise only .Ev XDG_RUNTIME_DIR . If .Ar notroot was given the module will bypass itself for root account logins and perform no actions for root. . .Pp In order to make use of this script, place the following in the control file of desire under .Pa /etc/pam.d , best maybe .Pa /etc/pam.d/common-session if that exists (possibly adjusting paths): . .Bd -literal -offset indent session optional pam_xdg.so notroot .Ed . . .Sh "SEE ALSO" . .Xr pam.conf 5 , .Xr pam.d 8 , .Xr pam 8 . . .Sh AUTHORS . .An "Steffen Nurpmeso" Aq steffen@sdaoden.eu . . .\" s-ts-mode