From 5dd94460996568706dbbf9819e58ece4b0b82686 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 22 Mar 2006 22:27:06 +0000 Subject: r14665: More testing in RPC-SAMR. It looks like we will probably need another ldb module to handle which flags can be set under what circumstances. Andrew Bartlett (This used to be commit 1d1ff501f2d2b952a4dd80c374c857be0456173c) --- source4/torture/rpc/samr.c | 61 +++++++++++++++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 20 deletions(-) (limited to 'source4/torture') diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index cbe011eeb0..588450e30c 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -355,33 +355,55 @@ static BOOL test_SetUserInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, SAMR_FIELD_LOGON_HOURS); TEST_USERINFO_INT_EXP(16, acct_flags, 5, acct_flags, - (base_acct_flags | ACB_DISABLED | ACB_HOMDIRREQ), - (base_acct_flags | ACB_DISABLED | ACB_HOMDIRREQ | user_extra_flags), - 0); + (base_acct_flags | ACB_DISABLED | ACB_HOMDIRREQ), + (base_acct_flags | ACB_DISABLED | ACB_HOMDIRREQ | user_extra_flags), + 0); TEST_USERINFO_INT_EXP(16, acct_flags, 5, acct_flags, - (base_acct_flags | ACB_DISABLED), - (base_acct_flags | ACB_DISABLED | user_extra_flags), - 0); + (base_acct_flags | ACB_DISABLED), + (base_acct_flags | ACB_DISABLED | user_extra_flags), + 0); /* Setting PWNOEXP clears the magic ACB_PW_EXPIRED flag */ TEST_USERINFO_INT_EXP(16, acct_flags, 5, acct_flags, - (base_acct_flags | ACB_DISABLED | ACB_PWNOEXP), - (base_acct_flags | ACB_DISABLED | ACB_PWNOEXP), - 0); + (base_acct_flags | ACB_DISABLED | ACB_PWNOEXP), + (base_acct_flags | ACB_DISABLED | ACB_PWNOEXP), + 0); TEST_USERINFO_INT_EXP(16, acct_flags, 21, acct_flags, - (base_acct_flags | ACB_DISABLED | ACB_HOMDIRREQ), - (base_acct_flags | ACB_DISABLED | ACB_HOMDIRREQ | user_extra_flags), - 0); + (base_acct_flags | ACB_DISABLED | ACB_HOMDIRREQ), + (base_acct_flags | ACB_DISABLED | ACB_HOMDIRREQ | user_extra_flags), + 0); /* The 'autolock' flag doesn't stick - check this */ TEST_USERINFO_INT_EXP(16, acct_flags, 21, acct_flags, - (base_acct_flags | ACB_DISABLED | ACB_AUTOLOCK), - (base_acct_flags | ACB_DISABLED | user_extra_flags), - 0); + (base_acct_flags | ACB_DISABLED | ACB_AUTOLOCK), + (base_acct_flags | ACB_DISABLED | user_extra_flags), + 0); + + /* The 'store plaintext' flag does stick */ + TEST_USERINFO_INT_EXP(16, acct_flags, 21, acct_flags, + (base_acct_flags | ACB_DISABLED | ACB_ENC_TXT_PWD_ALLOWED), + (base_acct_flags | ACB_DISABLED | ACB_ENC_TXT_PWD_ALLOWED | user_extra_flags), + 0); + /* The 'use DES' flag does stick */ + TEST_USERINFO_INT_EXP(16, acct_flags, 21, acct_flags, + (base_acct_flags | ACB_DISABLED | ACB_USE_DES_KEY_ONLY), + (base_acct_flags | ACB_DISABLED | ACB_USE_DES_KEY_ONLY | user_extra_flags), + 0); + /* The 'don't require kerberos pre-authentication flag does stick */ + TEST_USERINFO_INT_EXP(16, acct_flags, 21, acct_flags, + (base_acct_flags | ACB_DISABLED | ACB_DONT_REQUIRE_PREAUTH), + (base_acct_flags | ACB_DISABLED | ACB_DONT_REQUIRE_PREAUTH | user_extra_flags), + 0); + /* The 'no kerberos PAC required' flag sticks */ + TEST_USERINFO_INT_EXP(16, acct_flags, 21, acct_flags, + (base_acct_flags | ACB_DISABLED | ACB_NO_AUTH_DATA_REQD), + (base_acct_flags | ACB_DISABLED | ACB_NO_AUTH_DATA_REQD | user_extra_flags), + 0); + TEST_USERINFO_INT_EXP(21, acct_flags, 21, acct_flags, - (base_acct_flags | ACB_DISABLED), - (base_acct_flags | ACB_DISABLED | user_extra_flags), - SAMR_FIELD_ACCT_FLAGS); + (base_acct_flags | ACB_DISABLED), + (base_acct_flags | ACB_DISABLED | user_extra_flags), + SAMR_FIELD_ACCT_FLAGS); #if 0 /* these fail with win2003 - it appears you can't set the primary gid? @@ -2594,10 +2616,9 @@ static BOOL test_QueryDisplayInfo_continue(struct dcerpc_pipe *p, TALLOC_CTX *me status = dcerpc_samr_QueryDisplayInfo(p, mem_ctx, &r); if (NT_STATUS_IS_OK(status) && r.out.returned_size != 0) { if (r.out.info.info1.entries[0].idx != r.in.start_idx + 1) { - printf("failed: expected idx %d but got %d\n", + printf("expected idx %d but got %d\n", r.in.start_idx + 1, r.out.info.info1.entries[0].idx); - ret = False; break; } } -- cgit