diff options
author | Volker Lendecke <vl@samba.org> | 2008-03-20 21:59:46 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-03-20 23:17:44 +0100 |
commit | ce98599c14ffe9db5e86f9706fb9fa7a71c5998d (patch) | |
tree | cf31a18fe01ec83a76aa88e5ed0bc7a0790f1c4a /source4 | |
parent | 21c7afd9b0aa4c32d42b5f6acd042bf833e9e9b6 (diff) | |
download | samba-ce98599c14ffe9db5e86f9706fb9fa7a71c5998d.tar.gz samba-ce98599c14ffe9db5e86f9706fb9fa7a71c5998d.tar.bz2 samba-ce98599c14ffe9db5e86f9706fb9fa7a71c5998d.zip |
Prove that a setuserinfo level 25 does set the pwdlastset field
Very likely this is not the full story, but as it happens so often this proof
is needed to fix a direct s3 bug.
(This used to be commit 16b4a3685bf59faee22882ee14ddb95918f64e22)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/rpc/samba3rpc.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c index c5f91cf4ea..204a9f2865 100644 --- a/source4/torture/rpc/samba3rpc.c +++ b/source4/torture/rpc/samba3rpc.c @@ -683,6 +683,7 @@ static bool join3(struct smbcli_state *cli, struct dcerpc_pipe *samr_pipe; struct policy_handle *wks_handle; bool ret = false; + NTTIME last_password_change; if ((mem_ctx = talloc_init("join3")) == NULL) { d_printf("talloc_init failed\n"); @@ -702,6 +703,22 @@ static bool join3(struct smbcli_state *cli, goto done; } + { + struct samr_QueryUserInfo q; + + q.in.user_handle = wks_handle; + q.in.level = 21; + + status = dcerpc_samr_QueryUserInfo(samr_pipe, mem_ctx, &q); + if (!NT_STATUS_IS_OK(status)) { + d_printf("(%s) QueryUserInfo failed: %s\n", + __location__, nt_errstr(status)); + goto done; + } + + last_password_change = q.out.info->info21.last_password_change; + } + cli_credentials_set_domain(wks_creds, dom_name, CRED_SPECIFIED); if (use_level25) { @@ -795,6 +812,39 @@ static bool join3(struct smbcli_state *cli, } } + { + struct samr_QueryUserInfo q; + + q.in.user_handle = wks_handle; + q.in.level = 21; + + status = dcerpc_samr_QueryUserInfo(samr_pipe, mem_ctx, &q); + if (!NT_STATUS_IS_OK(status)) { + d_printf("(%s) QueryUserInfo failed: %s\n", + __location__, nt_errstr(status)); + goto done; + } + + if (use_level25) { + if (last_password_change + == q.out.info->info21.last_password_change) { + d_printf("(%s) last_password_change unchanged " + "during join, level25 must change " + "it\n", __location__); + goto done; + } + } + else { + if (last_password_change + != q.out.info->info21.last_password_change) { + d_printf("(%s) last_password_change changed " + "during join, level24 doesn't " + "change it\n", __location__); + goto done; + } + } + } + ret = true; done: |