"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pynslcd/pam.py" between
nss-pam-ldapd-0.9.11.tar.gz and nss-pam-ldapd-0.9.12.tar.gz

About: nss-pam-ldapd is a Name Service Switch (NSS) module and Pluggable Authentication Module (PAM) that allows your LDAP server to provide user account, group, host name, alias, netgroup, and basically any other information that you would normally get from /etc flat files or NIS. It also allows you to do authentication to an LDAP server.

pam.py  (nss-pam-ldapd-0.9.11):pam.py  (nss-pam-ldapd-0.9.12)
skipping to change at line 43 skipping to change at line 43
import passwd import passwd
import search import search
import shadow import shadow
random = random.SystemRandom() random = random.SystemRandom()
def authenticate(binddn, password): def authenticate(binddn, password):
# open a new connection # open a new connection
conn = search.Connection() conn = search.Connection()
# bind using the specified credentials # bind using the specified credentials
pwctrl = PasswordPolicyControl() serverctrls = []
res, data, msgid, ctrls = conn.simple_bind_s(binddn, password, serverctrls=[ if cfg.pam_authc_ppolicy:
pwctrl]) serverctrls.append(PasswordPolicyControl())
res, data, msgid, ctrls = conn.simple_bind_s(binddn, password, serverctrls=s
erverctrls)
# go over bind result server controls # go over bind result server controls
for ctrl in ctrls: for ctrl in ctrls:
if ctrl.controlType == PasswordPolicyControl.controlType: if ctrl.controlType == PasswordPolicyControl.controlType:
# found a password policy control # found a password policy control
logging.debug( logging.debug(
'PasswordPolicyControl found: error=%s (%s), ' 'PasswordPolicyControl found: error=%s (%s), '
'timeBeforeExpiration=%s, graceAuthNsRemaining=%s', 'timeBeforeExpiration=%s, graceAuthNsRemaining=%s',
'None' if ctrl.error is None else PasswordPolicyError(ctrl.error ).prettyPrint(), 'None' if ctrl.error is None else PasswordPolicyError(ctrl.error ).prettyPrint(),
ctrl.error, ctrl.timeBeforeExpiration, ctrl.graceAuthNsRemaining ) ctrl.error, ctrl.timeBeforeExpiration, ctrl.graceAuthNsRemaining )
if ctrl.error == 0: # passwordExpired if ctrl.error == 0: # passwordExpired
 End of changes. 1 change blocks. 
3 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)