svn commit: samba r23643 - in branches/SAMBA_4_0/source: librpc/idl torture/rpc

jmcd at samba.org jmcd at samba.org
Thu Jun 28 18:08:05 GMT 2007


Author: jmcd
Date: 2007-06-28 18:08:04 +0000 (Thu, 28 Jun 2007)
New Revision: 23643

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23643

Log:
Fix the build farm tests.  We were incorrectly passing the
RPC-SAMBA3-GETUSERNAME tests before the previous password expiration
fixes, because if you create a user and only set the password
administratrively, the "last set time" should not get updated.  Needed
to add some more of the fields_present flags to do this.

Modified:
   branches/SAMBA_4_0/source/librpc/idl/samr.idl
   branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/samr.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/samr.idl	2007-06-28 18:05:35 UTC (rev 23642)
+++ branches/SAMBA_4_0/source/librpc/idl/samr.idl	2007-06-28 18:08:04 UTC (rev 23643)
@@ -684,23 +684,36 @@
 
 	/* this defines the bits used for fields_present in info21 */
 	typedef [bitmap32bit] bitmap {
-		SAMR_FIELD_ACCOUNT_NAME   = 0x00000001,
-		SAMR_FIELD_FULL_NAME      = 0x00000002,
-		SAMR_FIELD_PRIMARY_GID    = 0x00000008,
-		SAMR_FIELD_DESCRIPTION    = 0x00000010,
-		SAMR_FIELD_COMMENT        = 0x00000020,
-		SAMR_FIELD_HOME_DIRECTORY = 0x00000040,
-		SAMR_FIELD_HOME_DRIVE     = 0x00000080,
-		SAMR_FIELD_LOGON_SCRIPT   = 0x00000100,
-		SAMR_FIELD_PROFILE_PATH   = 0x00000200,
-		SAMR_FIELD_WORKSTATIONS   = 0x00000400,
-		SAMR_FIELD_LOGON_HOURS    = 0x00002000,
-		SAMR_FIELD_ACCT_FLAGS     = 0x00100000,
-		SAMR_FIELD_PARAMETERS     = 0x00200000,
-		SAMR_FIELD_COUNTRY_CODE   = 0x00400000,
-		SAMR_FIELD_CODE_PAGE      = 0x00800000,
-		SAMR_FIELD_PASSWORD       = 0x01000000, /* either of these */
-		SAMR_FIELD_PASSWORD2      = 0x02000000  /* two bits seems to work */
+		SAMR_FIELD_ACCOUNT_NAME     = 0x00000001,
+		SAMR_FIELD_FULL_NAME        = 0x00000002,
+		SAMR_FIELD_RID              = 0x00000004,
+		SAMR_FIELD_PRIMARY_GID      = 0x00000008,
+		SAMR_FIELD_DESCRIPTION      = 0x00000010,
+		SAMR_FIELD_COMMENT          = 0x00000020,
+		SAMR_FIELD_HOME_DIRECTORY   = 0x00000040,
+		SAMR_FIELD_HOME_DRIVE       = 0x00000080,
+		SAMR_FIELD_LOGON_SCRIPT     = 0x00000100,
+		SAMR_FIELD_PROFILE_PATH     = 0x00000200,
+		SAMR_FIELD_WORKSTATIONS     = 0x00000400,
+		SAMR_FIELD_LAST_LOGON       = 0x00000800,
+		SAMR_FIELD_LAST_LOGOFF      = 0x00001000,
+		SAMR_FIELD_LOGON_HOURS      = 0x00002000,
+		SAMR_FIELD_BAD_PWD_COUNT    = 0x00004000,
+		SAMR_FIELD_NUM_LOGONS       = 0x00008000,
+		SAMR_FIELD_ALLOW_PWD_CHANGE = 0x00010000,
+		SAMR_FIELD_FORCE_PWD_CHANGE = 0x00020000,
+		SAMR_FIELD_LAST_PWD_CHANGE  = 0x00040000,
+		SAMR_FIELD_ACCT_EXPIRY      = 0x00080000,
+		SAMR_FIELD_ACCT_FLAGS       = 0x00100000,
+		SAMR_FIELD_PARAMETERS       = 0x00200000,
+		SAMR_FIELD_COUNTRY_CODE     = 0x00400000,
+		SAMR_FIELD_CODE_PAGE        = 0x00800000,
+		SAMR_FIELD_PASSWORD         = 0x01000000, /* either of these */
+		SAMR_FIELD_PASSWORD2        = 0x02000000, /* two bits seems to work */
+		SAMR_FIELD_PRIVATE_DATA     = 0x04000000,
+		SAMR_FIELD_EXPIRED_FLAG     = 0x08000000,
+		SAMR_FIELD_SEC_DESC         = 0x10000000,
+		SAMR_FIELD_OWF_PWD          = 0x20000000
 	} samr_FieldsPresent;
 
 	typedef struct {

Modified: branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c	2007-06-28 18:05:35 UTC (rev 23642)
+++ branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c	2007-06-28 18:08:04 UTC (rev 23643)
@@ -536,24 +536,29 @@
 		union samr_UserInfo u_info;
 		DATA_BLOB session_key;
 
-		encode_pw_buffer(u_info.info24.password.data, password,
+
+		ZERO_STRUCT(u_info);
+		encode_pw_buffer(u_info.info23.password.data, password,
 				 STR_UNICODE);
-		u_info.info24.pw_len =	strlen_m(password)*2;
 
 		status = dcerpc_fetch_session_key(samr_pipe, &session_key);
 		if (!NT_STATUS_IS_OK(status)) {
 			d_printf("dcerpc_fetch_session_key failed\n");
 			goto done;
 		}
-		arcfour_crypt_blob(u_info.info24.password.data, 516,
+		arcfour_crypt_blob(u_info.info23.password.data, 516,
 				   &session_key);
+		u_info.info23.info.password_expired = 0;
+		u_info.info23.info.fields_present = SAMR_FIELD_PASSWORD | 
+						    SAMR_FIELD_PASSWORD2 |
+						    SAMR_FIELD_EXPIRED_FLAG;
 		sui2.in.user_handle = wks_handle;
 		sui2.in.info = &u_info;
-		sui2.in.level = 24;
+		sui2.in.level = 23;
 
 		status = dcerpc_samr_SetUserInfo2(samr_pipe, tmp_ctx, &sui2);
 		if (!NT_STATUS_IS_OK(status)) {
-			d_printf("samr_SetUserInfo(24) failed: %s\n",
+			d_printf("samr_SetUserInfo(23) failed: %s\n",
 				 nt_errstr(status));
 			goto done;
 		}



More information about the samba-cvs mailing list