Hi, I'm not sure to understand what you want to achieve exactly, but aren't you supposed to use pam_env for setting/unsetting your environment variables? Best regards, l0f4r0