svn commit: samba r9037 - in branches/SAMBA_4_0/source: libnet torture/libnet

mimir at samba.org mimir at samba.org
Thu Aug 4 02:51:27 GMT 2005


Author: mimir
Date: 2005-08-04 02:51:26 +0000 (Thu, 04 Aug 2005)
New Revision: 9037

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

Log:
New fields in usermod function - allow_password_change and
force_password_change datetime.


rafal


Modified:
   branches/SAMBA_4_0/source/libnet/composite.h
   branches/SAMBA_4_0/source/libnet/userman.c
   branches/SAMBA_4_0/source/torture/libnet/userman.c


Changeset:
Modified: branches/SAMBA_4_0/source/libnet/composite.h
===================================================================
--- branches/SAMBA_4_0/source/libnet/composite.h	2005-08-04 02:43:11 UTC (rev 9036)
+++ branches/SAMBA_4_0/source/libnet/composite.h	2005-08-04 02:51:26 UTC (rev 9037)
@@ -67,6 +67,7 @@
 #define USERMOD_FIELD_PROFILE_PATH    ( 0x00000200 )
 #define USERMOD_FIELD_ACCT_EXPIRY     ( 0x00004000 )
 #define USERMOD_FIELD_ALLOW_PASS_CHG  ( 0x00008000 )
+#define USERMOD_FIELD_FORCE_PASS_CHG  ( 0x00010000 )
 #define USERMOD_FIELD_ACCT_FLAGS      ( 0x00100000 )
 
 struct libnet_rpc_usermod {
@@ -85,6 +86,7 @@
 			const char *profile_path;
 			struct timeval *acct_expiry;
 			struct timeval *allow_password_change;
+			struct timeval *force_password_change;
 		} change;
 	} in;
 };

Modified: branches/SAMBA_4_0/source/libnet/userman.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/userman.c	2005-08-04 02:43:11 UTC (rev 9036)
+++ branches/SAMBA_4_0/source/libnet/userman.c	2005-08-04 02:51:26 UTC (rev 9037)
@@ -546,8 +546,21 @@
 
 			} else {
 				s->stage = USERMOD_QUERY;
+				return s->change.fields;
 			}
 
+		} else if (s->change.fields & USERMOD_FIELD_FORCE_PASS_CHG) {
+			*level = 3;
+
+			if (s->stage == USERMOD_QUERY) {
+				i->info3.force_password_change = timeval_to_nttime(s->change.force_password_change);
+				s->change.fields ^= USERMOD_FIELD_FORCE_PASS_CHG;
+
+			} else {
+				s->stage = USERMOD_QUERY;
+				return s->change.fields;
+			}
+
 		} else if (s->change.fields & USERMOD_FIELD_LOGON_SCRIPT) {
 			*level = 11;
 			i->info11.logon_script.string = s->change.logon_script;

Modified: branches/SAMBA_4_0/source/torture/libnet/userman.c
===================================================================
--- branches/SAMBA_4_0/source/torture/libnet/userman.c	2005-08-04 02:43:11 UTC (rev 9036)
+++ branches/SAMBA_4_0/source/torture/libnet/userman.c	2005-08-04 02:51:26 UTC (rev 9037)
@@ -418,15 +418,19 @@
 	int i;
 
 	struct timeval expiry = { 12345, 67890 };
+	struct timeval allow  = { 67890, 12345 };
+	struct timeval force  = { 33333, 55444 };
 
 	struct usermod_change changes[] = {
-		{ USERMOD_FIELD_ACCOUNT_NAME, "changed", NULL, NULL, NULL, NULL, NULL, NULL, NULL },
-		{ USERMOD_FIELD_FULL_NAME,    NULL, "Testing full account name", NULL, NULL, NULL, NULL, NULL, NULL },
-		{ USERMOD_FIELD_DESCRIPTION,  NULL, NULL, "Description of tested account", NULL, NULL, NULL, NULL, NULL },
-		{ USERMOD_FIELD_COMMENT,      NULL, NULL, NULL, "Comment for the tested account", NULL, NULL, NULL, NULL },
-		{ USERMOD_FIELD_LOGON_SCRIPT, NULL, NULL, NULL, NULL, "test_logon.cmd", NULL, NULL, NULL },
-		{ USERMOD_FIELD_PROFILE_PATH, NULL, NULL, NULL, NULL, NULL, "\\\\TESTSRV\\profiles\\test", NULL, NULL },
-		{ USERMOD_FIELD_ACCT_EXPIRY,  NULL, NULL, NULL, NULL, NULL, NULL, &expiry, NULL }
+		{ USERMOD_FIELD_ACCOUNT_NAME,   "changed", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
+		{ USERMOD_FIELD_FULL_NAME,      NULL, "Testing full account name", NULL, NULL, NULL, NULL, NULL, NULL, NULL },
+		{ USERMOD_FIELD_DESCRIPTION,    NULL, NULL, "Description of tested account", NULL, NULL, NULL, NULL, NULL, NULL },
+		{ USERMOD_FIELD_COMMENT,        NULL, NULL, NULL, "Comment for the tested account", NULL, NULL, NULL, NULL, NULL },
+		{ USERMOD_FIELD_LOGON_SCRIPT,   NULL, NULL, NULL, NULL, "test_logon.cmd", NULL, NULL, NULL, NULL },
+		{ USERMOD_FIELD_PROFILE_PATH,   NULL, NULL, NULL, NULL, NULL, "\\\\TESTSRV\\profiles\\test", NULL, NULL, NULL },
+		{ USERMOD_FIELD_ACCT_EXPIRY,    NULL, NULL, NULL, NULL, NULL, NULL, &expiry, NULL, NULL },
+		{ USERMOD_FIELD_ALLOW_PASS_CHG, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &allow, NULL },
+		{ USERMOD_FIELD_FORCE_PASS_CHG, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &force }
 	};
 	
 	mem_ctx = talloc_init("test_userdel");



More information about the samba-cvs mailing list