2
Unix SMB/CIFS implementation.
4
Copyright (C) Rafal Szczesniak <mimir@samba.org> 2005
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 3 of the License, or
9
(at your option) any later version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program. If not, see <http://www.gnu.org/licenses/>.
21
struct libnet_CreateUser {
23
const char *user_name;
24
const char *domain_name;
27
const char *error_string;
32
struct libnet_DeleteUser {
34
const char *user_name;
35
const char *domain_name;
38
const char *error_string;
43
struct libnet_ModifyUser {
45
const char *user_name;
46
const char *domain_name;
48
const char *account_name;
49
const char *full_name;
50
const char *description;
51
const char *home_directory;
52
const char *home_drive;
54
const char *logon_script;
55
const char *profile_path;
56
struct timeval *acct_expiry;
57
struct timeval *allow_password_change;
58
struct timeval *force_password_change;
59
struct timeval *last_password_change;
63
const char *error_string;
68
#define SET_FIELD_LSA_STRING(new, current, mod, field, flag) \
69
if (new.field != NULL && \
70
!strequal_m(current->field.string, new.field)) { \
72
mod->field = talloc_strdup(mem_ctx, new.field); \
73
if (mod->field == NULL) return NT_STATUS_NO_MEMORY; \
75
mod->fields |= flag; \
78
#define SET_FIELD_NTTIME(new, current, mod, field, flag) \
79
if (new.field != 0) { \
80
NTTIME newval = timeval_to_nttime(new.field); \
81
if (newval != current->field) { \
82
mod->field = talloc_memdup(mem_ctx, new.field, sizeof(*new.field)); \
83
if (mod->field == NULL) return NT_STATUS_NO_MEMORY; \
84
mod->fields |= flag; \
88
#define SET_FIELD_UINT32(new, current, mod, field, flag) \
89
if (current->field != new.field) { \
90
mod->field = new.field; \
91
mod->fields |= flag; \
94
#define SET_FIELD_ACCT_FLAGS(new, current, mod, field, flag) \
96
if (current->field != new.field) { \
97
mod->field = new.field; \
98
mod->fields |= flag; \
102
enum libnet_UserInfo_level {
107
struct libnet_UserInfo {
109
const char *domain_name;
110
enum libnet_UserInfo_level level;
112
const char *user_name;
113
const struct dom_sid *user_sid;
117
struct dom_sid *user_sid;
118
struct dom_sid *primary_group_sid;
119
const char *account_name;
120
const char *full_name;
121
const char *description;
122
const char *home_directory;
123
const char *home_drive;
125
const char *logon_script;
126
const char *profile_path;
127
struct timeval *acct_expiry;
128
struct timeval *allow_password_change;
129
struct timeval *force_password_change;
130
struct timeval *last_logon;
131
struct timeval *last_logoff;
132
struct timeval *last_password_change;
134
const char *error_string;
139
struct libnet_UserList {
141
const char *domain_name;
151
const char *username;
154
const char *error_string;