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 2 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, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 struct libnet_CreateUser
{
24 const char *user_name
;
25 const char *domain_name
;
28 const char *error_string
;
33 struct libnet_DeleteUser
{
35 const char *user_name
;
36 const char *domain_name
;
39 const char *error_string
;
44 struct libnet_ModifyUser
{
46 const char *user_name
;
47 const char *domain_name
;
49 const char *account_name
;
50 const char *full_name
;
51 const char *description
;
52 const char *home_directory
;
53 const char *home_drive
;
55 const char *logon_script
;
56 const char *profile_path
;
57 struct timeval
*acct_expiry
;
58 struct timeval
*allow_password_change
;
59 struct timeval
*force_password_change
;
60 struct timeval
*last_password_change
;
64 const char *error_string
;
69 #define SET_FIELD_LSA_STRING(new, current, mod, field, flag) \
70 if (new.field != NULL && \
71 !strequal_w(current->field.string, new.field)) { \
73 mod->field = talloc_strdup(mem_ctx, new.field); \
74 if (mod->field == NULL) return NT_STATUS_NO_MEMORY; \
76 mod->fields |= flag; \
79 #define SET_FIELD_NTTIME(new, current, mod, field, flag) \
80 if (new.field != 0) { \
81 NTTIME newval = timeval_to_nttime(new.field); \
82 if (newval != current->field) { \
83 mod->field = talloc_memdup(mem_ctx, new.field, sizeof(*new.field)); \
84 if (mod->field == NULL) return NT_STATUS_NO_MEMORY; \
85 mod->fields |= flag; \
90 struct libnet_UserInfo
{
92 const char *user_name
;
93 const char *domain_name
;
96 const char *account_name
;
97 const char *full_name
;
98 const char *description
;
99 const char *home_directory
;
100 const char *home_drive
;
102 const char *logon_script
;
103 const char *profile_path
;
104 struct timeval
*acct_expiry
;
105 struct timeval
*allow_password_change
;
106 struct timeval
*force_password_change
;
107 struct timeval
*last_logon
;
108 struct timeval
*last_logoff
;
109 struct timeval
*last_password_change
;
112 const char *error_string
;
117 struct libnet_UserList
{
119 const char *domain_name
;
129 const char *username
;
132 const char *error_string
;