Pam seems to be ignoring my `.pam_enviroment` file

It only contains this:


I found this out because libreoffice seemed to be no longer paying attention to that last line. I went into terminal to echo $SAL_USE_VCLPLUGIN and lo and behold it was empty. Anyone have any ideas as to what happened? I sure as heck didn’t touch pam’s settings,nor this file between the sudden theme ignorance.

Thank you, I looked through the links but didn’t find why such a nice feature was removed. Do you happen to know? What was so wrong with .pam_environment that it had to be removed?

Edit: I tried editing the .profile and .bash_profile files to include the variables and yet neither had any effect on libreoffice. The only thing that worked was entering the terminal and manually setting export SAL_USE_VCLPLUGIN="gtk3" which did not last between terminal sessions, it only worked for libreoffice while the session was still active. Is there some way I could re-enable the .pam_environment file? If I had been a new user to linux I’m pretty sure this would’ve been a deterrent for staying, I haven’t found any reason for it’s removal either so I just cannot see this as a good decision on the pam author’s part.

Edit 2: I did eventually find A reason for it to be disabled, though judging by the author’s response to the issue that was raised for that particular reason it seem that was not the reason the author had to begin with. Something about a security issue in the way the variables are read. Forgot which it was but I’ll hunt it down later. For those who don’t care about that issue until an alternative is found on this thread, you need to edit /etc/security/pam_env.conf in root mode and add user_readenv=1 to the end according to what I did find yesterday.

Edit 3: This was the security issue I found: Local DoS due to quadratic loop in pam_env.c · Issue #294 · linux-pam/linux-pam · GitHub

Edit 4: Finally found the main reason the pam author disabled the .pam_environment file: pam_env: read config from .config or XDG_CONFIG_HOME · Issue #7 · linux-pam/linux-pam · GitHub

Can’t say I disagree with the reasoning myself.

.profile was also deprecated. Use ~/.xprofile.

I’ve just tried it, logged out ‘n’ all and still nope. This is what I have in my .xprofile, .profile and .bash_profile files:

export EDITOR="/usr/bin/nano"
export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
export CMAKE_MAKE_PROGRAM="make"
export CMAKE_C_COMPILE="gcc"
export SAL_USE_VCLPLUGIN="gtk3"

For the record this is the only documentation on .xprofile I’ve found so far and it’s not really of help: xprofile - ArchWiki

Which Window/Desktop manager or environment are you using?


Your user profile says you are using Cinnamon.

Long forgotten about that, not anymore

1 Like

I would put it in .profile and then sym link it to .xprofile
like this cd $HOME; ln -s .profile .xprofile
You need a reboot for it to work,

Doesn’t change that none of them resolved the environment variable being unset for libreoffice (“official package” according to paman btw)

I have a bit of a “Groundhog Day” feeling - as if this topic has been discussed not too long ago.
look at /etc/profile.d/
You’ll find a few shell scripts there which are sourced.
One of them (two, acually) is and libreoffice-fresh.csh
with the variables you want set all commented out.

I suppose uncommenting the one you want will then have the effect you are after.

I checked by setting/uncommenting one line
and printenv showed it to be present after re-login

Tried both, tried copying that setenv command I forgot about to .profile, .xprofile and .bash_profile and still no luck

Was this in relation to my post?

~/.profile apparently doesn’t get sourced on login - I don’t know why, I did not investigate

When I
. ~/.profile

what is in it is present.

But what I suggested was setting it in /etc/profile.d/
… which does work

I’m saying I tried editing those files then the profile files after that didn’t work

what are “those files”?

The 2 libreoffice shell files you mentioned in /etc/profile.d/

Aha - editing only one is needed - depending on the default shell that your system is using.
From the suffix I deduced that xyz.csh was not the right one, because my system uses sh or bash or even zsh, but certainly not csh

I did remove the hash mark in front of one of the lines in the file.

… and after re-login, the Variable showed up in

If that does not yield the same result on your system - something is very different in yours vs my pretty much default installation. :man_shrugging:

I just tried running printenv and SAL_USE_VCLPLUGIN=gtk3 does show up in it, which means for some reason the handler for opening files that thunar passes on a double click of a file to does not honour the environment. Just booted libreoffice from the terminal too and that did honour the gtk3 thing so it must be just the handler. Any ideas of what to do about that?

No. Sorry. Unfortunately I don’t.

by re-login I mean:
log out of the graphical session - back to the login screen
and then log in again

not just the terminal session …

Thunar is a daemon process.
It needs to be terminated and restarted by ending the session and starting it again.