From f0d51b78c040937bd27857c063fae215a3f0f465 Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Fri, 5 Aug 2005 01:23:06 +0000 Subject: [PATCH] r9090: Another field in usermod function - account flags. rafal --- source/libnet/composite.h | 1 + source/libnet/userman.c | 6 ++++++ source/torture/libnet/userman.c | 18 +++++++++--------- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/source/libnet/composite.h b/source/libnet/composite.h index 85aa1c08e10..6d805812c00 100644 --- a/source/libnet/composite.h +++ b/source/libnet/composite.h @@ -87,6 +87,7 @@ struct libnet_rpc_usermod { struct timeval *acct_expiry; struct timeval *allow_password_change; struct timeval *force_password_change; + uint32_t acct_flags; } change; } in; }; diff --git a/source/libnet/userman.c b/source/libnet/userman.c index 3482bba18e0..13d9b1330b6 100644 --- a/source/libnet/userman.c +++ b/source/libnet/userman.c @@ -578,6 +578,12 @@ static uint32_t usermod_setfields(struct usermod_state *s, uint16_t *level, i->info17.acct_expiry = timeval_to_nttime(s->change.acct_expiry); s->change.fields ^= USERMOD_FIELD_ACCT_EXPIRY; + + } else if (s->change.fields & USERMOD_FIELD_ACCT_FLAGS) { + *level = 16; + i->info16.acct_flags = s->change.acct_flags; + + s->change.fields ^= USERMOD_FIELD_ACCT_FLAGS; } } diff --git a/source/torture/libnet/userman.c b/source/torture/libnet/userman.c index 169e7fa4a67..8ddd9566084 100644 --- a/source/torture/libnet/userman.c +++ b/source/torture/libnet/userman.c @@ -422,15 +422,15 @@ BOOL torture_usermod(void) struct timeval force = { 33333, 55444 }; struct usermod_change changes[] = { - { 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 } + { USERMOD_FIELD_ACCOUNT_NAME, "changed", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 }, + { USERMOD_FIELD_FULL_NAME, NULL, "Testing full account name", NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 }, + { USERMOD_FIELD_DESCRIPTION, NULL, NULL, "Description of tested account", NULL, NULL, NULL, NULL, NULL, NULL, 0 }, + { USERMOD_FIELD_COMMENT, NULL, NULL, NULL, "Comment for the tested account", NULL, NULL, NULL, NULL, NULL, 0 }, + { USERMOD_FIELD_LOGON_SCRIPT, NULL, NULL, NULL, NULL, "test_logon.cmd", NULL, NULL, NULL, NULL, 0 }, + { USERMOD_FIELD_PROFILE_PATH, NULL, NULL, NULL, NULL, NULL, "\\\\TESTSRV\\profiles\\test", NULL, NULL, NULL, 0 }, + { USERMOD_FIELD_ACCT_EXPIRY, NULL, NULL, NULL, NULL, NULL, NULL, &expiry, NULL, NULL, 0 }, + { USERMOD_FIELD_ALLOW_PASS_CHG, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &allow, NULL, 0 }, + { USERMOD_FIELD_FORCE_PASS_CHG, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &force, ACB_NORMAL } }; mem_ctx = talloc_init("test_userdel");