2005-02-13 03:48:21 +03:00
/*
Unix SMB / CIFS implementation .
Copyright ( C ) Rafal Szczesniak < mimir @ samba . org > 2005
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
2007-07-10 06:07:03 +04:00
the Free Software Foundation ; either version 3 of the License , or
2005-02-13 03:48:21 +03:00
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
2007-07-10 06:07:03 +04:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2005-02-13 03:48:21 +03:00
*/
2005-06-08 03:21:38 +04:00
struct libnet_CreateUser {
2005-02-13 03:48:21 +03:00
struct {
2005-06-08 03:21:38 +04:00
const char * user_name ;
const char * domain_name ;
} in ;
struct {
const char * error_string ;
} out ;
2005-02-13 03:48:21 +03:00
} ;
2006-01-13 06:39:49 +03:00
struct libnet_DeleteUser {
struct {
const char * user_name ;
const char * domain_name ;
} in ;
struct {
const char * error_string ;
} out ;
} ;
2006-05-28 14:45:22 +04:00
struct libnet_ModifyUser {
struct {
const char * user_name ;
const char * domain_name ;
2006-06-27 01:19:41 +04:00
const char * account_name ;
2006-05-28 14:45:22 +04:00
const char * full_name ;
const char * description ;
2006-08-08 00:29:18 +04:00
const char * home_directory ;
const char * home_drive ;
2006-05-28 14:45:22 +04:00
const char * comment ;
const char * logon_script ;
const char * profile_path ;
struct timeval * acct_expiry ;
struct timeval * allow_password_change ;
struct timeval * force_password_change ;
2006-08-08 00:29:18 +04:00
struct timeval * last_password_change ;
2006-05-28 14:45:22 +04:00
uint32_t acct_flags ;
} in ;
struct {
const char * error_string ;
} out ;
} ;
2006-08-08 00:29:18 +04:00
# define SET_FIELD_LSA_STRING(new, current, mod, field, flag) \
if ( new . field ! = NULL & & \
2008-10-24 04:51:03 +04:00
! strequal_m ( current - > field . string , new . field ) ) { \
2006-08-08 00:29:18 +04:00
\
mod - > field = talloc_strdup ( mem_ctx , new . field ) ; \
if ( mod - > field = = NULL ) return NT_STATUS_NO_MEMORY ; \
\
mod - > fields | = flag ; \
}
# define SET_FIELD_NTTIME(new, current, mod, field, flag) \
if ( new . field ! = 0 ) { \
NTTIME newval = timeval_to_nttime ( new . field ) ; \
if ( newval ! = current - > field ) { \
2006-08-08 00:43:06 +04:00
mod - > field = talloc_memdup ( mem_ctx , new . field , sizeof ( * new . field ) ) ; \
if ( mod - > field = = NULL ) return NT_STATUS_NO_MEMORY ; \
2006-08-08 00:29:18 +04:00
mod - > fields | = flag ; \
} \
}
2006-08-28 00:37:23 +04:00
2007-09-20 14:23:02 +04:00
# define SET_FIELD_UINT32(new, current, mod, field, flag) \
if ( current - > field ! = new . field ) { \
mod - > field = new . field ; \
mod - > fields | = flag ; \
}
2008-02-28 02:43:57 +03:00
# define SET_FIELD_ACCT_FLAGS(new, current, mod, field, flag) \
if ( new . field ) { \
if ( current - > field ! = new . field ) { \
mod - > field = new . field ; \
mod - > fields | = flag ; \
} \
}
2008-04-19 16:09:18 +04:00
enum libnet_UserInfo_level {
USER_INFO_BY_NAME = 0 ,
USER_INFO_BY_SID
} ;
2006-08-28 00:37:23 +04:00
struct libnet_UserInfo {
struct {
const char * domain_name ;
2008-04-19 16:09:18 +04:00
enum libnet_UserInfo_level level ;
union {
const char * user_name ;
const struct dom_sid * user_sid ;
} data ;
2006-08-28 00:37:23 +04:00
} in ;
struct {
2007-08-02 17:08:39 +04:00
struct dom_sid * user_sid ;
struct dom_sid * primary_group_sid ;
2006-08-28 00:37:23 +04:00
const char * account_name ;
const char * full_name ;
const char * description ;
const char * home_directory ;
const char * home_drive ;
const char * comment ;
const char * logon_script ;
const char * profile_path ;
struct timeval * acct_expiry ;
struct timeval * allow_password_change ;
struct timeval * force_password_change ;
struct timeval * last_logon ;
struct timeval * last_logoff ;
struct timeval * last_password_change ;
uint32_t acct_flags ;
const char * error_string ;
} out ;
} ;
2006-11-07 01:03:22 +03:00
struct libnet_UserList {
struct {
const char * domain_name ;
int page_size ;
2009-07-15 22:45:53 +04:00
uint32_t resume_index ;
2006-11-07 01:03:22 +03:00
} in ;
struct {
int count ;
2009-07-15 22:45:53 +04:00
uint32_t resume_index ;
2006-11-07 01:03:22 +03:00
struct userlist {
const char * sid ;
const char * username ;
} * users ;
const char * error_string ;
} out ;
} ;