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_w(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; \
89 struct libnet_UserInfo {
91 const char *user_name;
92 const char *domain_name;
95 struct dom_sid *user_sid;
96 struct dom_sid *primary_group_sid;
97 const char *account_name;
98 const char *full_name;
99 const char *description;
100 const char *home_directory;
101 const char *home_drive;
103 const char *logon_script;
104 const char *profile_path;
105 struct timeval *acct_expiry;
106 struct timeval *allow_password_change;
107 struct timeval *force_password_change;
108 struct timeval *last_logon;
109 struct timeval *last_logoff;
110 struct timeval *last_password_change;
113 const char *error_string;
118 struct libnet_UserList {
120 const char *domain_name;
130 const char *username;
133 const char *error_string;