+
    4Ssi9                         ^ RI t ^ RIHt ^ RIHt ^ RIHtHt ^ RI	H
t
HtHtHt ^ RIHtHtHt ^ RIHt ^ RIHt  ! R R	]
4      t ! R
 R]
4      t ! R R]4      tR# )    N)system_session)DOMAIN_PASSWORD_COMPLEXDOMAIN_PASSWORD_STORE_CLEARTEXT)CommandCommandErrorOptionSuperCommand)NEVER_TIMESTAMPtimestamp_to_daystimestamp_to_mins)cmd_domain_passwordsettings_pso)SamDBc            	          a  ] tR t^%t o RtRtR]P                  R]P                  R]P                  /t
]! RRR]R	R
R7      .tRR ltRtV tR# ) cmd_domain_passwordsettings_showz1Display current password settings for the domain.z%prog [options]	sambaoptsversionoptscredopts-H--URL%LDB URL for database or target serverURLHhelptypemetavardestNc                   VP                  4       pVP                  V4      p\        V\        4       WeR 7      pVP	                  4       pVP                  V\        P                  . ROR	7      p	\        V	4      ^8X  g   Q h \        V	^ ,          R,          ^ ,          4      p
\        V	^ ,          R,          ^ ,          4      p\        V	^ ,          R,          ^ ,          4      p\        V	^ ,          R,          ^ ,          4      p\        V	^ ,          R,          ^ ,          4      p\        V	^ ,          R,          ^ ,          4      p\        V	^ ,          R,          ^ ,          4      p\        V	^ ,          R,          ^ ,          4      pT P                  RT,          4       T P                  R4       T
\        ,          ^ 8w  d   T P                  R4       MT P                  R4       T
\         ,          ^ 8w  d   T P                  R4       MT P                  R4       T P                  RT,          4       T P                  RT,          4       T P                  RT,          4       T P                  RT,          4       T P                  RT,          4       T P                  RT,          4       T P                  RT,          4       R#   \         d   p\        R
T4      hRp?ii ; i)urlsession_infocredentialslppwdPropertiespwdHistoryLengthminPwdLength	minPwdAge	maxPwdAgelockoutDurationlockoutThresholdlockOutObservationWindow)scopeattrsz'Could not retrieve password properties!Nz$Password information for domain '%s' zPassword complexity: onzPassword complexity: offzStore plaintext passwords: onzStore plaintext passwords: offzPassword history length: %dzMinimum password length: %dzMinimum password age (days): %dzMaximum password age (days): %dz#Account lockout duration (mins): %dz(Account lockout threshold (attempts): %dz&Reset account lockout after (mins): %d)r$   r%   r&   r'   r(   r)   r*   r+   )get_loadparmget_credentialsr   r   	domain_dnsearchldb
SCOPE_BASElenintr   r   	Exceptionr   messager   r   )selfr   r   r   r   r#   credssamdbr1   res	pwd_propspwd_hist_lencur_min_pwd_lencur_min_pwd_agecur_max_pwd_agecur_account_lockout_thresholdcur_account_lockout_durationcur_reset_account_lockout_afteres   &&&&&              F/usr/lib/python3/dist-packages/samba/netcmd/domain/passwordsettings.pyrun$cmd_domain_passwordsettings_show.run5   sX   ##%((,!.*:"'0 OO%	ll9CNN">  ? 3x1}}	MCF?3A67Is1v&89!<=L!#a&"8";<O/A{0CA0FGO/A{0CA0FGO,/A7I0J10M,N) ,=SVDU=VWX=Y+Z(.?AGa@bcd@e.f+ 	;iGHR..!3LL23LL3466!;LL89LL9:2\AB2_DE6HI6HI:=YYZ?B__`=@__`'  	MH!LL	Ms   ?D J< <KKK )NNNN__name__
__module____qualname____firstlineno____doc__synopsisoptionsSambaOptionsVersionOptionsCredentialsOptionstakes_optiongroupsr   strtakes_optionsrG   __static_attributes____classdictcell____classdict__s   @rF   r   r   %   sd     ; H 	W))w--G.. 	tW#JQT3	(M
-a -a    r   c                   r  a  ] tR t^et o RtRtR]P                  R]P                  R]P                  /t
]! RRR]R	R
R7      ]! RRRRR7      ]! RR. R)ORR7      ]! RR. R)ORR7      ]! RR]R7      ]! RR]R7      ]! RR]R7      ]! RR]R7      ]! R R!]R7      ]! R"R#]R7      ]! R$R%]R7      .tR*R' ltR(tV tR&# )+cmd_domain_passwordsettings_setzSet password settings.

Password complexity, password lockout policy, history length,
minimum password length, the minimum and maximum password age) on
a Samba AD DC server.

Use against a Windows DC is possible, but group policy will override it.
z%prog <options> [options]r   r   r   r   r   r   r   r   r   z-qz--quietzBe quiet
store_true)r   actionz--complexitychoicez=The password complexity (on | off | default). Default is 'on')r   choicesr   z--store-plaintextzStore plaintext passwords where account have 'store passwords with reversible encryption' set (on | off | default). Default is 'off'z--history-lengthzBThe password history length (<integer> | default).  Default is 24.)r   r   z--min-pwd-lengthzAThe minimum password length (<integer> | default).  Default is 7.z--min-pwd-agezFThe minimum password age (<integer in days> | default).  Default is 1.z--max-pwd-agezGThe maximum password age (<integer in days> | default).  Default is 43.z--account-lockout-durationzThe length of time an account is locked out after exceeding the limit on bad password attempts (<integer in mins> | default).  Default is 30 mins.z--account-lockout-thresholdzThe number of bad password attempts allowed before locking out the account (<integer> | default).  Default is 0 (never lock out).z--reset-account-lockout-afterzuAfter this time is elapsed, the recorded number of attempts restarts from zero (<integer> | default).  Default is 30.Nc                   VP                  4       pVP                  V4      p\        V\        4       VVR 7      pVP	                  4       p. p\
        P                  ! 4       p\
        P                  ! VV4      Vn        \        VP                  4       4      pVP                  4       pVP                  4       pVeT   VR8X  g   VR8X  d    V\        ,          pVP                  R4       M&VR8X  d    V\        ( ,          pVP                  R4       VeT   VR8X  g   VR8X  d    V\        ,          pVP                  R4       M&VR8X  d    V\        ( ,          pVP                  R4       Vf   Ve3   \
        P                   ! \#        V4      \
        P$                  R	4      VR	&   Ver   VR8X  d   ^pM\        V4      pV^ 8  g   V^8  d   \'        R
4      h\
        P                   ! \#        V4      \
        P$                  R4      VR&   VP                  R4       Ver   VR8X  d   ^pM\        V4      pV^ 8  g   V^8  d   \'        R4      h\
        P                   ! \#        V4      \
        P$                  R4      VR&   VP                  R4       Ve   VR8X  d   ^pM\        V4      pV^ 8  g   VR8  d   \'        R4      h\        VR%,          4      ) p\
        P                   ! \#        V4      \
        P$                  R4      VR&   VP                  R4       Ve   VR8X  d   ^+pM\        V4      pV^ 8  g   VR8  d   \'        R4      hV^ 8X  d   \(        pM\        VR%,          4      ) p\
        P                   ! \#        V4      \
        P$                  R4      VR&   VP                  R4       V	e   V	R8X  d   ^p	M\        V	4      p	V	^ 8  g   V	R8  d   \'        R4      hV	^ 8X  d   \(        pM\        V	R&,          4      ) p\
        P                   ! \#        V4      \
        P$                  R4      VR&   VP                  R4       V
eY   V
R8X  d   ^ p
M\        V
4      p
\
        P                   ! \#        V
4      \
        P$                  R4      VR&   VP                  R4       Ve   VR8X  d   ^pM\        V4      pV^ 8  g   VR8  d   \'        R4      hV^ 8X  d   \(        pM\        VR&,          4      ) p\
        P                   ! \#        V4      \
        P$                  R4      VR&   VP                  R 4       V'       g	   V'       d7   \+        V4      p\+        V4      pV^ 8w  d   W#8  d   \'        R!W23,          4      h\-        V4      ^ 8X  d   \'        R"4      hVP/                  V4       VP                  R#4       V P1                  R$P3                  V4      4       R# )'r   NondefaultzPassword complexity activated!offz Password complexity deactivated!z;Plaintext password storage for changed passwords activated!z=Plaintext password storage for changed passwords deactivated!r$   z8Password history length must be in the range of 0 to 24!r%   z Password history length changed!z8Minimum password length must be in the range of 0 to 14!r&   z Minimum password length changed!i  z6Minimum password age must be in the range of 0 to 998!r'   zMinimum password age changed!i  z6Maximum password age must be in the range of 0 to 999!r(   zMaximum password age changed!i z<Account lockout duration must be in the range of 0 to 99999!r)   z!Account lockout duration changed!r*   z"Account lockout threshold changed!z8Maximum password age must be in the range of 0 to 99999!r+   z0Duration to reset account lockout after changed!zIMaximum password age (%d) must be greater than minimum password age (%d)!z7You must specify at least one option to set. Try --helpz!All changes applied successfully!
g   8M%iBg    A)r/   r0   r   r   r1   r3   MessageDndnr6   get_pwdPropertiesget_maxPwdAgeget_minPwdAger   appendr   MessageElementrV   FLAG_MOD_REPLACEr   r
   r   r5   modifyr8   join)r9   r   min_pwd_agemax_pwd_agequiet
complexitystore_plaintexthistory_lengthmin_pwd_lengthaccount_lockout_durationaccount_lockout_thresholdreset_account_lockout_afterr   r   r   r#   r:   r;   r1   msgsmr=   max_pwd_age_ticksmin_pwd_age_ticksr>   min_pwd_lenaccount_lockout_duration_ticks!reset_account_lockout_after_tickss   &&&&&&&&&&&&&&&             rF   rG   #cmd_domain_passwordsettings_set.run   s   
 ##%((,!.*:"'B0 OO%	KKMvveY'//12	 "//1!//1!T!Z9%<%(??	<=u$%*A)AB	>?&$&/Y*F%(GG	YZ E)%*I)IJ	[\!_%@!$!3!3C	N474H4H/"[Ao %*!">2a<"#4"#]^^$'$6$6s<7H7:7K7KM_%aA !KK:;%*!.1Q+"2"#]^^ # 2 23{3C363G3G!YAnKK:;"i'!+.Q+"3"#[\\ "%[4F%G!H H //4E0F030D0DkSAkNKK78"i' !+.Q+"3"#[\\ a$3!%(8J)K%L$L! //4E0F030D0DkSAkNKK78#/'94+-(+./G+H('!+/G%/O" $I J J (1,1@.256NRZ6[2\1\.#&#5#5c:X6Y696J6JL]$_A KK;<$0(I5,-),/0I,J)$'$6$6s;T7U7:7K7KM_%aA !KK<=&2*i7.0+.12M.N+*Q.2MPU2U"#]^^ +a/4C1589TX`9a5b4b1,/,>,>sCd?e?B?S?SUo-qA()KKJK+ ,,=>K+,=>KaK$>"#nr}  rL  $L  M  Mq6Q;XYYQ78TYYt_%r\   rI   )rd   rf   re   )NNNFNNNNNNNNNNrJ   rZ   s   @rF   r^   r^   e   s1     +H 	W))w--G.. 	tW#JQT3	(tYZE~H6NS	U";S [	\!X_b	d!W^a	c\cf	h]dg	i+ i  ps	t, X  _b	c. L  SV	W)M0d& d&r\   r^   c                   Z    ] tR tRtRt/ t]! 4       ]R&   ]! 4       ]R&   ]! 4       ]R&   Rt	R# )cmd_domain_passwordsettingsi6  z Manage password policy settings.psoshowsetrI   N)
rK   rL   rM   rN   rO   subcommandsr   r   r^   rX   rI   r\   rF   r   r   6  s1    *K8:K:<K8:Kr\   r   )r3   samba.getoptgetoptrQ   
samba.authr   samba.dcerpc.samrr   r   samba.netcmdr   r   r   r	   samba.netcmd.commonr
   r   r   samba.netcmd.psor   samba.samdbr   r   r^   r   rI   r\   rF   <module>r      sV   2   %@ D D4 4 < =aw =a@N&g N&b;, ;r\   