Skip to content

Instantly share code, notes, and snippets.

@athoune
Created March 4, 2016 17:01
Show Gist options
  • Save athoune/a878c4715995b1b01e15 to your computer and use it in GitHub Desktop.
Save athoune/a878c4715995b1b01e15 to your computer and use it in GitHub Desktop.
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