Created
March 4, 2016 17:01
-
-
Save athoune/a878c4715995b1b01e15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
def pam_sm_open_session(pamh, flags, args): | |
try: | |
user = pamh.get_user(None) | |
except pamh.exception, e: | |
return e.pam_result | |
with open('/tmp/debug', 'w') as d: | |
d.write(user) | |
d.write("\n") | |
d.write(str(pamh.env.keys())) | |
d.write("\n") | |
pamh.env['BEUHA'] = 'aussi' | |
pamh.env['SESSION_PID'] = str(os.getpid()) | |
return pamh.PAM_SUCCESS | |
def pam_sm_close_session(pamh, flags, args): | |
return pamh.PAM_SUCCESS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment