diff options
author | Günther Deschner <gd@samba.org> | 2008-12-06 01:33:28 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2009-01-06 16:02:11 +0100 |
commit | d2d8d7a087ecbd7da060d877714e4b671a53f5d5 (patch) | |
tree | 3aff15603492ce41f6a058d8bb0b9c7e7d15ce3a /source3/winbindd | |
parent | 52b250fe839965e1031549d3a9265115cdaef663 (diff) | |
download | samba-d2d8d7a087ecbd7da060d877714e4b671a53f5d5.tar.gz samba-d2d8d7a087ecbd7da060d877714e4b671a53f5d5.tar.bz2 samba-d2d8d7a087ecbd7da060d877714e4b671a53f5d5.zip |
s3-samr: avoid all init_samr_Domain* functions.
Guenther
Diffstat (limited to 'source3/winbindd')
-rw-r--r-- | source3/winbindd/winbindd_passdb.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/source3/winbindd/winbindd_passdb.c b/source3/winbindd/winbindd_passdb.c index 101854ae94..d754373216 100644 --- a/source3/winbindd/winbindd_passdb.c +++ b/source3/winbindd/winbindd_passdb.c @@ -324,30 +324,29 @@ static NTSTATUS password_policy(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, struct samr_DomInfo1 *policy) { - uint32 min_pass_len,pass_hist,password_properties; + struct samr_DomInfo1 *p; time_t u_expire, u_min_age; - NTTIME nt_expire, nt_min_age; uint32 account_policy_temp; - if ((policy = TALLOC_ZERO_P(mem_ctx, struct samr_DomInfo1)) == NULL) { + if ((p = TALLOC_ZERO_P(mem_ctx, struct samr_DomInfo1)) == NULL) { return NT_STATUS_NO_MEMORY; } - if (!pdb_get_account_policy(AP_MIN_PASSWORD_LEN, &account_policy_temp)) { + if (!pdb_get_account_policy(AP_MIN_PASSWORD_LEN, + (uint32_t *)&p->min_password_length)) { return NT_STATUS_ACCESS_DENIED; } - min_pass_len = account_policy_temp; - if (!pdb_get_account_policy(AP_PASSWORD_HISTORY, &account_policy_temp)) { + if (!pdb_get_account_policy(AP_PASSWORD_HISTORY, + (uint32_t *)&p->password_history_length)) { return NT_STATUS_ACCESS_DENIED; } - pass_hist = account_policy_temp; - if (!pdb_get_account_policy(AP_USER_MUST_LOGON_TO_CHG_PASS, &account_policy_temp)) { + if (!pdb_get_account_policy(AP_USER_MUST_LOGON_TO_CHG_PASS, + &p->password_properties)) { return NT_STATUS_ACCESS_DENIED; } - password_properties = account_policy_temp; - + if (!pdb_get_account_policy(AP_MAX_PASSWORD_AGE, &account_policy_temp)) { return NT_STATUS_ACCESS_DENIED; } @@ -358,15 +357,10 @@ static NTSTATUS password_policy(struct winbindd_domain *domain, } u_min_age = account_policy_temp; - unix_to_nt_time_abs(&nt_expire, u_expire); - unix_to_nt_time_abs(&nt_min_age, u_min_age); + unix_to_nt_time_abs((NTTIME *)&p->max_password_age, u_expire); + unix_to_nt_time_abs((NTTIME *)&p->min_password_age, u_min_age); - init_samr_DomInfo1(policy, - (uint16)min_pass_len, - (uint16)pass_hist, - password_properties, - nt_expire, - nt_min_age); + policy = p; return NT_STATUS_OK; } |