summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafal Szczesniak <mimir@samba.org>2005-07-27 21:46:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:30:06 -0500
commit5cc8a42a058a6d8850143cae68e87f1395de99cc (patch)
tree5a52fc483286b8f94b113eda351fe52758f054c3
parent5b94a9583f5fa167729fc6e425ae748c740a1ae1 (diff)
downloadsamba-5cc8a42a058a6d8850143cae68e87f1395de99cc.tar.gz
samba-5cc8a42a058a6d8850143cae68e87f1395de99cc.tar.xz
samba-5cc8a42a058a6d8850143cae68e87f1395de99cc.zip
r8807: 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 (This used to be commit 1bc3162e9441aeae1d8c4b4f03b5b75eb848f4bf)
-rw-r--r--source4/libnet/composite.h2
-rw-r--r--source4/libnet/userman.c6
-rw-r--r--source4/torture/libnet/userman.c13
3 files changed, 16 insertions, 5 deletions
diff --git a/source4/libnet/composite.h b/source4/libnet/composite.h
index 6fc0886cb3f..256590bc5b7 100644
--- a/source4/libnet/composite.h
+++ b/source4/libnet/composite.h
@@ -64,6 +64,7 @@ struct libnet_rpc_userdel {
#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 @@ struct libnet_rpc_usermod {
const char *description;
const char *logon_script;
const char *profile_path;
+ struct timeval *acct_expiry;
} change;
} in;
};
diff --git a/source4/libnet/userman.c b/source4/libnet/userman.c
index a3c1eaf17ae..ef7f2658c46 100644
--- a/source4/libnet/userman.c
+++ b/source4/libnet/userman.c
@@ -549,6 +549,12 @@ static NTSTATUS usermod_open(struct composite_context *c,
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;
}
}
diff --git a/source4/torture/libnet/userman.c b/source4/torture/libnet/userman.c
index 0441a99a547..063587feb25 100644
--- a/source4/torture/libnet/userman.c
+++ b/source4/torture/libnet/userman.c
@@ -417,12 +417,15 @@ BOOL torture_usermod(void)
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");