Ńň Ă#xPc @sŕddklZlZlZddklZddklZlZddklZddklZddk l Z l Z l Z ddk lZddklZed ƒZd Zd „Zd efd „ƒYZeieƒdS(i˙˙˙˙(tapiterrorstutil(tCommand(tStrtPassword(t_(toutput(tsplit_principaltvalidate_principaltnormalize_principal(tcontext(tDNsô Set a user's password If someone other than a user changes that user's password (e.g., Helpdesk resets it) then the password will need to be changed the first time it is used. This is so the end-user is the only one who knows the password. The IPA password policy controls how often a password may be changed, what strength requirements exist, and the length of the password history. EXAMPLES: To reset your own password: ipa passwd To change another user's password: ipa passwd tuser1 u"CHANGING_PASSWORD_FOR_ANOTHER_USERcCs,tiƒ}|t|ƒjodStSdS(sŞ If the user is changing their own password then return None so the current password is prompted for, otherwise return a fixed value to be ignored later. N(Rtget_current_principalR tNonet MAGIC_VALUE(t principaltcurrent_principal((s9/usr/lib/python2.6/site-packages/ipalib/plugins/passwd.pytget_current_password4s tpasswdcBsšeZedƒZededddedƒdededd „d d „ƒed ded ƒƒeddedƒdedd„deddƒfZ e i Z edƒZ d„ZRS(sSet a user's password.Rtcli_nametusertlabels User namet primary_keytautofillt default_fromcCs tiƒS((RR (((s9/usr/lib/python2.6/site-packages/ipalib/plugins/passwd.pytIst normalizercCs t|ƒS((R (tvalue((s9/usr/lib/python2.6/site-packages/ipalib/plugins/passwd.pyRJstpasswords New Passwordtcurrent_passwordsCurrent PasswordtconfirmcCs t|ƒS((R(R((s9/usr/lib/python2.6/site-packages/ipalib/plugins/passwd.pyRRst sortorderi˙˙˙˙s Changed password for "%(value)s"cCsŢ|iii}|id|ddgttiitiiƒƒ\}}|tt dƒjo9|t jo,|i i dƒt idtdƒƒ‚n|t jo|i||ƒn|i|||ƒtdtd |ƒS( se Execute the passwd operation. The dn should not be passed as a keyword argument as it is constructed by this method. Returns the entry :param principal: The login name or principal of the user :param password: the new password :param current_password: the existing password, if applicable tkrbprincipalnamet posixaccounttRs3User attempted to change password using magic valuetinfosInvalid credentialstresultR(RtBackendtldap2tfind_entry_by_attrR tenvtcontainer_usertbasedntgetattrR RtlogtwarnRtACIErrorRtmodify_passwordtdicttTrue(tselfRRRtldaptdnt entry_attrs((s9/usr/lib/python2.6/site-packages/ipalib/plugins/passwd.pytexecute[s $  (t__name__t __module__Rt__doc__RR R2RtFalset takes_argsRtstandard_valuet has_outputt msg_summaryR7(((s9/usr/lib/python2.6/site-packages/ipalib/plugins/passwd.pyR@s&             N(tipalibRRRRRRRRtipalib.plugins.userRR R tipalib.requestR t ipapython.dnR R:RRRtregister(((s9/usr/lib/python2.6/site-packages/ipalib/plugins/passwd.pyts  ?