The Samba-Bugzilla – Attachment 2744 Details for
Bug 4666
Refuse machine password change is not obeyed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to obey Refus eMachine Change Password Policy
samba3_refuse_machine_password_change.patch (text/plain), 1.26 KB, created by
Simo Sorce
on 2007-06-09 13:52:19 UTC
(
hide
)
Description:
Patch to obey Refus eMachine Change Password Policy
Filename:
MIME Type:
Creator:
Simo Sorce
Created:
2007-06-09 13:52:19 UTC
Size:
1.26 KB
patch
obsolete
>Index: smbd/chgpasswd.c >=================================================================== >--- smbd/chgpasswd.c (revision 23403) >+++ smbd/chgpasswd.c (working copy) >@@ -1019,6 +1019,7 @@ > NTSTATUS change_oem_password(struct samu *hnd, char *old_passwd, char *new_passwd, BOOL as_root, uint32 *samr_reject_reason) > { > uint32 min_len; >+ uint32 refuse; > struct passwd *pass = NULL; > const char *username = pdb_get_username(hnd); > time_t can_change_time = pdb_get_pass_can_change_time(hnd); >@@ -1036,6 +1037,21 @@ > return NT_STATUS_ACCOUNT_RESTRICTION; > } > >+ /* check to see if it is a Machine account and if the policy >+ * denies machines to change the password. * >+ * Should we deny also SRVTRUST and/or DOMSTRUST ? .SSS. */ >+ if (pdb_get_acct_ctrl(hnd) & ACB_WSTRUST) { >+ if (pdb_get_account_policy(AP_REFUSE_MACHINE_PW_CHANGE, &refuse) && refuse) { >+ DEBUG(1, ("Machine %s cannot change password now, " >+ "denied by Refuse Machine Password Change policy\n", >+ username)); >+ if (samr_reject_reason) { >+ *samr_reject_reason = REJECT_REASON_OTHER; >+ } >+ return NT_STATUS_ACCOUNT_RESTRICTION; >+ } >+ } >+ > /* removed calculation here, becuase passdb now calculates > based on policy. jmcd */ > if ((can_change_time != 0) && (time(NULL) < can_change_time)) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 4666
: 2744 |
15297