summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-03-25 10:29:35 +1100
committerAndrew Bartlett <abartlet@samba.org>2008-03-25 10:29:35 +1100
commit2d08a03c50d065ed5175b37cb26b2794efde3c7b (patch)
tree5e2570cb23c1e29a1693d3ebfaafb952bee8af05
parent89870f2d9a7296b51d53934450ea5253a66145e5 (diff)
parent482f33077b965bab7f6ccb82cee03b66d70c57b7 (diff)
downloadsamba-2d08a03c50d065ed5175b37cb26b2794efde3c7b.tar.gz
samba-2d08a03c50d065ed5175b37cb26b2794efde3c7b.tar.bz2
samba-2d08a03c50d065ed5175b37cb26b2794efde3c7b.zip
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into 4-0-local
(This used to be commit 3903ef9168a18d34517c78536d34e147a9bc01cd)
-rw-r--r--source4/libcli/composite/composite.c1
-rw-r--r--source4/torture/rpc/samba3rpc.c53
2 files changed, 54 insertions, 0 deletions
diff --git a/source4/libcli/composite/composite.c b/source4/libcli/composite/composite.c
index aab7487a42..26169e7838 100644
--- a/source4/libcli/composite/composite.c
+++ b/source4/libcli/composite/composite.c
@@ -1,6 +1,7 @@
/*
Unix SMB/CIFS implementation.
+ Copyright (C) Volker Lendecke 2005
Copyright (C) Andrew Tridgell 2005
This program is free software; you can redistribute it and/or modify
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index 95252e7397..204a9f2865 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -47,6 +47,7 @@
#include "libcli/smb_composite/smb_composite.h"
#include "libcli/auth/libcli_auth.h"
#include "lib/crypto/crypto.h"
+#include "auth/ntlmssp/ntlmssp.h"
#include "libcli/security/proto.h"
#include "param/param.h"
#include "lib/registry/registry.h"
@@ -682,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");
@@ -701,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) {
@@ -794,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:
@@ -1321,6 +1372,8 @@ bool torture_samba3_sessionkey(struct torture_context *torture)
goto done;
}
+ cli_credentials_set_workstation(anon_creds, wks_name, CRED_SPECIFIED);
+
ret = true;
if (!torture_setting_bool(torture, "samba3", false)) {