-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PAM_USER enviroment variable is not set when using pam_exec module #1882
Comments
Hi @gdemoya Thanks for raising this. I've had a look at the code, and the way it seems to be working at present is that existing pam routines are calling pam_get_user(3) to find the username. Since I can't see any reason for this - there's nothing in the repo history to suggest why it should be necessary, as the username is known when As regards the other two:-
What's your actual requirement at this point? is getting |
Hi @matt335672 Thank you for your response. I agree that there doesn't seem to be any reason why the user is not being sent to the Regarding your question, yes, I only need the |
Description
Trying to integrate xrdp with a custom auth method using a script launched by the
pam_exec.so
module, I've found thatPAM_USER
enviroment variable is not set when launching a executable withpam_exec
.PAM_RHOST
andPAM_RUSER
enviroment variables ofpam_exec.so
module are not set neither.The variables set in the script enviroment are:
Solution for PAM_USER env var
Digging a bit in the source code, I've found that the user is not being sent to the pam_start function as the documentation of pam define, a '0' is sent instead.
You can fix this issue changing the line 129 of
sesman/verify_user_pam.c
file:Replicate error
1. Install any version of xrdp in any OS
2. Configure PAM
2.1 Add the following line into the file
/etc/pam.d/common-auth
2.2 Create script
/usr/local/bin/print-env.sh
with the following content:2.3 Give executable permissions to the script
3. Login with any user with xrdp (can fail)
4. Check the enviroment variables that have been set
Resources
The text was updated successfully, but these errors were encountered: