Author: mimir
Date: 2005-07-27 21:46:06 +0000 (Wed, 27 Jul 2005)
New Revision: 8807

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

Log:
Modifying datetime field using struct timeval argument rather than
text-based, after recent discussion with both Andrews :)

Basic test seems to work (at least it doesn't fail now).


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-07-27 21:09:16 UTC 
(rev 8806)
+++ branches/SAMBA_4_0/source/libnet/composite.h        2005-07-27 21:46:06 UTC 
(rev 8807)
@@ -64,6 +64,7 @@
 #define USERMOD_FIELD_DESCRIPTION     ( 0x00000010 )
 #define USERMOD_FIELD_LOGON_SCRIPT    ( 0x00000100 )
 #define USERMOD_FIELD_PROFILE_PATH    ( 0x00000200 )
+#define USERMOD_FIELD_ACCT_EXPIRY     ( 0x00004000 )
 
 struct libnet_rpc_usermod {
        struct {
@@ -78,6 +79,7 @@
                        const char *description;
                        const char *logon_script;
                        const char *profile_path;
+                       struct timeval *acct_expiry;
                } change;
        } in;
 };

Modified: branches/SAMBA_4_0/source/libnet/userman.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/userman.c  2005-07-27 21:09:16 UTC (rev 
8806)
+++ branches/SAMBA_4_0/source/libnet/userman.c  2005-07-27 21:46:06 UTC (rev 
8807)
@@ -549,6 +549,12 @@
                        i->info12.profile_path.string = s->change.profile_path;
 
                        s->change.fields ^= USERMOD_FIELD_PROFILE_PATH;
+
+               } else if (s->change.fields & USERMOD_FIELD_ACCT_EXPIRY) {
+                       level = 17;
+                       i->info17.acct_expiry = 
timeval_to_nttime(s->change.acct_expiry);
+
+                       s->change.fields ^= USERMOD_FIELD_ACCT_EXPIRY;
                }
        }
 

Modified: branches/SAMBA_4_0/source/torture/libnet/userman.c
===================================================================
--- branches/SAMBA_4_0/source/torture/libnet/userman.c  2005-07-27 21:09:16 UTC 
(rev 8806)
+++ branches/SAMBA_4_0/source/torture/libnet/userman.c  2005-07-27 21:46:06 UTC 
(rev 8807)
@@ -417,12 +417,15 @@
        BOOL ret = True;
        int i;
 
+       struct timeval expiry = { 12345, 67890 };
+
        struct usermod_change changes[] = {
-               { USERMOD_FIELD_ACCOUNT_NAME, "changed", NULL, NULL, NULL, NULL 
},
-               { USERMOD_FIELD_FULL_NAME,    NULL, "Testing full account 
name", NULL, NULL, NULL },
-               { USERMOD_FIELD_DESCRIPTION,  NULL, NULL, "Description of 
tested account", NULL, NULL },
-               { USERMOD_FIELD_LOGON_SCRIPT, NULL, NULL, NULL, 
"test_logon.cmd", NULL },
-               { USERMOD_FIELD_PROFILE_PATH, NULL, NULL, NULL, NULL, 
"\\\\TESTSRV\\profiles\\test" }
+               { USERMOD_FIELD_ACCOUNT_NAME, "changed", NULL, NULL, NULL, 
NULL, NULL },
+               { USERMOD_FIELD_FULL_NAME,    NULL, "Testing full account 
name", NULL, NULL, NULL, NULL },
+               { USERMOD_FIELD_DESCRIPTION,  NULL, NULL, "Description of 
tested account", NULL, NULL, NULL },
+               { USERMOD_FIELD_LOGON_SCRIPT, NULL, NULL, NULL, 
"test_logon.cmd", NULL, NULL },
+               { USERMOD_FIELD_PROFILE_PATH, NULL, NULL, NULL, NULL, 
"\\\\TESTSRV\\profiles\\test", NULL },
+               { USERMOD_FIELD_ACCT_EXPIRY,  NULL, NULL, NULL, NULL, NULL, 
&expiry }
        };
        
        mem_ctx = talloc_init("test_userdel");

Reply via email to