diff options
76 files changed, 835 insertions, 826 deletions
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index c7e5295b00..48fdf37ca0 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -146,9 +146,9 @@ static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, int fi return vfswrap_lseek(NULL, fsp, filedes, offset, whence); } -static int skel_rename(vfs_handle_struct *handle, connection_struct *conn, const char *old, const char *new) +static int skel_rename(vfs_handle_struct *handle, connection_struct *conn, const char *oldname, const char *newname) { - return vfswrap_rename(NULL, conn, old, new); + return vfswrap_rename(NULL, conn, oldname, newname); } static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd) diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index b10161cde1..5f83dd417c 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -145,9 +145,9 @@ static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, int fi return SMB_VFS_NEXT_LSEEK(handle, fsp, filedes, offset, whence); } -static int skel_rename(vfs_handle_struct *handle, connection_struct *conn, const char *old, const char *new) +static int skel_rename(vfs_handle_struct *handle, connection_struct *conn, const char *oldname, const char *newname) { - return SMB_VFS_NEXT_RENAME(handle, conn, old, new); + return SMB_VFS_NEXT_RENAME(handle, conn, oldname, newname); } static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd) diff --git a/source3/auth/auth_winbind.c b/source3/auth/auth_winbind.c index 78235d30fc..3a81cba626 100644 --- a/source3/auth/auth_winbind.c +++ b/source3/auth/auth_winbind.c @@ -109,7 +109,7 @@ static NTSTATUS check_winbind_security(const struct auth_context *auth_context, /* we are contacting the privileged pipe */ become_root(); - result = winbindd_request(WINBINDD_PAM_AUTH_CRAP, &request, &response); + result = winbindd_request_response(WINBINDD_PAM_AUTH_CRAP, &request, &response); unbecome_root(); if ( result == NSS_STATUS_UNAVAIL ) { diff --git a/source3/include/includes.h b/source3/include/includes.h index da4c98fc72..9ff87557ff 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -25,6 +25,17 @@ #include "config.h" #endif +#ifndef __cplusplus +#define class #error DONT_USE_CPLUSPLUS_RESERVED_NAMES +#define private #error DONT_USE_CPLUSPLUS_RESERVED_NAMES +#define public #error DONT_USE_CPLUSPLUS_RESERVED_NAMES +#define template #error DONT_USE_CPLUSPLUS_RESERVED_NAMES +#define this #error DONT_USE_CPLUSPLUS_RESERVED_NAMES +#define new #error DONT_USE_CPLUSPLUS_RESERVED_NAMES +#define delete #error DONT_USE_CPLUSPLUS_RESERVED_NAMES +#define friend #error DONT_USE_CPLUSPLUS_RESERVED_NAMES +#endif + #include "local.h" #ifdef AIX @@ -55,7 +66,7 @@ #define PRINTF_ATTRIBUTE(a1, a2) #endif -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__cplusplus) /** gcc attribute used on function parameters so that it does not emit * warnings about them being unused. **/ # define UNUSED(param) param __attribute__ ((unused)) diff --git a/source3/include/nt_printing.h b/source3/include/nt_printing.h index ee29636c88..fa53e1d284 100644 --- a/source3/include/nt_printing.h +++ b/source3/include/nt_printing.h @@ -295,7 +295,7 @@ typedef struct ntdevicemode uint32 reserved2; uint32 panningwidth; uint32 panningheight; - uint8 *private; + uint8 *nt_dev_private; } NT_DEVICEMODE; typedef struct nt_printer_info_level_2 diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 9a3dd9c8d3..114585346e 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -195,7 +195,7 @@ typedef struct sam_passwd const struct pdb_methods *backend_private_methods; void *backend_private_data; void (*backend_private_data_free_fn)(void **); - } private; + } private_u; /* Lets see if the remaining code can get the hint that you are meant to use the pdb_...() functions. */ @@ -221,7 +221,7 @@ typedef struct sam_group { uint32 mem_num; /* Number of member SIDs */ DOM_SID *members; /* SID array */ - } private; + } private_g; } SAM_GROUP; @@ -253,7 +253,7 @@ struct pdb_search { uint32 num_entries; ssize_t cache_size; BOOL search_ended; - void *private; + void *private_data; BOOL (*next_entry)(struct pdb_search *search, struct samr_displayentry *entry); void (*search_end)(struct pdb_search *search); diff --git a/source3/include/rpc_reg.h b/source3/include/rpc_reg.h index c343e9c594..6ef90cd30d 100644 --- a/source3/include/rpc_reg.h +++ b/source3/include/rpc_reg.h @@ -216,7 +216,7 @@ typedef struct { typedef struct { POLICY_HND handle; UNISTR4 name; - UNISTR4 class; + UNISTR4 key_class; uint32 reserved; uint32 access; uint32 *sec_info; @@ -260,11 +260,11 @@ typedef struct { typedef struct { POLICY_HND pol; - UNISTR4 class; + UNISTR4 key_class; } REG_Q_QUERY_KEY; typedef struct { - UNISTR4 class; + UNISTR4 key_class; uint32 num_subkeys; uint32 max_subkeylen; uint32 reserved; /* 0x0000 0000 - according to MSDN (max_subkeysize?) */ diff --git a/source3/include/rpc_spoolss.h b/source3/include/rpc_spoolss.h index d0422e8d6e..3b88f76588 100755 --- a/source3/include/rpc_spoolss.h +++ b/source3/include/rpc_spoolss.h @@ -517,7 +517,7 @@ typedef struct devicemode uint32 reserved2; uint32 panningwidth; uint32 panningheight; - uint8 *private; + uint8 *dev_private; } DEVICEMODE; diff --git a/source3/include/smb.h b/source3/include/smb.h index 4bf967bf35..658b52a2ff 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -450,11 +450,10 @@ typedef struct files_struct { #include "sysquotas.h" /* used to hold an arbitrary blob of data */ -typedef struct data_blob -{ +typedef struct data_blob_ { uint8 *data; size_t length; - void (*free)(struct data_blob *data_blob); + void (*free)(struct data_blob_ *data_blob); } DATA_BLOB; /* @@ -747,7 +746,7 @@ struct parm_struct { const char *label; parm_type type; - parm_class class; + parm_class p_class; void *ptr; BOOL (*special)(int snum, const char *, char **); const struct enum_list *enum_list; @@ -1586,13 +1585,12 @@ struct nmb_name { unsigned int name_type; }; - /* A netbios node status array element. */ -struct node_status { +typedef struct node_status_ { nstring name; unsigned char type; unsigned char flags; -}; +} NODE_STATUS_STRUCT; /* The extra info from a NetBIOS node status query */ struct node_status_extra { diff --git a/source3/include/spnego.h b/source3/include/spnego.h index b6492ee3c8..8bb13bd354 100644 --- a/source3/include/spnego.h +++ b/source3/include/spnego.h @@ -43,7 +43,7 @@ typedef enum _spnego_negResult { } negResult_t; typedef struct spnego_negTokenInit { - const char **mechTypes; + char **mechTypes; int reqFlags; DATA_BLOB mechToken; DATA_BLOB mechListMIC; @@ -51,7 +51,7 @@ typedef struct spnego_negTokenInit { typedef struct spnego_negTokenTarg { uint8 negResult; - const char *supportedMech; + char *supportedMech; DATA_BLOB responseToken; DATA_BLOB mechListMIC; } negTokenTarg_t; diff --git a/source3/include/vfs.h b/source3/include/vfs.h index e8c6ff32d5..a9d82a0db1 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -231,7 +231,7 @@ struct vfs_ops { ssize_t (*pwrite)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, const void *data, size_t n, SMB_OFF_T offset); SMB_OFF_T (*lseek)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_OFF_T offset, int whence); ssize_t (*sendfile)(struct vfs_handle_struct *handle, int tofd, files_struct *fsp, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count); - int (*rename)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *old, const char *new); + int (*rename)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *oldname, const char *newname); int (*fsync)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd); int (*stat)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *fname, SMB_STRUCT_STAT *sbuf); int (*fstat)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf); diff --git a/source3/lib/data_blob.c b/source3/lib/data_blob.c index 35805f861c..161f46a941 100644 --- a/source3/lib/data_blob.c +++ b/source3/lib/data_blob.c @@ -35,6 +35,7 @@ static void free_data_blob(DATA_BLOB *d) construct a data blob, must be freed with data_blob_free() you can pass NULL for p and get a blank data blob *******************************************************************/ + DATA_BLOB data_blob(const void *p, size_t length) { DATA_BLOB ret; diff --git a/source3/lib/secace.c b/source3/lib/secace.c index c550dcce31..b2cf81d0fd 100644 --- a/source3/lib/secace.c +++ b/source3/lib/secace.c @@ -72,25 +72,25 @@ void init_sec_ace(SEC_ACE *t, const DOM_SID *sid, uint8 type, SEC_ACCESS mask, u adds new SID with its permissions to ACE list ********************************************************************/ -NTSTATUS sec_ace_add_sid(TALLOC_CTX *ctx, SEC_ACE **new, SEC_ACE *old, unsigned *num, DOM_SID *sid, uint32 mask) +NTSTATUS sec_ace_add_sid(TALLOC_CTX *ctx, SEC_ACE **pp_new, SEC_ACE *old, unsigned *num, DOM_SID *sid, uint32 mask) { unsigned int i = 0; - if (!ctx || !new || !old || !sid || !num) return NT_STATUS_INVALID_PARAMETER; + if (!ctx || !pp_new || !old || !sid || !num) return NT_STATUS_INVALID_PARAMETER; *num += 1; - if((new[0] = TALLOC_ZERO_ARRAY(ctx, SEC_ACE, *num )) == 0) + if((pp_new[0] = TALLOC_ZERO_ARRAY(ctx, SEC_ACE, *num )) == 0) return NT_STATUS_NO_MEMORY; for (i = 0; i < *num - 1; i ++) - sec_ace_copy(&(*new)[i], &old[i]); + sec_ace_copy(&(*pp_new)[i], &old[i]); - (*new)[i].type = 0; - (*new)[i].flags = 0; - (*new)[i].size = SEC_ACE_HEADER_SIZE + sid_size(sid); - (*new)[i].info.mask = mask; - sid_copy(&(*new)[i].trustee, sid); + (*pp_new)[i].type = 0; + (*pp_new)[i].flags = 0; + (*pp_new)[i].size = SEC_ACE_HEADER_SIZE + sid_size(sid); + (*pp_new)[i].info.mask = mask; + sid_copy(&(*pp_new)[i].trustee, sid); return NT_STATUS_OK; } @@ -117,19 +117,19 @@ NTSTATUS sec_ace_mod_sid(SEC_ACE *ace, size_t num, DOM_SID *sid, uint32 mask) delete SID from ACL ********************************************************************/ -NTSTATUS sec_ace_del_sid(TALLOC_CTX *ctx, SEC_ACE **new, SEC_ACE *old, uint32 *num, DOM_SID *sid) +NTSTATUS sec_ace_del_sid(TALLOC_CTX *ctx, SEC_ACE **pp_new, SEC_ACE *old, uint32 *num, DOM_SID *sid) { unsigned int i = 0; unsigned int n_del = 0; - if (!ctx || !new || !old || !sid || !num) return NT_STATUS_INVALID_PARAMETER; + if (!ctx || !pp_new || !old || !sid || !num) return NT_STATUS_INVALID_PARAMETER; - if((new[0] = TALLOC_ZERO_ARRAY(ctx, SEC_ACE, *num )) == 0) + if((pp_new[0] = TALLOC_ZERO_ARRAY(ctx, SEC_ACE, *num )) == 0) return NT_STATUS_NO_MEMORY; for (i = 0; i < *num; i ++) { if (sid_compare(&old[i].trustee, sid) != 0) - sec_ace_copy(&(*new)[i], &old[i]); + sec_ace_copy(&(*pp_new)[i], &old[i]); else n_del ++; } diff --git a/source3/lib/util.c b/source3/lib/util.c index b7651f8929..42cbc7288f 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -2217,14 +2217,14 @@ int set_maxfiles(int requested_max) Possibly replace mkstemp if it is broken. *****************************************************************/ -int smb_mkstemp(char *template) +int smb_mkstemp(char *name_template) { #if HAVE_SECURE_MKSTEMP - return mkstemp(template); + return mkstemp(name_template); #else /* have a reasonable go at emulating it. Hope that the system mktemp() isn't completly hopeless */ - char *p = mktemp(template); + char *p = mktemp(name_template); if (!p) return -1; return open(p, O_CREAT|O_EXCL|O_RDWR, 0600); diff --git a/source3/libsmb/clierror.c b/source3/libsmb/clierror.c index ec0ca53a85..a16c1f5241 100644 --- a/source3/libsmb/clierror.c +++ b/source3/libsmb/clierror.c @@ -153,9 +153,9 @@ NTSTATUS cli_nt_error(struct cli_state *cli) int flgs2 = SVAL(cli->inbuf,smb_flg2); if (!(flgs2 & FLAGS2_32_BIT_ERROR_CODES)) { - int class = CVAL(cli->inbuf,smb_rcls); + int e_class = CVAL(cli->inbuf,smb_rcls); int code = SVAL(cli->inbuf,smb_err); - return dos_to_ntstatus(class, code); + return dos_to_ntstatus(e_class, code); } return NT_STATUS(IVAL(cli->inbuf,smb_rcls)); diff --git a/source3/libsmb/libsmb_cache.c b/source3/libsmb/libsmb_cache.c index de9a1656d8..e6033faf50 100644 --- a/source3/libsmb/libsmb_cache.c +++ b/source3/libsmb/libsmb_cache.c @@ -46,7 +46,7 @@ struct smbc_server_cache { * Add a new connection to the server cache. * This function is only used if the external cache is not enabled */ -static int smbc_add_cached_server(SMBCCTX * context, SMBCSRV * new, +static int smbc_add_cached_server(SMBCCTX * context, SMBCSRV * newsrv, const char * server, const char * share, const char * workgroup, const char * username) { @@ -60,7 +60,7 @@ static int smbc_add_cached_server(SMBCCTX * context, SMBCSRV * new, ZERO_STRUCTP(srvcache); - srvcache->server = new; + srvcache->server = newsrv; srvcache->server_name = SMB_STRDUP(server); if (!srvcache->server_name) { diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c index dac30b934e..1823bb2ace 100644 --- a/source3/libsmb/libsmbclient.c +++ b/source3/libsmb/libsmbclient.c @@ -3305,7 +3305,7 @@ static BOOL parse_ace(struct cli_state *ipc_cli, /* add an ACE to a list of ACEs in a SEC_ACL */ static BOOL add_ace(SEC_ACL **the_acl, SEC_ACE *ace, TALLOC_CTX *ctx) { - SEC_ACL *new; + SEC_ACL *newacl; SEC_ACE *aces; if (! *the_acl) { (*the_acl) = make_sec_acl(ctx, 3, 1, ace); @@ -3315,9 +3315,9 @@ static BOOL add_ace(SEC_ACL **the_acl, SEC_ACE *ace, TALLOC_CTX *ctx) aces = SMB_CALLOC_ARRAY(SEC_ACE, 1+(*the_acl)->num_aces); memcpy(aces, (*the_acl)->ace, (*the_acl)->num_aces * sizeof(SEC_ACE)); memcpy(aces+(*the_acl)->num_aces, ace, sizeof(SEC_ACE)); - new = make_sec_acl(ctx,(*the_acl)->revision,1+(*the_acl)->num_aces, aces); + newacl = make_sec_acl(ctx,(*the_acl)->revision,1+(*the_acl)->num_aces, aces); SAFE_FREE(aces); - (*the_acl) = new; + (*the_acl) = newacl; return True; } diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index e6868fb373..28b89db908 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -45,9 +45,9 @@ static int generate_trn_id(void) Parse a node status response into an array of structures. ****************************************************************************/ -static struct node_status *parse_node_status(char *p, int *num_names, struct node_status_extra *extra) +static NODE_STATUS_STRUCT *parse_node_status(char *p, int *num_names, struct node_status_extra *extra) { - struct node_status *ret; + NODE_STATUS_STRUCT *ret; int i; *num_names = CVAL(p,0); @@ -55,7 +55,7 @@ static struct node_status *parse_node_status(char *p, int *num_names, struct nod if (*num_names == 0) return NULL; - ret = SMB_MALLOC_ARRAY(struct node_status,*num_names); + ret = SMB_MALLOC_ARRAY(NODE_STATUS_STRUCT,*num_names); if (!ret) return NULL; @@ -84,7 +84,7 @@ static struct node_status *parse_node_status(char *p, int *num_names, struct nod structures holding the returned names or NULL if the query failed. **************************************************************************/ -struct node_status *node_status_query(int fd,struct nmb_name *name, +NODE_STATUS_STRUCT *node_status_query(int fd,struct nmb_name *name, struct in_addr to_ip, int *num_names, struct node_status_extra *extra) { @@ -95,7 +95,7 @@ struct node_status *node_status_query(int fd,struct nmb_name *name, struct packet_struct p; struct packet_struct *p2; struct nmb_packet *nmb = &p.packet.nmb; - struct node_status *ret; + NODE_STATUS_STRUCT *ret; ZERO_STRUCT(p); @@ -173,7 +173,7 @@ struct node_status *node_status_query(int fd,struct nmb_name *name, BOOL name_status_find(const char *q_name, int q_type, int type, struct in_addr to_ip, fstring name) { - struct node_status *status = NULL; + NODE_STATUS_STRUCT *status = NULL; struct nmb_name nname; int count, i; int sock; diff --git a/source3/libsmb/smberr.c b/source3/libsmb/smberr.c index 82efbdb689..b014fb947e 100644 --- a/source3/libsmb/smberr.c +++ b/source3/libsmb/smberr.c @@ -142,7 +142,7 @@ err_code_struct hard_msgs[] = { const struct { int code; - const char *class; + const char *e_class; err_code_struct *err_msgs; } err_classes[] = { {0,"SUCCESS",NULL}, @@ -160,13 +160,13 @@ const struct /**************************************************************************** return a SMB error name from a class and code ****************************************************************************/ -const char *smb_dos_err_name(uint8 class, uint16 num) +const char *smb_dos_err_name(uint8 e_class, uint16 num) { static pstring ret; int i,j; - for (i=0;err_classes[i].class;i++) - if (err_classes[i].code == class) { + for (i=0;err_classes[i].e_class;i++) + if (err_classes[i].code == e_class) { if (err_classes[i].err_msgs) { err_code_struct *err = err_classes[i].err_msgs; for (j=0;err[j].name;j++) @@ -178,7 +178,7 @@ const char *smb_dos_err_name(uint8 class, uint16 num) return ret; } - slprintf(ret, sizeof(ret) - 1, "Error: Unknown error class (%d,%d)",class,num); + slprintf(ret, sizeof(ret) - 1, "Error: Unknown error class (%d,%d)",e_class,num); return(ret); } @@ -196,18 +196,18 @@ const char *get_dos_error_msg(WERROR result) /**************************************************************************** return a SMB error class name as a string. ****************************************************************************/ -const char *smb_dos_err_class(uint8 class) +const char *smb_dos_err_class(uint8 e_class) { static pstring ret; int i; - for (i=0;err_classes[i].class;i++) { - if (err_classes[i].code == class) { - return err_classes[i].class; + for (i=0;err_classes[i].e_class;i++) { + if (err_classes[i].code == e_class) { + return err_classes[i].e_class; } } - slprintf(ret, sizeof(ret) - 1, "Error: Unknown class (%d)",class); + slprintf(ret, sizeof(ret) - 1, "Error: Unknown class (%d)",e_class); return(ret); } @@ -217,32 +217,32 @@ return a SMB string from an SMB buffer char *smb_dos_errstr(char *inbuf) { static pstring ret; - int class = CVAL(inbuf,smb_rcls); + int e_class = CVAL(inbuf,smb_rcls); int num = SVAL(inbuf,smb_err); int i,j; - for (i=0;err_classes[i].class;i++) - if (err_classes[i].code == class) { + for (i=0;err_classes[i].e_class;i++) + if (err_classes[i].code == e_class) { if (err_classes[i].err_msgs) { err_code_struct *err = err_classes[i].err_msgs; for (j=0;err[j].name;j++) if (num == err[j].code) { if (DEBUGLEVEL > 0) slprintf(ret, sizeof(ret) - 1, "%s - %s (%s)", - err_classes[i].class, + err_classes[i].e_class, err[j].name,err[j].message); else slprintf(ret, sizeof(ret) - 1, "%s - %s", - err_classes[i].class,err[j].name); + err_classes[i].e_class,err[j].name); return ret; } } - slprintf(ret, sizeof(ret) - 1, "%s - %d",err_classes[i].class,num); + slprintf(ret, sizeof(ret) - 1, "%s - %d",err_classes[i].e_class,num); return ret; } - slprintf(ret, sizeof(ret) - 1, "Error: Unknown error (%d,%d)",class,num); + slprintf(ret, sizeof(ret) - 1, "Error: Unknown error (%d,%d)",e_class,num); return(ret); } diff --git a/source3/libsmb/spnego.c b/source3/libsmb/spnego.c index a0f5565d4f..2eaec61ed7 100644 --- a/source3/libsmb/spnego.c +++ b/source3/libsmb/spnego.c @@ -47,7 +47,7 @@ static BOOL read_negTokenInit(ASN1_DATA *asn1, negTokenInit_t *token) 0 < asn1_tag_remaining(asn1); i++) { token->mechTypes = SMB_REALLOC_ARRAY(token->mechTypes, char *, i + 2); - asn1_read_OID(asn1, token->mechTypes + i); + asn1_read_OID(asn1, &token->mechTypes[i]); } token->mechTypes[i] = NULL; diff --git a/source3/modules/vfs_audit.c b/source3/modules/vfs_audit.c index 550d918b43..a5b80190c0 100644 --- a/source3/modules/vfs_audit.c +++ b/source3/modules/vfs_audit.c @@ -36,7 +36,7 @@ static int audit_mkdir(vfs_handle_struct *handle, connection_struct *conn, const static int audit_rmdir(vfs_handle_struct *handle, connection_struct *conn, const char *path); static int audit_open(vfs_handle_struct *handle, connection_struct *conn, const char *fname, int flags, mode_t mode); static int audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd); -static int audit_rename(vfs_handle_struct *handle, connection_struct *conn, const char *old, const char *new); +static int audit_rename(vfs_handle_struct *handle, connection_struct *conn, const char *oldname, const char *newname); static int audit_unlink(vfs_handle_struct *handle, connection_struct *conn, const char *path); static int audit_chmod(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode); static int audit_chmod_acl(vfs_handle_struct *handle, connection_struct *conn, const char *name, mode_t mode); @@ -190,14 +190,14 @@ static int audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd) return result; } -static int audit_rename(vfs_handle_struct *handle, connection_struct *conn, const char *old, const char *new) +static int audit_rename(vfs_handle_struct *handle, connection_struct *conn, const char *oldname, const char *newname) { int result; - result = SMB_VFS_NEXT_RENAME(handle, conn, old, new); + result = SMB_VFS_NEXT_RENAME(handle, conn, oldname, newname); syslog(audit_syslog_priority(handle), "rename %s -> %s %s%s\n", - old, new, + oldname, newname, (result < 0) ? "failed: " : "", (result < 0) ? strerror(errno) : ""); diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c index 18fa04533f..de61f41f3c 100644 --- a/source3/modules/vfs_cap.c +++ b/source3/modules/vfs_cap.c @@ -79,11 +79,11 @@ static int cap_open(vfs_handle_struct *handle, connection_struct *conn, const ch return SMB_VFS_NEXT_OPEN(handle, conn, capname, flags, mode); } -static int cap_rename(vfs_handle_struct *handle, connection_struct *conn, const char *old, const char *new) +static int cap_rename(vfs_handle_struct *handle, connection_struct *conn, const char *oldname, const char *newname) { pstring capold, capnew; - capencode(capold, old); - capencode(capnew, new); + capencode(capold, oldname); + capencode(capnew, newname); return SMB_VFS_NEXT_RENAME(handle, conn, capold, capnew); } diff --git a/source3/modules/vfs_extd_audit.c b/source3/modules/vfs_extd_audit.c index 06cddc78e4..6115c97776 100644 --- a/source3/modules/vfs_extd_audit.c +++ b/source3/modules/vfs_extd_audit.c @@ -39,7 +39,7 @@ static int audit_mkdir(vfs_handle_struct *handle, connection_struct *conn, const static int audit_rmdir(vfs_handle_struct *handle, connection_struct *conn, const char *path); static int audit_open(vfs_handle_struct *handle, connection_struct *conn, const char *fname, int flags, mode_t mode); static int audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd); -static int audit_rename(vfs_handle_struct *handle, connection_struct *conn, const char *old, const char *new); +static int audit_rename(vfs_handle_struct *handle, connection_struct *conn, const char *oldname, const char *newname); static int audit_unlink(vfs_handle_struct *handle, connection_struct *conn, const char *path); static int audit_chmod(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode); static int audit_chmod_acl(vfs_handle_struct *handle, connection_struct *conn, const char *name, mode_t mode); @@ -216,18 +216,18 @@ static int audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd) return result; } -static int audit_rename(vfs_handle_struct *handle, connection_struct *conn, const char *old, const char *new) +static int audit_rename(vfs_handle_struct *handle, connection_struct *conn, const char *oldname, const char *newname) { int result; - result = SMB_VFS_NEXT_RENAME(handle, conn, old, new); + result = SMB_VFS_NEXT_RENAME(handle, conn, oldname, newname); syslog(audit_syslog_priority(handle), "rename %s -> %s %s%s\n", - old, new, + oldname, newname, (result < 0) ? "failed: " : "", (result < 0) ? strerror(errno) : ""); - DEBUG(1, ("vfs_extd_audit: rename old: %s new: %s %s %s\n", - old, new, + DEBUG(1, ("vfs_extd_audit: rename old: %s newname: %s %s %s\n", + oldname, newname, (result < 0) ? "failed: " : "", (result < 0) ? strerror(errno) : "")); diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index 3c0098408e..d2ac9b7c16 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -121,7 +121,7 @@ static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n); static int smb_full_audit_rename(vfs_handle_struct *handle, connection_struct *conn, - const char *old, const char *new); + const char *oldname, const char *newname); static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd); static int smb_full_audit_stat(vfs_handle_struct *handle, connection_struct *conn, const char *fname, SMB_STRUCT_STAT *sbuf); @@ -1012,13 +1012,13 @@ static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, } static int smb_full_audit_rename(vfs_handle_struct *handle, connection_struct *conn, - const char *old, const char *new) + const char *oldname, const char *newname) { int result; - result = SMB_VFS_NEXT_RENAME(handle, conn, old, new); + result = SMB_VFS_NEXT_RENAME(handle, conn, oldname, newname); - do_log(SMB_VFS_OP_RENAME, (result >= 0), handle, "%s|%s", old, new); + do_log(SMB_VFS_OP_RENAME, (result >= 0), handle, "%s|%s", oldname, newname); return result; } diff --git a/source3/modules/vfs_netatalk.c b/source3/modules/vfs_netatalk.c index 1b36914bbe..7a42598c36 100644 --- a/source3/modules/vfs_netatalk.c +++ b/source3/modules/vfs_netatalk.c @@ -223,7 +223,7 @@ exit_rmdir: /* File operations */ -static int atalk_rename(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *old, const char *new) +static int atalk_rename(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *oldname, const char *newname) { int ret = 0; char *adbl_path = 0; @@ -232,14 +232,14 @@ static int atalk_rename(struct vfs_handle_struct *handle, struct connection_stru SMB_STRUCT_STAT orig_info; TALLOC_CTX *ctx; - ret = SMB_VFS_NEXT_RENAME(handle, conn, old, new); + ret = SMB_VFS_NEXT_RENAME(handle, conn, oldname, newname); - if (!conn || !old) return ret; + if (!conn || !oldname) return ret; if (!(ctx = talloc_init("rename_file"))) return ret; - if (atalk_build_paths(ctx, conn->origpath, old, &adbl_path, &orig_path, + if (atalk_build_paths(ctx, conn->origpath, oldname, &adbl_path, &orig_path, &adbl_info, &orig_info) != 0) return ret; diff --git a/source3/nsswitch/wb_client.c b/source3/nsswitch/wb_client.c index 32ac4319a0..db56cf0444 100644 --- a/source3/nsswitch/wb_client.c +++ b/source3/nsswitch/wb_client.c @@ -28,7 +28,7 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_WINBIND -NSS_STATUS winbindd_request(int req_type, +NSS_STATUS winbindd_request_response(int req_type, struct winbindd_request *request, struct winbindd_response *response); @@ -52,7 +52,7 @@ BOOL winbind_lookup_name(const char *dom_name, const char *name, DOM_SID *sid, fstrcpy(request.data.name.dom_name, dom_name); fstrcpy(request.data.name.name, name); - if ((result = winbindd_request(WINBINDD_LOOKUPNAME, &request, + if ((result = winbindd_request_response(WINBINDD_LOOKUPNAME, &request, &response)) == NSS_STATUS_SUCCESS) { if (!string_to_sid(sid, response.data.sid.sid)) return False; @@ -83,7 +83,7 @@ BOOL winbind_lookup_sid(const DOM_SID *sid, /* Make request */ - result = winbindd_request(WINBINDD_LOOKUPSID, &request, &response); + result = winbindd_request_response(WINBINDD_LOOKUPSID, &request, &response); /* Copy out result */ @@ -121,7 +121,7 @@ BOOL winbind_sid_to_uid(uid_t *puid, const DOM_SID *sid) /* Make request */ - result = winbindd_request(WINBINDD_SID_TO_UID, &request, &response); + result = winbindd_request_response(WINBINDD_SID_TO_UID, &request, &response); /* Copy out result */ @@ -152,7 +152,7 @@ BOOL winbind_uid_to_sid(DOM_SID *sid, uid_t uid) /* Make request */ - result = winbindd_request(WINBINDD_UID_TO_SID, &request, &response); + result = winbindd_request_response(WINBINDD_UID_TO_SID, &request, &response); /* Copy out result */ @@ -188,7 +188,7 @@ BOOL winbind_sid_to_gid(gid_t *pgid, const DOM_SID *sid) /* Make request */ - result = winbindd_request(WINBINDD_SID_TO_GID, &request, &response); + result = winbindd_request_response(WINBINDD_SID_TO_GID, &request, &response); /* Copy out result */ @@ -219,7 +219,7 @@ BOOL winbind_gid_to_sid(DOM_SID *sid, gid_t gid) /* Make request */ - result = winbindd_request(WINBINDD_GID_TO_SID, &request, &response); + result = winbindd_request_response(WINBINDD_GID_TO_SID, &request, &response); /* Copy out result */ @@ -246,7 +246,7 @@ BOOL winbind_allocate_rid(uint32 *rid) /* Make request */ - result = winbindd_request(WINBINDD_ALLOCATE_RID, &request, &response); + result = winbindd_request_response(WINBINDD_ALLOCATE_RID, &request, &response); if (result != NSS_STATUS_SUCCESS) return False; @@ -270,7 +270,7 @@ BOOL winbind_allocate_rid_and_gid(uint32 *rid, gid_t *gid) /* Make request */ - result = winbindd_request(WINBINDD_ALLOCATE_RID_AND_GID, &request, + result = winbindd_request_response(WINBINDD_ALLOCATE_RID_AND_GID, &request, &response); if (result != NSS_STATUS_SUCCESS) @@ -299,7 +299,7 @@ static int wb_getgroups(const char *user, gid_t **groups) ZERO_STRUCT(response); - result = winbindd_request(WINBINDD_GETGROUPS, &request, &response); + result = winbindd_request_response(WINBINDD_GETGROUPS, &request, &response); if (result == NSS_STATUS_SUCCESS) { @@ -415,7 +415,7 @@ BOOL winbind_ping( void ) { NSS_STATUS result; - result = winbindd_request(WINBINDD_PING, NULL, NULL); + result = winbindd_request_response(WINBINDD_PING, NULL, NULL); return result == NSS_STATUS_SUCCESS; } @@ -450,5 +450,5 @@ NSS_STATUS wb_is_trusted_domain(const char *domain) fstrcpy(request.domain_name, domain); - return winbindd_request(WINBINDD_DOMAIN_INFO, &request, &response); + return winbindd_request_response(WINBINDD_DOMAIN_INFO, &request, &response); } diff --git a/source3/nsswitch/wb_common.c b/source3/nsswitch/wb_common.c index d2e8b9cc6a..b6f617eb95 100644 --- a/source3/nsswitch/wb_common.c +++ b/source3/nsswitch/wb_common.c @@ -316,14 +316,14 @@ int winbind_open_pipe_sock(void) /* version-check the socket */ - if ((winbindd_request(WINBINDD_INTERFACE_VERSION, &request, &response) != NSS_STATUS_SUCCESS) || (response.data.interface_version != WINBIND_INTERFACE_VERSION)) { + if ((winbindd_request_response(WINBINDD_INTERFACE_VERSION, &request, &response) != NSS_STATUS_SUCCESS) || (response.data.interface_version != WINBIND_INTERFACE_VERSION)) { close_sock(); return -1; } /* try and get priv pipe */ - if (winbindd_request(WINBINDD_PRIV_PIPE_DIR, &request, &response) == NSS_STATUS_SUCCESS) { + if (winbindd_request_response(WINBINDD_PRIV_PIPE_DIR, &request, &response) == NSS_STATUS_SUCCESS) { int fd; if ((fd = winbind_named_pipe_sock(response.extra_data)) != -1) { close(winbindd_fd); @@ -584,7 +584,7 @@ NSS_STATUS winbindd_get_response(struct winbindd_response *response) /* Handle simple types of requests */ -NSS_STATUS winbindd_request(int req_type, +NSS_STATUS winbindd_request_response(int req_type, struct winbindd_request *request, struct winbindd_response *response) { diff --git a/source3/nsswitch/wbinfo.c b/source3/nsswitch/wbinfo.c index 8407bb1e3a..34b2d6c929 100644 --- a/source3/nsswitch/wbinfo.c +++ b/source3/nsswitch/wbinfo.c @@ -43,7 +43,7 @@ static char winbind_separator(void) /* Send off request */ - if (winbindd_request(WINBINDD_INFO, NULL, &response) != + if (winbindd_request_response(WINBINDD_INFO, NULL, &response) != NSS_STATUS_SUCCESS) { d_printf("could not obtain winbind separator!\n"); /* HACK: (this module should not call lp_ funtions) */ @@ -71,7 +71,7 @@ static const char *get_winbind_domain(void) /* Send off request */ - if (winbindd_request(WINBINDD_DOMAIN_NAME, NULL, &response) != + if (winbindd_request_response(WINBINDD_DOMAIN_NAME, NULL, &response) != NSS_STATUS_SUCCESS) { d_printf("could not obtain winbind domain name!\n"); @@ -123,7 +123,7 @@ static BOOL wbinfo_get_usergroups(char *user) fstrcpy(request.data.username, user); - result = winbindd_request(WINBINDD_GETGROUPS, &request, &response); + result = winbindd_request_response(WINBINDD_GETGROUPS, &request, &response); if (result != NSS_STATUS_SUCCESS) return False; @@ -151,7 +151,7 @@ static BOOL wbinfo_get_usersids(char *user_sid) /* Send request */ fstrcpy(request.data.sid, user_sid); - result = winbindd_request(WINBINDD_GETUSERSIDS, &request, &response); + result = winbindd_request_response(WINBINDD_GETUSERSIDS, &request, &response); if (result != NSS_STATUS_SUCCESS) return False; @@ -178,7 +178,7 @@ static BOOL wbinfo_get_userdomgroups(const char *user_sid) /* Send request */ fstrcpy(request.data.sid, user_sid); - result = winbindd_request(WINBINDD_GETUSERDOMGROUPS, &request, + result = winbindd_request_response(WINBINDD_GETUSERDOMGROUPS, &request, &response); if (result != NSS_STATUS_SUCCESS) @@ -207,7 +207,7 @@ static BOOL wbinfo_wins_byname(char *name) fstrcpy(request.data.winsreq, name); - if (winbindd_request(WINBINDD_WINS_BYNAME, &request, &response) != + if (winbindd_request_response(WINBINDD_WINS_BYNAME, &request, &response) != NSS_STATUS_SUCCESS) { return False; } @@ -233,7 +233,7 @@ static BOOL wbinfo_wins_byip(char *ip) fstrcpy(request.data.winsreq, ip); - if (winbindd_request(WINBINDD_WINS_BYIP, &request, &response) != + if (winbindd_request_response(WINBINDD_WINS_BYIP, &request, &response) != NSS_STATUS_SUCCESS) { return False; } @@ -255,7 +255,7 @@ static BOOL wbinfo_list_domains(void) /* Send request */ - if (winbindd_request(WINBINDD_LIST_TRUSTDOM, NULL, &response) != + if (winbindd_request_response(WINBINDD_LIST_TRUSTDOM, NULL, &response) != NSS_STATUS_SUCCESS) return False; @@ -298,7 +298,7 @@ static BOOL wbinfo_show_sequence(const char *domain) /* Send request */ - if (winbindd_request(WINBINDD_SHOW_SEQUENCE, &request, &response) != + if (winbindd_request_response(WINBINDD_SHOW_SEQUENCE, &request, &response) != NSS_STATUS_SUCCESS) return False; @@ -327,7 +327,7 @@ static BOOL wbinfo_domain_info(const char *domain_name) /* Send request */ - if (winbindd_request(WINBINDD_DOMAIN_INFO, &request, &response) != + if (winbindd_request_response(WINBINDD_DOMAIN_INFO, &request, &response) != NSS_STATUS_SUCCESS) return False; @@ -364,7 +364,7 @@ static BOOL wbinfo_getdcname(const char *domain_name) /* Send request */ - if (winbindd_request(WINBINDD_GETDCNAME, &request, &response) != + if (winbindd_request_response(WINBINDD_GETDCNAME, &request, &response) != NSS_STATUS_SUCCESS) { d_printf("Could not get dc name for %s\n", domain_name); return False; @@ -386,7 +386,7 @@ static BOOL wbinfo_check_secret(void) ZERO_STRUCT(response); - result = winbindd_request(WINBINDD_CHECK_MACHACC, NULL, &response); + result = winbindd_request_response(WINBINDD_CHECK_MACHACC, NULL, &response); d_printf("checking the trust secret via RPC calls %s\n", (result == NSS_STATUS_SUCCESS) ? "succeeded" : "failed"); @@ -413,7 +413,7 @@ static BOOL wbinfo_uid_to_sid(uid_t uid) request.data.uid = uid; - if (winbindd_request(WINBINDD_UID_TO_SID, &request, &response) != + if (winbindd_request_response(WINBINDD_UID_TO_SID, &request, &response) != NSS_STATUS_SUCCESS) return False; @@ -438,7 +438,7 @@ static BOOL wbinfo_gid_to_sid(gid_t gid) request.data.gid = gid; - if (winbindd_request(WINBINDD_GID_TO_SID, &request, &response) != + if (winbindd_request_response(WINBINDD_GID_TO_SID, &request, &response) != NSS_STATUS_SUCCESS) return False; @@ -463,7 +463,7 @@ static BOOL wbinfo_sid_to_uid(char *sid) fstrcpy(request.data.sid, sid); - if (winbindd_request(WINBINDD_SID_TO_UID, &request, &response) != + if (winbindd_request_response(WINBINDD_SID_TO_UID, &request, &response) != NSS_STATUS_SUCCESS) return False; @@ -486,7 +486,7 @@ static BOOL wbinfo_sid_to_gid(char *sid) fstrcpy(request.data.sid, sid); - if (winbindd_request(WINBINDD_SID_TO_GID, &request, &response) != + if (winbindd_request_response(WINBINDD_SID_TO_GID, &request, &response) != NSS_STATUS_SUCCESS) return False; @@ -523,7 +523,7 @@ static BOOL wbinfo_lookupsid(char *sid) fstrcpy(request.data.sid, sid); - if (winbindd_request(WINBINDD_LOOKUPSID, &request, &response) != + if (winbindd_request_response(WINBINDD_LOOKUPSID, &request, &response) != NSS_STATUS_SUCCESS) return False; @@ -551,7 +551,7 @@ static BOOL wbinfo_lookupname(char *name) parse_wbinfo_domain_user(name, request.data.name.dom_name, request.data.name.name); - if (winbindd_request(WINBINDD_LOOKUPNAME, &request, &response) != + if (winbindd_request_response(WINBINDD_LOOKUPNAME, &request, &response) != NSS_STATUS_SUCCESS) return False; @@ -586,7 +586,7 @@ static BOOL wbinfo_auth(char *username) } else fstrcpy(request.data.auth.user, username); - result = winbindd_request(WINBINDD_PAM_AUTH, &request, &response); + result = winbindd_request_response(WINBINDD_PAM_AUTH, &request, &response); /* Display response */ @@ -684,7 +684,7 @@ static BOOL wbinfo_auth_crap(char *username) request.data.auth_crap.nt_resp_len = 24; } - result = winbindd_request(WINBINDD_PAM_AUTH_CRAP, &request, &response); + result = winbindd_request_response(WINBINDD_PAM_AUTH_CRAP, &request, &response); /* Display response */ @@ -728,7 +728,7 @@ static BOOL wbinfo_klog(char *username) request.flags |= WBFLAG_PAM_AFS_TOKEN; - result = winbindd_request(WINBINDD_PAM_AUTH, &request, &response); + result = winbindd_request_response(WINBINDD_PAM_AUTH, &request, &response); /* Display response */ @@ -780,7 +780,7 @@ static BOOL print_domain_users(const char *domain) fstrcpy( request.domain_name, domain ); } - if (winbindd_request(WINBINDD_LIST_USERS, &request, &response) != + if (winbindd_request_response(WINBINDD_LIST_USERS, &request, &response) != NSS_STATUS_SUCCESS) return False; @@ -818,7 +818,7 @@ static BOOL print_domain_groups(const char *domain) fstrcpy( request.domain_name, domain ); } - if (winbindd_request(WINBINDD_LIST_GROUPS, &request, &response) != + if (winbindd_request_response(WINBINDD_LIST_GROUPS, &request, &response) != NSS_STATUS_SUCCESS) return False; @@ -933,7 +933,7 @@ static BOOL wbinfo_ping(void) { NSS_STATUS result; - result = winbindd_request(WINBINDD_PING, NULL, NULL); + result = winbindd_request_response(WINBINDD_PING, NULL, NULL); /* Display response */ diff --git a/source3/nsswitch/winbind_client.h b/source3/nsswitch/winbind_client.h index 4de2d57cc7..ec20cd78ef 100644 --- a/source3/nsswitch/winbind_client.h +++ b/source3/nsswitch/winbind_client.h @@ -5,7 +5,7 @@ void init_request(struct winbindd_request *req,int rq_type); NSS_STATUS winbindd_send_request(int req_type, struct winbindd_request *request); NSS_STATUS winbindd_get_response(struct winbindd_response *response); -NSS_STATUS winbindd_request(int req_type, +NSS_STATUS winbindd_request_response(int req_type, struct winbindd_request *request, struct winbindd_response *response); int winbind_open_pipe_sock(void); diff --git a/source3/nsswitch/winbind_nss_linux.c b/source3/nsswitch/winbind_nss_linux.c index d8d4f93676..c0b8bf3a75 100644 --- a/source3/nsswitch/winbind_nss_linux.c +++ b/source3/nsswitch/winbind_nss_linux.c @@ -303,7 +303,7 @@ _nss_winbind_setpwent(void) free_response(&getpwent_response); } - return winbindd_request(WINBINDD_SETPWENT, NULL, NULL); + return winbindd_request_response(WINBINDD_SETPWENT, NULL, NULL); } /* Close ntdom password database "file pointer" */ @@ -320,7 +320,7 @@ _nss_winbind_endpwent(void) free_response(&getpwent_response); } - return winbindd_request(WINBINDD_ENDPWENT, NULL, NULL); + return winbindd_request_response(WINBINDD_ENDPWENT, NULL, NULL); } /* Fetch the next password entry from ntdom password database */ @@ -355,7 +355,7 @@ _nss_winbind_getpwent_r(struct passwd *result, char *buffer, request.data.num_entries = MAX_GETPWENT_USERS; - ret = winbindd_request(WINBINDD_GETPWENT, &request, + ret = winbindd_request_response(WINBINDD_GETPWENT, &request, &getpwent_response); if (ret == NSS_STATUS_SUCCESS) { @@ -425,7 +425,7 @@ _nss_winbind_getpwuid_r(uid_t uid, struct passwd *result, char *buffer, request.data.uid = uid; - ret = winbindd_request(WINBINDD_GETPWUID, &request, &response); + ret = winbindd_request_response(WINBINDD_GETPWUID, &request, &response); if (ret == NSS_STATUS_SUCCESS) { ret = fill_pwent(result, &response.data.pw, @@ -487,7 +487,7 @@ _nss_winbind_getpwnam_r(const char *name, struct passwd *result, char *buffer, request.data.username [sizeof(request.data.username) - 1] = '\0'; - ret = winbindd_request(WINBINDD_GETPWNAM, &request, &response); + ret = winbindd_request_response(WINBINDD_GETPWNAM, &request, &response); if (ret == NSS_STATUS_SUCCESS) { ret = fill_pwent(result, &response.data.pw, &buffer, @@ -543,7 +543,7 @@ _nss_winbind_setgrent(void) free_response(&getgrent_response); } - return winbindd_request(WINBINDD_SETGRENT, NULL, NULL); + return winbindd_request_response(WINBINDD_SETGRENT, NULL, NULL); } /* Close "file pointer" for ntdom group database */ @@ -560,7 +560,7 @@ _nss_winbind_endgrent(void) free_response(&getgrent_response); } - return winbindd_request(WINBINDD_ENDGRENT, NULL, NULL); + return winbindd_request_response(WINBINDD_ENDGRENT, NULL, NULL); } /* Get next entry from ntdom group database */ @@ -597,7 +597,7 @@ winbind_getgrent(enum winbindd_cmd cmd, request.data.num_entries = MAX_GETGRENT_USERS; - ret = winbindd_request(cmd, &request, + ret = winbindd_request_response(cmd, &request, &getgrent_response); if (ret == NSS_STATUS_SUCCESS) { @@ -700,7 +700,7 @@ _nss_winbind_getgrnam_r(const char *name, request.data.groupname [sizeof(request.data.groupname) - 1] = '\0'; - ret = winbindd_request(WINBINDD_GETGRNAM, &request, &response); + ret = winbindd_request_response(WINBINDD_GETGRNAM, &request, &response); if (ret == NSS_STATUS_SUCCESS) { ret = fill_grent(result, &response.data.gr, @@ -762,7 +762,7 @@ _nss_winbind_getgrgid_r(gid_t gid, request.data.gid = gid; - ret = winbindd_request(WINBINDD_GETGRGID, &request, &response); + ret = winbindd_request_response(WINBINDD_GETGRGID, &request, &response); if (ret == NSS_STATUS_SUCCESS) { @@ -821,7 +821,7 @@ _nss_winbind_initgroups_dyn(char *user, gid_t group, long int *start, strncpy(request.data.username, user, sizeof(request.data.username) - 1); - ret = winbindd_request(WINBINDD_GETGROUPS, &request, &response); + ret = winbindd_request_response(WINBINDD_GETGROUPS, &request, &response); if (ret == NSS_STATUS_SUCCESS) { int num_gids = response.data.num_entries; @@ -897,7 +897,7 @@ _nss_winbind_getusersids(const char *user_sid, char **group_sids, strncpy(request.data.sid, user_sid,sizeof(request.data.sid) - 1); request.data.sid[sizeof(request.data.sid) - 1] = '\0'; - ret = winbindd_request(WINBINDD_GETUSERSIDS, &request, &response); + ret = winbindd_request_response(WINBINDD_GETUSERSIDS, &request, &response); if (ret != NSS_STATUS_SUCCESS) { goto done; @@ -940,7 +940,7 @@ _nss_winbind_nametosid(const char *name, char **sid, char *buffer, sizeof(request.data.name.name) - 1); request.data.name.name[sizeof(request.data.name.name) - 1] = '\0'; - ret = winbindd_request(WINBINDD_LOOKUPNAME, &request, &response); + ret = winbindd_request_response(WINBINDD_LOOKUPNAME, &request, &response); if (ret != NSS_STATUS_SUCCESS) { *errnop = errno = EINVAL; goto failed; @@ -981,7 +981,7 @@ _nss_winbind_sidtoname(const char *sid, char **name, char *buffer, /* we need to fetch the separator first time through */ if (!sep_char) { - ret = winbindd_request(WINBINDD_INFO, &request, &response); + ret = winbindd_request_response(WINBINDD_INFO, &request, &response); if (ret != NSS_STATUS_SUCCESS) { *errnop = errno = EINVAL; goto failed; @@ -996,7 +996,7 @@ _nss_winbind_sidtoname(const char *sid, char **name, char *buffer, sizeof(request.data.sid) - 1); request.data.sid[sizeof(request.data.sid) - 1] = '\0'; - ret = winbindd_request(WINBINDD_LOOKUPSID, &request, &response); + ret = winbindd_request_response(WINBINDD_LOOKUPSID, &request, &response); if (ret != NSS_STATUS_SUCCESS) { *errnop = errno = EINVAL; goto failed; @@ -1043,7 +1043,7 @@ _nss_winbind_sidtouid(const char *sid, uid_t *uid, int *errnop) strncpy(request.data.sid, sid, sizeof(request.data.sid) - 1); request.data.sid[sizeof(request.data.sid) - 1] = '\0'; - ret = winbindd_request(WINBINDD_SID_TO_UID, &request, &response); + ret = winbindd_request_response(WINBINDD_SID_TO_UID, &request, &response); if (ret != NSS_STATUS_SUCCESS) { *errnop = errno = EINVAL; goto failed; @@ -1073,7 +1073,7 @@ _nss_winbind_sidtogid(const char *sid, gid_t *gid, int *errnop) strncpy(request.data.sid, sid, sizeof(request.data.sid) - 1); request.data.sid[sizeof(request.data.sid) - 1] = '\0'; - ret = winbindd_request(WINBINDD_SID_TO_GID, &request, &response); + ret = winbindd_request_response(WINBINDD_SID_TO_GID, &request, &response); if (ret != NSS_STATUS_SUCCESS) { *errnop = errno = EINVAL; goto failed; @@ -1103,7 +1103,7 @@ _nss_winbind_uidtosid(uid_t uid, char **sid, char *buffer, request.data.uid = uid; - ret = winbindd_request(WINBINDD_UID_TO_SID, &request, &response); + ret = winbindd_request_response(WINBINDD_UID_TO_SID, &request, &response); if (ret != NSS_STATUS_SUCCESS) { *errnop = errno = EINVAL; goto failed; @@ -1142,7 +1142,7 @@ _nss_winbind_gidtosid(gid_t gid, char **sid, char *buffer, request.data.gid = gid; - ret = winbindd_request(WINBINDD_GID_TO_SID, &request, &response); + ret = winbindd_request_response(WINBINDD_GID_TO_SID, &request, &response); if (ret != NSS_STATUS_SUCCESS) { *errnop = errno = EINVAL; goto failed; diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c index 5e38a84d65..078aeeb059 100644 --- a/source3/nsswitch/winbindd.c +++ b/source3/nsswitch/winbindd.c @@ -392,7 +392,7 @@ static void rw_callback(struct fd_event *event, int flags) if (done <= 0) { event->flags = 0; - event->finished(event->private, False); + event->finished(event->private_data, False); return; } } @@ -404,7 +404,7 @@ static void rw_callback(struct fd_event *event, int flags) if (done <= 0) { event->flags = 0; - event->finished(event->private, False); + event->finished(event->private_data, False); return; } } @@ -413,7 +413,7 @@ static void rw_callback(struct fd_event *event, int flags) if (event->done == event->length) { event->flags = 0; - event->finished(event->private, True); + event->finished(event->private_data, True); } } @@ -423,8 +423,8 @@ static void rw_callback(struct fd_event *event, int flags) */ void setup_async_read(struct fd_event *event, void *data, size_t length, - void (*finished)(void *private, BOOL success), - void *private) + void (*finished)(void *private_data, BOOL success), + void *private_data) { SMB_ASSERT(event->flags == 0); event->data = data; @@ -432,13 +432,13 @@ void setup_async_read(struct fd_event *event, void *data, size_t length, event->done = 0; event->handler = rw_callback; event->finished = finished; - event->private = private; + event->private_data = private_data; event->flags = EVENT_FD_READ; } void setup_async_write(struct fd_event *event, void *data, size_t length, - void (*finished)(void *private, BOOL success), - void *private) + void (*finished)(void *private_data, BOOL success), + void *private_data) { SMB_ASSERT(event->flags == 0); event->data = data; @@ -446,7 +446,7 @@ void setup_async_write(struct fd_event *event, void *data, size_t length, event->done = 0; event->handler = rw_callback; event->finished = finished; - event->private = private; + event->private_data = private_data; event->flags = EVENT_FD_WRITE; } @@ -460,17 +460,17 @@ void setup_async_write(struct fd_event *event, void *data, size_t length, * to call request_finished which schedules sending the response. */ -static void request_len_recv(void *private, BOOL success); -static void request_recv(void *private, BOOL success); +static void request_len_recv(void *private_data, BOOL success); +static void request_recv(void *private_data, BOOL success); static void request_finished(struct winbindd_cli_state *state); -void request_finished_cont(void *private, BOOL success); -static void response_main_sent(void *private, BOOL success); -static void response_extra_sent(void *private, BOOL success); +void request_finished_cont(void *private_data, BOOL success); +static void response_main_sent(void *private_data, BOOL success); +static void response_extra_sent(void *private_data, BOOL success); -static void response_extra_sent(void *private, BOOL success) +static void response_extra_sent(void *private_data, BOOL success) { struct winbindd_cli_state *state = - talloc_get_type_abort(private, struct winbindd_cli_state); + talloc_get_type_abort(private_data, struct winbindd_cli_state); if (state->mem_ctx != NULL) { talloc_destroy(state->mem_ctx); @@ -488,10 +488,10 @@ static void response_extra_sent(void *private, BOOL success) request_len_recv, state); } -static void response_main_sent(void *private, BOOL success) +static void response_main_sent(void *private_data, BOOL success) { struct winbindd_cli_state *state = - talloc_get_type_abort(private, struct winbindd_cli_state); + talloc_get_type_abort(private_data, struct winbindd_cli_state); if (!success) { state->finished = True; @@ -534,10 +534,10 @@ void request_ok(struct winbindd_cli_state *state) request_finished(state); } -void request_finished_cont(void *private, BOOL success) +void request_finished_cont(void *private_data, BOOL success) { struct winbindd_cli_state *state = - talloc_get_type_abort(private, struct winbindd_cli_state); + talloc_get_type_abort(private_data, struct winbindd_cli_state); if (success) request_ok(state); @@ -545,10 +545,10 @@ void request_finished_cont(void *private, BOOL success) request_error(state); } -static void request_recv(void *private, BOOL success) +static void request_recv(void *private_data, BOOL success) { struct winbindd_cli_state *state = - talloc_get_type_abort(private, struct winbindd_cli_state); + talloc_get_type_abort(private_data, struct winbindd_cli_state); if (!success) { state->finished = True; @@ -558,10 +558,10 @@ static void request_recv(void *private, BOOL success) process_request(state); } -static void request_len_recv(void *private, BOOL success) +static void request_len_recv(void *private_data, BOOL success) { struct winbindd_cli_state *state = - talloc_get_type_abort(private, struct winbindd_cli_state); + talloc_get_type_abort(private_data, struct winbindd_cli_state); if (!success) { state->finished = True; diff --git a/source3/nsswitch/winbindd.h b/source3/nsswitch/winbindd.h index d000168b1f..378120c80b 100644 --- a/source3/nsswitch/winbindd.h +++ b/source3/nsswitch/winbindd.h @@ -43,8 +43,8 @@ struct fd_event { void (*handler)(struct fd_event *fde, int flags); void *data; size_t length, done; - void (*finished)(void *private, BOOL success); - void *private; + void (*finished)(void *private_data, BOOL success); + void *private_data; }; struct winbindd_cli_state { @@ -163,7 +163,7 @@ struct winbindd_domain { /* Private data for the backends (used for connection cache) */ - void *private; + void *private_data; /* A working DC */ fstring dcname; diff --git a/source3/nsswitch/winbindd_ads.c b/source3/nsswitch/winbindd_ads.c index 0f4dee4f4a..c807ec59a5 100644 --- a/source3/nsswitch/winbindd_ads.c +++ b/source3/nsswitch/winbindd_ads.c @@ -39,8 +39,8 @@ static ADS_STRUCT *ads_cached_connection(struct winbindd_domain *domain) ADS_STRUCT *ads; ADS_STATUS status; - if (domain->private) { - ads = (ADS_STRUCT *)domain->private; + if (domain->private_data) { + ads = (ADS_STRUCT *)domain->private_data; /* check for a valid structure */ @@ -54,7 +54,7 @@ static ADS_STRUCT *ads_cached_connection(struct winbindd_domain *domain) ads->is_mine = True; ads_destroy( &ads ); ads_kdestroy("MEMORY:winbind_ccache"); - domain->private = NULL; + domain->private_data = NULL; } } @@ -101,7 +101,7 @@ static ADS_STRUCT *ads_cached_connection(struct winbindd_domain *domain) ads->is_mine = False; - domain->private = (void *)ads; + domain->private_data = (void *)ads; return ads; } @@ -767,7 +767,7 @@ static NTSTATUS sequence_number(struct winbindd_domain *domain, uint32 *seq) through since ads_USN() has already done that indirectly */ - domain->private = NULL; + domain->private_data = NULL; } return ads_ntstatus(rc); } diff --git a/source3/nsswitch/winbindd_async.c b/source3/nsswitch/winbindd_async.c index 9ac2acafd0..d227177ec1 100644 --- a/source3/nsswitch/winbindd_async.c +++ b/source3/nsswitch/winbindd_async.c @@ -44,32 +44,32 @@ struct do_async_state { void (*cont)(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private); - void *c, *private; + void *c, void *private_data); + void *c, *private_data; }; -static void do_async_recv(void *private, BOOL success) +static void do_async_recv(void *private_data, BOOL success) { struct do_async_state *state = - talloc_get_type_abort(private, struct do_async_state); + talloc_get_type_abort(private_data, struct do_async_state); state->cont(state->mem_ctx, success, &state->response, - state->c, state->private); + state->c, state->private_data); } static void do_async(TALLOC_CTX *mem_ctx, struct winbindd_child *child, const struct winbindd_request *request, void (*cont)(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private), - void *c, void *private) + void *c, void *private_data), + void *c, void *private_data) { struct do_async_state *state; state = TALLOC_P(mem_ctx, struct do_async_state); if (state == NULL) { DEBUG(0, ("talloc failed\n")); - cont(mem_ctx, False, NULL, c, private); + cont(mem_ctx, False, NULL, c, private_data); return; } @@ -78,7 +78,7 @@ static void do_async(TALLOC_CTX *mem_ctx, struct winbindd_child *child, state->request.length = sizeof(state->request); state->cont = cont; state->c = c; - state->private = private; + state->private_data = private_data; async_request(mem_ctx, child, &state->request, &state->response, do_async_recv, state); @@ -88,15 +88,15 @@ static void do_async_domain(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain, const struct winbindd_request *request, void (*cont)(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private), - void *c, void *private) + void *c, void *private_data), + void *c, void *private_data) { struct do_async_state *state; state = TALLOC_P(mem_ctx, struct do_async_state); if (state == NULL) { DEBUG(0, ("talloc failed\n")); - cont(mem_ctx, False, NULL, c, private); + cont(mem_ctx, False, NULL, c, private_data); return; } @@ -105,7 +105,7 @@ static void do_async_domain(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain, state->request.length = sizeof(state->request); state->cont = cont; state->c = c; - state->private = private; + state->private_data = private_data; async_domain_request(mem_ctx, domain, &state->request, &state->response, do_async_recv, state); @@ -113,29 +113,29 @@ static void do_async_domain(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain, static void idmap_set_mapping_recv(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private) + void *c, void *private_data) { void (*cont)(void *priv, BOOL succ) = c; if (!success) { DEBUG(5, ("Could not trigger idmap_set_mapping\n")); - cont(private, False); + cont(private_data, False); return; } if (response->result != WINBINDD_OK) { DEBUG(5, ("idmap_set_mapping returned an error\n")); - cont(private, False); + cont(private_data, False); return; } - cont(private, True); + cont(private_data, True); } void idmap_set_mapping_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid, unid_t id, int id_type, - void (*cont)(void *private, BOOL success), - void *private) + void (*cont)(void *private_data, BOOL success), + void *private_data) { struct winbindd_request request; ZERO_STRUCT(request); @@ -148,7 +148,7 @@ void idmap_set_mapping_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid, sid_to_string(request.data.dual_idmapset.sid, sid); do_async(mem_ctx, idmap_child(), &request, idmap_set_mapping_recv, - cont, private); + cont, private_data); } enum winbindd_result winbindd_dual_idmapset(struct winbindd_domain *domain, @@ -175,11 +175,11 @@ enum winbindd_result winbindd_dual_idmapset(struct winbindd_domain *domain, static void idmap_sid2uid_recv(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private); + void *c, void *private_data); void idmap_sid2uid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid, BOOL alloc, - void (*cont)(void *private, BOOL success, uid_t uid), - void *private) + void (*cont)(void *private_data, BOOL success, uid_t uid), + void *private_data) { struct winbindd_request request; ZERO_STRUCT(request); @@ -187,7 +187,7 @@ void idmap_sid2uid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid, BOOL alloc, sid_to_string(request.data.dual_sid2id.sid, sid); request.data.dual_sid2id.alloc = alloc; do_async(mem_ctx, idmap_child(), &request, idmap_sid2uid_recv, - cont, private); + cont, private_data); } enum winbindd_result winbindd_dual_sid2uid(struct winbindd_domain *domain, @@ -217,40 +217,40 @@ enum winbindd_result winbindd_dual_sid2uid(struct winbindd_domain *domain, static void idmap_sid2uid_recv(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private) + void *c, void *private_data) { void (*cont)(void *priv, BOOL succ, uid_t uid) = c; if (!success) { DEBUG(5, ("Could not trigger sid2uid\n")); - cont(private, False, 0); + cont(private_data, False, 0); return; } if (response->result != WINBINDD_OK) { DEBUG(5, ("sid2uid returned an error\n")); - cont(private, False, 0); + cont(private_data, False, 0); return; } - cont(private, True, response->data.uid); + cont(private_data, True, response->data.uid); } static void uid2name_recv(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private); + void *c, void *private_data); void winbindd_uid2name_async(TALLOC_CTX *mem_ctx, uid_t uid, - void (*cont)(void *private, BOOL success, + void (*cont)(void *private_data, BOOL success, const char *name), - void *private) + void *private_data) { struct winbindd_request request; ZERO_STRUCT(request); request.cmd = WINBINDD_DUAL_UID2NAME; request.data.uid = uid; do_async(mem_ctx, idmap_child(), &request, uid2name_recv, - cont, private); + cont, private_data); } enum winbindd_result winbindd_dual_uid2name(struct winbindd_domain *domain, @@ -274,40 +274,40 @@ enum winbindd_result winbindd_dual_uid2name(struct winbindd_domain *domain, static void uid2name_recv(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private) + void *c, void *private_data) { void (*cont)(void *priv, BOOL succ, const char *name) = c; if (!success) { DEBUG(5, ("Could not trigger uid2name\n")); - cont(private, False, NULL); + cont(private_data, False, NULL); return; } if (response->result != WINBINDD_OK) { DEBUG(5, ("uid2name returned an error\n")); - cont(private, False, NULL); + cont(private_data, False, NULL); return; } - cont(private, True, response->data.name.name); + cont(private_data, True, response->data.name.name); } static void name2uid_recv(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private); + void *c, void *private_data); static void winbindd_name2uid_async(TALLOC_CTX *mem_ctx, const char *name, - void (*cont)(void *private, BOOL success, + void (*cont)(void *private_data, BOOL success, uid_t uid), - void *private) + void *private_data) { struct winbindd_request request; ZERO_STRUCT(request); request.cmd = WINBINDD_DUAL_NAME2UID; fstrcpy(request.data.username, name); do_async(mem_ctx, idmap_child(), &request, name2uid_recv, - cont, private); + cont, private_data); } enum winbindd_result winbindd_dual_name2uid(struct winbindd_domain *domain, @@ -333,32 +333,32 @@ enum winbindd_result winbindd_dual_name2uid(struct winbindd_domain *domain, static void name2uid_recv(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private) + void *c, void *private_data) { void (*cont)(void *priv, BOOL succ, uid_t uid) = c; if (!success) { DEBUG(5, ("Could not trigger name2uid\n")); - cont(private, False, 0); + cont(private_data, False, 0); return; } if (response->result != WINBINDD_OK) { DEBUG(5, ("name2uid returned an error\n")); - cont(private, False, 0); + cont(private_data, False, 0); return; } - cont(private, True, response->data.uid); + cont(private_data, True, response->data.uid); } static void idmap_sid2gid_recv(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private); + void *c, void *private_data); void idmap_sid2gid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid, BOOL alloc, - void (*cont)(void *private, BOOL success, gid_t gid), - void *private) + void (*cont)(void *private_data, BOOL success, gid_t gid), + void *private_data) { struct winbindd_request request; ZERO_STRUCT(request); @@ -366,7 +366,7 @@ void idmap_sid2gid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid, BOOL alloc, sid_to_string(request.data.dual_sid2id.sid, sid); request.data.dual_sid2id.alloc = alloc; do_async(mem_ctx, idmap_child(), &request, idmap_sid2gid_recv, - cont, private); + cont, private_data); } enum winbindd_result winbindd_dual_sid2gid(struct winbindd_domain *domain, @@ -396,57 +396,57 @@ enum winbindd_result winbindd_dual_sid2gid(struct winbindd_domain *domain, static void idmap_sid2gid_recv(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private) + void *c, void *private_data) { void (*cont)(void *priv, BOOL succ, gid_t gid) = c; if (!success) { DEBUG(5, ("Could not trigger sid2gid\n")); - cont(private, False, 0); + cont(private_data, False, 0); return; } if (response->result != WINBINDD_OK) { DEBUG(5, ("sid2gid returned an error\n")); - cont(private, False, 0); + cont(private_data, False, 0); return; } - cont(private, True, response->data.gid); + cont(private_data, True, response->data.gid); } static void gid2name_recv(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private) + void *c, void *private_data) { void (*cont)(void *priv, BOOL succ, const char *name) = c; if (!success) { DEBUG(5, ("Could not trigger gid2name\n")); - cont(private, False, NULL); + cont(private_data, False, NULL); return; } if (response->result != WINBINDD_OK) { DEBUG(5, ("gid2name returned an error\n")); - cont(private, False, NULL); + cont(private_data, False, NULL); return; } - cont(private, True, response->data.name.name); + cont(private_data, True, response->data.name.name); } void winbindd_gid2name_async(TALLOC_CTX *mem_ctx, gid_t gid, - void (*cont)(void *private, BOOL success, + void (*cont)(void *private_data, BOOL success, const char *name), - void *private) + void *private_data) { struct winbindd_request request; ZERO_STRUCT(request); request.cmd = WINBINDD_DUAL_GID2NAME; request.data.gid = gid; do_async(mem_ctx, idmap_child(), &request, gid2name_recv, - cont, private); + cont, private_data); } enum winbindd_result winbindd_dual_gid2name(struct winbindd_domain *domain, @@ -467,19 +467,19 @@ enum winbindd_result winbindd_dual_gid2name(struct winbindd_domain *domain, static void name2gid_recv(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private); + void *c, void *private_data); static void winbindd_name2gid_async(TALLOC_CTX *mem_ctx, const char *name, - void (*cont)(void *private, BOOL success, + void (*cont)(void *private_data, BOOL success, gid_t gid), - void *private) + void *private_data) { struct winbindd_request request; ZERO_STRUCT(request); request.cmd = WINBINDD_DUAL_NAME2GID; fstrcpy(request.data.groupname, name); do_async(mem_ctx, idmap_child(), &request, name2gid_recv, - cont, private); + cont, private_data); } enum winbindd_result winbindd_dual_name2gid(struct winbindd_domain *domain, @@ -505,55 +505,55 @@ enum winbindd_result winbindd_dual_name2gid(struct winbindd_domain *domain, static void name2gid_recv(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private) + void *c, void *private_data) { void (*cont)(void *priv, BOOL succ, gid_t gid) = c; if (!success) { DEBUG(5, ("Could not trigger name2gid\n")); - cont(private, False, 0); + cont(private_data, False, 0); return; } if (response->result != WINBINDD_OK) { DEBUG(5, ("name2gid returned an error\n")); - cont(private, False, 0); + cont(private_data, False, 0); return; } - cont(private, True, response->data.gid); + cont(private_data, True, response->data.gid); } static void lookupsid_recv(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private) + void *c, void *private_data) { void (*cont)(void *priv, BOOL succ, const char *dom_name, const char *name, enum SID_NAME_USE type) = c; if (!success) { DEBUG(5, ("Could not trigger lookupsid\n")); - cont(private, False, NULL, NULL, SID_NAME_UNKNOWN); + cont(private_data, False, NULL, NULL, SID_NAME_UNKNOWN); return; } if (response->result != WINBINDD_OK) { DEBUG(5, ("lookupsid returned an error\n")); - cont(private, False, NULL, NULL, SID_NAME_UNKNOWN); + cont(private_data, False, NULL, NULL, SID_NAME_UNKNOWN); return; } - cont(private, True, response->data.name.dom_name, + cont(private_data, True, response->data.name.dom_name, response->data.name.name, response->data.name.type); } void winbindd_lookupsid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid, - void (*cont)(void *private, BOOL success, + void (*cont)(void *private_data, BOOL success, const char *dom_name, const char *name, enum SID_NAME_USE type), - void *private) + void *private_data) { struct winbindd_domain *domain; struct winbindd_request request; @@ -562,7 +562,7 @@ void winbindd_lookupsid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid, if (domain == NULL) { DEBUG(5, ("Could not find domain for sid %s\n", sid_string_static(sid))); - cont(private, False, NULL, NULL, SID_NAME_UNKNOWN); + cont(private_data, False, NULL, NULL, SID_NAME_UNKNOWN); return; } @@ -571,7 +571,7 @@ void winbindd_lookupsid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid, fstrcpy(request.data.sid, sid_string_static(sid)); do_async_domain(mem_ctx, domain, &request, lookupsid_recv, - cont, private); + cont, private_data); } enum winbindd_result winbindd_dual_lookupsid(struct winbindd_domain *domain, @@ -611,7 +611,7 @@ enum winbindd_result winbindd_dual_lookupsid(struct winbindd_domain *domain, static void lookupname_recv(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private) + void *c, void *private_data) { void (*cont)(void *priv, BOOL succ, const DOM_SID *sid, enum SID_NAME_USE type) = c; @@ -619,32 +619,32 @@ static void lookupname_recv(TALLOC_CTX *mem_ctx, BOOL success, if (!success) { DEBUG(5, ("Could not trigger lookup_name\n")); - cont(private, False, NULL, SID_NAME_UNKNOWN); + cont(private_data, False, NULL, SID_NAME_UNKNOWN); return; } if (response->result != WINBINDD_OK) { DEBUG(5, ("lookup_name returned an error\n")); - cont(private, False, NULL, SID_NAME_UNKNOWN); + cont(private_data, False, NULL, SID_NAME_UNKNOWN); return; } if (!string_to_sid(&sid, response->data.sid.sid)) { DEBUG(0, ("Could not convert string %s to sid\n", response->data.sid.sid)); - cont(private, False, NULL, SID_NAME_UNKNOWN); + cont(private_data, False, NULL, SID_NAME_UNKNOWN); return; } - cont(private, True, &sid, response->data.sid.type); + cont(private_data, True, &sid, response->data.sid.type); } void winbindd_lookupname_async(TALLOC_CTX *mem_ctx, const char *dom_name, const char *name, - void (*cont)(void *private, BOOL success, + void (*cont)(void *private_data, BOOL success, const DOM_SID *sid, enum SID_NAME_USE type), - void *private) + void *private_data) { struct winbindd_request request; struct winbindd_domain *domain; @@ -653,7 +653,7 @@ void winbindd_lookupname_async(TALLOC_CTX *mem_ctx, const char *dom_name, if (domain == NULL) { DEBUG(5, ("Could not find domain for name %s\n", dom_name)); - cont(private, False, NULL, SID_NAME_UNKNOWN); + cont(private_data, False, NULL, SID_NAME_UNKNOWN); return; } @@ -663,7 +663,7 @@ void winbindd_lookupname_async(TALLOC_CTX *mem_ctx, const char *dom_name, fstrcpy(request.data.name.name, name); do_async_domain(mem_ctx, domain, &request, lookupname_recv, - cont, private); + cont, private_data); } enum winbindd_result winbindd_dual_lookupname(struct winbindd_domain *domain, @@ -756,7 +756,7 @@ static BOOL parse_sidlist(TALLOC_CTX *mem_ctx, char *sidstr, static void getsidaliases_recv(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private) + void *c, void *private_data) { void (*cont)(void *priv, BOOL succ, DOM_SID *aliases, int num_aliases) = c; @@ -766,13 +766,13 @@ static void getsidaliases_recv(TALLOC_CTX *mem_ctx, BOOL success, if (!success) { DEBUG(5, ("Could not trigger getsidaliases\n")); - cont(private, success, NULL, 0); + cont(private_data, success, NULL, 0); return; } if (response->result != WINBINDD_OK) { DEBUG(5, ("getsidaliases returned an error\n")); - cont(private, False, NULL, 0); + cont(private_data, False, NULL, 0); return; } @@ -780,47 +780,47 @@ static void getsidaliases_recv(TALLOC_CTX *mem_ctx, BOOL success, if (aliases_str == NULL) { DEBUG(10, ("getsidaliases return 0 SIDs\n")); - cont(private, True, NULL, 0); + cont(private_data, True, NULL, 0); return; } if (!parse_sidlist(mem_ctx, aliases_str, &sids, &num_sids)) { DEBUG(0, ("Could not parse sids\n")); - cont(private, False, NULL, 0); + cont(private_data, False, NULL, 0); return; } SAFE_FREE(response->extra_data); - cont(private, True, sids, num_sids); + cont(private_data, True, sids, num_sids); } void winbindd_getsidaliases_async(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, const DOM_SID *sids, int num_sids, - void (*cont)(void *private, + void (*cont)(void *private_data, BOOL success, const DOM_SID *aliases, int num_aliases), - void *private) + void *private_data) { struct winbindd_request request; char *sidstr = NULL; char *keystr; if (num_sids == 0) { - cont(private, True, NULL, 0); + cont(private_data, True, NULL, 0); return; } if (!print_sidlist(mem_ctx, sids, num_sids, &sidstr)) { - cont(private, False, NULL, 0); + cont(private_data, False, NULL, 0); return; } keystr = cache_store_request_data(mem_ctx, sidstr); if (keystr == NULL) { - cont(private, False, NULL, 0); + cont(private_data, False, NULL, 0); return; } @@ -830,7 +830,7 @@ void winbindd_getsidaliases_async(struct winbindd_domain *domain, fstrcpy(request.data.dual_sidaliases.cache_key, keystr); do_async_domain(mem_ctx, domain, &request, getsidaliases_recv, - cont, private); + cont, private_data); } enum winbindd_result winbindd_dual_getsidaliases(struct winbindd_domain *domain, @@ -912,22 +912,22 @@ struct gettoken_state { struct winbindd_domain *builtin_domain; DOM_SID *sids; int num_sids; - void (*cont)(void *private, BOOL success, DOM_SID *sids, int num_sids); - void *private; + void (*cont)(void *private_data, BOOL success, DOM_SID *sids, int num_sids); + void *private_data; }; static void gettoken_recvdomgroups(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private); -static void gettoken_recvaliases(void *private, BOOL success, + void *c, void *private_data); +static void gettoken_recvaliases(void *private_data, BOOL success, const DOM_SID *aliases, int num_aliases); void winbindd_gettoken_async(TALLOC_CTX *mem_ctx, const DOM_SID *user_sid, - void (*cont)(void *private, BOOL success, + void (*cont)(void *private_data, BOOL success, DOM_SID *sids, int num_sids), - void *private) + void *private_data) { struct winbindd_domain *domain; struct winbindd_request request; @@ -936,7 +936,7 @@ void winbindd_gettoken_async(TALLOC_CTX *mem_ctx, const DOM_SID *user_sid, state = TALLOC_P(mem_ctx, struct gettoken_state); if (state == NULL) { DEBUG(0, ("talloc failed\n")); - cont(private, False, NULL, 0); + cont(private_data, False, NULL, 0); return; } @@ -945,13 +945,13 @@ void winbindd_gettoken_async(TALLOC_CTX *mem_ctx, const DOM_SID *user_sid, state->alias_domain = find_our_domain(); state->builtin_domain = find_builtin_domain(); state->cont = cont; - state->private = private; + state->private_data = private_data; domain = find_domain_from_sid_noinit(user_sid); if (domain == NULL) { DEBUG(5, ("Could not find domain from SID %s\n", sid_string_static(user_sid))); - cont(private, False, NULL, 0); + cont(private_data, False, NULL, 0); return; } @@ -965,15 +965,15 @@ void winbindd_gettoken_async(TALLOC_CTX *mem_ctx, const DOM_SID *user_sid, static void gettoken_recvdomgroups(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private) + void *c, void *private_data) { struct gettoken_state *state = - talloc_get_type_abort(private, struct gettoken_state); + talloc_get_type_abort(private_data, struct gettoken_state); char *sids_str; if (!success) { DEBUG(10, ("Could not get domain groups\n")); - state->cont(state->private, False, NULL, 0); + state->cont(state->private_data, False, NULL, 0); return; } @@ -981,7 +981,7 @@ static void gettoken_recvdomgroups(TALLOC_CTX *mem_ctx, BOOL success, if (sids_str == NULL) { DEBUG(10, ("Received no domain groups\n")); - state->cont(state->private, True, NULL, 0); + state->cont(state->private_data, True, NULL, 0); return; } @@ -994,7 +994,7 @@ static void gettoken_recvdomgroups(TALLOC_CTX *mem_ctx, BOOL success, if (!parse_sidlist(mem_ctx, sids_str, &state->sids, &state->num_sids)) { DEBUG(0, ("Could not parse sids\n")); - state->cont(state->private, False, NULL, 0); + state->cont(state->private_data, False, NULL, 0); return; } @@ -1002,7 +1002,7 @@ static void gettoken_recvdomgroups(TALLOC_CTX *mem_ctx, BOOL success, if (state->alias_domain == NULL) { DEBUG(10, ("Don't expand domain local groups\n")); - state->cont(state->private, True, state->sids, + state->cont(state->private_data, True, state->sids, state->num_sids); return; } @@ -1012,16 +1012,16 @@ static void gettoken_recvdomgroups(TALLOC_CTX *mem_ctx, BOOL success, gettoken_recvaliases, state); } -static void gettoken_recvaliases(void *private, BOOL success, +static void gettoken_recvaliases(void *private_data, BOOL success, const DOM_SID *aliases, int num_aliases) { - struct gettoken_state *state = private; + struct gettoken_state *state = private_data; int i; if (!success) { DEBUG(10, ("Could not receive domain local groups\n")); - state->cont(state->private, False, NULL, 0); + state->cont(state->private_data, False, NULL, 0); return; } @@ -1039,7 +1039,7 @@ static void gettoken_recvaliases(void *private, BOOL success, return; } - state->cont(state->private, True, state->sids, state->num_sids); + state->cont(state->private_data, True, state->sids, state->num_sids); } struct sid2uid_state { @@ -1047,22 +1047,22 @@ struct sid2uid_state { DOM_SID sid; char *username; uid_t uid; - void (*cont)(void *private, BOOL success, uid_t uid); - void *private; + void (*cont)(void *private_data, BOOL success, uid_t uid); + void *private_data; }; -static void sid2uid_lookup_sid_recv(void *private, BOOL success, +static void sid2uid_lookup_sid_recv(void *private_data, BOOL success, const char *dom_name, const char *name, enum SID_NAME_USE type); -static void sid2uid_noalloc_recv(void *private, BOOL success, uid_t uid); -static void sid2uid_alloc_recv(void *private, BOOL success, uid_t uid); -static void sid2uid_name2uid_recv(void *private, BOOL success, uid_t uid); -static void sid2uid_set_mapping_recv(void *private, BOOL success); +static void sid2uid_noalloc_recv(void *private_data, BOOL success, uid_t uid); +static void sid2uid_alloc_recv(void *private_data, BOOL success, uid_t uid); +static void sid2uid_name2uid_recv(void *private_data, BOOL success, uid_t uid); +static void sid2uid_set_mapping_recv(void *private_data, BOOL success); void winbindd_sid2uid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid, - void (*cont)(void *private, BOOL success, + void (*cont)(void *private_data, BOOL success, uid_t uid), - void *private) + void *private_data) { struct sid2uid_state *state; NTSTATUS result; @@ -1070,7 +1070,7 @@ void winbindd_sid2uid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid, if (idmap_proxyonly()) { DEBUG(10, ("idmap proxy only\n")); - cont(private, False, 0); + cont(private_data, False, 0); return; } @@ -1079,43 +1079,43 @@ void winbindd_sid2uid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid, result = idmap_sid_to_uid(sid, &uid, ID_QUERY_ONLY|ID_CACHE_ONLY); if (NT_STATUS_IS_OK(result)) { - cont(private, True, uid); + cont(private_data, True, uid); return; } state = TALLOC_P(mem_ctx, struct sid2uid_state); if (state == NULL) { DEBUG(0, ("talloc failed\n")); - cont(private, False, 0); + cont(private_data, False, 0); return; } state->mem_ctx = mem_ctx; state->sid = *sid; state->cont = cont; - state->private = private; + state->private_data = private_data; /* Let's see if it's really a user before allocating a uid */ winbindd_lookupsid_async(mem_ctx, sid, sid2uid_lookup_sid_recv, state); } -static void sid2uid_lookup_sid_recv(void *private, BOOL success, +static void sid2uid_lookup_sid_recv(void *private_data, BOOL success, const char *dom_name, const char *name, enum SID_NAME_USE type) { struct sid2uid_state *state = - talloc_get_type_abort(private, struct sid2uid_state); + talloc_get_type_abort(private_data, struct sid2uid_state); if (!success) { DEBUG(5, ("Could not trigger lookup_sid\n")); - state->cont(state->private, False, 0); + state->cont(state->private_data, False, 0); return; } if ((type != SID_NAME_USER) && (type != SID_NAME_COMPUTER)) { DEBUG(5, ("SID is not a user\n")); - state->cont(state->private, False, 0); + state->cont(state->private_data, False, 0); return; } @@ -1127,15 +1127,15 @@ static void sid2uid_lookup_sid_recv(void *private, BOOL success, sid2uid_noalloc_recv, state); } -static void sid2uid_noalloc_recv(void *private, BOOL success, uid_t uid) +static void sid2uid_noalloc_recv(void *private_data, BOOL success, uid_t uid) { struct sid2uid_state *state = - talloc_get_type_abort(private, struct sid2uid_state); + talloc_get_type_abort(private_data, struct sid2uid_state); if (success) { DEBUG(10, ("found uid for sid %s in remote backend\n", sid_string_static(&state->sid))); - state->cont(state->private, True, uid); + state->cont(state->private_data, True, uid); return; } @@ -1155,30 +1155,30 @@ static void sid2uid_noalloc_recv(void *private, BOOL success, uid_t uid) sid2uid_alloc_recv, state); } -static void sid2uid_alloc_recv(void *private, BOOL success, uid_t uid) +static void sid2uid_alloc_recv(void *private_data, BOOL success, uid_t uid) { struct sid2uid_state *state = - talloc_get_type_abort(private, struct sid2uid_state); + talloc_get_type_abort(private_data, struct sid2uid_state); if (!success) { DEBUG(5, ("Could not allocate uid\n")); - state->cont(state->private, False, 0); + state->cont(state->private_data, False, 0); return; } - state->cont(state->private, True, uid); + state->cont(state->private_data, True, uid); } -static void sid2uid_name2uid_recv(void *private, BOOL success, uid_t uid) +static void sid2uid_name2uid_recv(void *private_data, BOOL success, uid_t uid) { struct sid2uid_state *state = - talloc_get_type_abort(private, struct sid2uid_state); + talloc_get_type_abort(private_data, struct sid2uid_state); unid_t id; if (!success) { DEBUG(5, ("Could not find uid for name %s\n", state->username)); - state->cont(state->private, False, 0); + state->cont(state->private_data, False, 0); return; } @@ -1189,19 +1189,19 @@ static void sid2uid_name2uid_recv(void *private, BOOL success, uid_t uid) sid2uid_set_mapping_recv, state); } -static void sid2uid_set_mapping_recv(void *private, BOOL success) +static void sid2uid_set_mapping_recv(void *private_data, BOOL success) { struct sid2uid_state *state = - talloc_get_type_abort(private, struct sid2uid_state); + talloc_get_type_abort(private_data, struct sid2uid_state); if (!success) { DEBUG(5, ("Could not set ID mapping for sid %s\n", sid_string_static(&state->sid))); - state->cont(state->private, False, 0); + state->cont(state->private_data, False, 0); return; } - state->cont(state->private, True, state->uid); + state->cont(state->private_data, True, state->uid); } struct sid2gid_state { @@ -1209,22 +1209,22 @@ struct sid2gid_state { DOM_SID sid; char *groupname; gid_t gid; - void (*cont)(void *private, BOOL success, gid_t gid); - void *private; + void (*cont)(void *private_data, BOOL success, gid_t gid); + void *private_data; }; -static void sid2gid_lookup_sid_recv(void *private, BOOL success, +static void sid2gid_lookup_sid_recv(void *private_data, BOOL success, const char *dom_name, const char *name, enum SID_NAME_USE type); -static void sid2gid_noalloc_recv(void *private, BOOL success, gid_t gid); -static void sid2gid_alloc_recv(void *private, BOOL success, gid_t gid); -static void sid2gid_name2gid_recv(void *private, BOOL success, gid_t gid); -static void sid2gid_set_mapping_recv(void *private, BOOL success); +static void sid2gid_noalloc_recv(void *private_data, BOOL success, gid_t gid); +static void sid2gid_alloc_recv(void *private_data, BOOL success, gid_t gid); +static void sid2gid_name2gid_recv(void *private_data, BOOL success, gid_t gid); +static void sid2gid_set_mapping_recv(void *private_data, BOOL success); void winbindd_sid2gid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid, - void (*cont)(void *private, BOOL success, + void (*cont)(void *private_data, BOOL success, gid_t gid), - void *private) + void *private_data) { struct sid2gid_state *state; NTSTATUS result; @@ -1232,7 +1232,7 @@ void winbindd_sid2gid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid, if (idmap_proxyonly()) { DEBUG(10, ("idmap proxy only\n")); - cont(private, False, 0); + cont(private_data, False, 0); return; } @@ -1241,44 +1241,44 @@ void winbindd_sid2gid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid, result = idmap_sid_to_gid(sid, &gid, ID_QUERY_ONLY|ID_CACHE_ONLY); if (NT_STATUS_IS_OK(result)) { - cont(private, True, gid); + cont(private_data, True, gid); return; } state = TALLOC_P(mem_ctx, struct sid2gid_state); if (state == NULL) { DEBUG(0, ("talloc failed\n")); - cont(private, False, 0); + cont(private_data, False, 0); return; } state->mem_ctx = mem_ctx; state->sid = *sid; state->cont = cont; - state->private = private; + state->private_data = private_data; /* Let's see if it's really a user before allocating a gid */ winbindd_lookupsid_async(mem_ctx, sid, sid2gid_lookup_sid_recv, state); } -static void sid2gid_lookup_sid_recv(void *private, BOOL success, +static void sid2gid_lookup_sid_recv(void *private_data, BOOL success, const char *dom_name, const char *name, enum SID_NAME_USE type) { struct sid2gid_state *state = - talloc_get_type_abort(private, struct sid2gid_state); + talloc_get_type_abort(private_data, struct sid2gid_state); if (!success) { DEBUG(5, ("Could not trigger lookup_sid\n")); - state->cont(state->private, False, 0); + state->cont(state->private_data, False, 0); return; } if (((type != SID_NAME_DOM_GRP) && (type != SID_NAME_ALIAS) && (type != SID_NAME_WKN_GRP))) { DEBUG(5, ("SID is not a group\n")); - state->cont(state->private, False, 0); + state->cont(state->private_data, False, 0); return; } @@ -1290,15 +1290,15 @@ static void sid2gid_lookup_sid_recv(void *private, BOOL success, sid2gid_noalloc_recv, state); } -static void sid2gid_noalloc_recv(void *private, BOOL success, gid_t gid) +static void sid2gid_noalloc_recv(void *private_data, BOOL success, gid_t gid) { struct sid2gid_state *state = - talloc_get_type_abort(private, struct sid2gid_state); + talloc_get_type_abort(private_data, struct sid2gid_state); if (success) { DEBUG(10, ("found gid for sid %s in remote backend\n", sid_string_static(&state->sid))); - state->cont(state->private, True, gid); + state->cont(state->private_data, True, gid); return; } @@ -1318,30 +1318,30 @@ static void sid2gid_noalloc_recv(void *private, BOOL success, gid_t gid) sid2gid_alloc_recv, state); } -static void sid2gid_alloc_recv(void *private, BOOL success, gid_t gid) +static void sid2gid_alloc_recv(void *private_data, BOOL success, gid_t gid) { struct sid2gid_state *state = - talloc_get_type_abort(private, struct sid2gid_state); + talloc_get_type_abort(private_data, struct sid2gid_state); if (!success) { DEBUG(5, ("Could not allocate gid\n")); - state->cont(state->private, False, 0); + state->cont(state->private_data, False, 0); return; } - state->cont(state->private, True, gid); + state->cont(state->private_data, True, gid); } -static void sid2gid_name2gid_recv(void *private, BOOL success, gid_t gid) +static void sid2gid_name2gid_recv(void *private_data, BOOL success, gid_t gid) { struct sid2gid_state *state = - talloc_get_type_abort(private, struct sid2gid_state); + talloc_get_type_abort(private_data, struct sid2gid_state); unid_t id; if (!success) { DEBUG(5, ("Could not find gid for name %s\n", state->groupname)); - state->cont(state->private, False, 0); + state->cont(state->private_data, False, 0); return; } @@ -1352,52 +1352,51 @@ static void sid2gid_name2gid_recv(void *private, BOOL success, gid_t gid) sid2gid_set_mapping_recv, state); } -static void sid2gid_set_mapping_recv(void *private, BOOL success) +static void sid2gid_set_mapping_recv(void *private_data, BOOL success) { struct sid2gid_state *state = - talloc_get_type_abort(private, struct sid2gid_state); + talloc_get_type_abort(private_data, struct sid2gid_state); if (!success) { DEBUG(5, ("Could not set ID mapping for sid %s\n", sid_string_static(&state->sid))); - state->cont(state->private, False, 0); + state->cont(state->private_data, False, 0); return; } - state->cont(state->private, True, state->gid); + state->cont(state->private_data, True, state->gid); } static void query_user_recv(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, - void *c, void *private) + void *c, void *private_data) { void (*cont)(void *priv, BOOL succ, const char *acct_name, const char *full_name, uint32 group_rid) = c; if (!success) { DEBUG(5, ("Could not trigger query_user\n")); - cont(private, False, NULL, NULL, -1); + cont(private_data, False, NULL, NULL, -1); return; } - cont(private, True, response->data.user_info.acct_name, + cont(private_data, True, response->data.user_info.acct_name, response->data.user_info.full_name, response->data.user_info.group_rid); } void query_user_async(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain, const DOM_SID *sid, - void (*cont)(void *private, BOOL success, + void (*cont)(void *private_data, BOOL success, const char *acct_name, const char *full_name, uint32 group_rid), - void *private) + void *private_data) { struct winbindd_request request; ZERO_STRUCT(request); request.cmd = WINBINDD_DUAL_USERINFO; sid_to_string(request.data.sid, sid); do_async_domain(mem_ctx, domain, &request, query_user_recv, - cont, private); + cont, private_data); } - diff --git a/source3/nsswitch/winbindd_dual.c b/source3/nsswitch/winbindd_dual.c index 2b0ce8c14d..46b3ce2258 100644 --- a/source3/nsswitch/winbindd_dual.c +++ b/source3/nsswitch/winbindd_dual.c @@ -259,19 +259,19 @@ struct winbindd_async_request { struct winbindd_child *child; struct winbindd_request *request; struct winbindd_response *response; - void (*continuation)(void *private, BOOL success); - void *private; + void (*continuation)(void *private_data, BOOL success); + void *private_data; }; -static void async_request_sent(void *private, BOOL success); -static void async_reply_recv(void *private, BOOL success); +static void async_request_sent(void *private_data, BOOL success); +static void async_reply_recv(void *private_data, BOOL success); static void schedule_async_request(struct winbindd_child *child); void async_request(TALLOC_CTX *mem_ctx, struct winbindd_child *child, struct winbindd_request *request, struct winbindd_response *response, - void (*continuation)(void *private, BOOL success), - void *private) + void (*continuation)(void *private_data, BOOL success), + void *private_data) { struct winbindd_async_request *state, *tmp; @@ -281,7 +281,7 @@ void async_request(TALLOC_CTX *mem_ctx, struct winbindd_child *child, if (state == NULL) { DEBUG(0, ("talloc failed\n")); - continuation(private, False); + continuation(private_data, False); return; } @@ -290,7 +290,7 @@ void async_request(TALLOC_CTX *mem_ctx, struct winbindd_child *child, state->request = request; state->response = response; state->continuation = continuation; - state->private = private; + state->private_data = private_data; DLIST_ADD_END(child->requests, state, tmp); @@ -299,17 +299,17 @@ void async_request(TALLOC_CTX *mem_ctx, struct winbindd_child *child, return; } -static void async_request_sent(void *private, BOOL success) +static void async_request_sent(void *private_data, BOOL success) { struct winbindd_async_request *state = - talloc_get_type_abort(private, struct winbindd_async_request); + talloc_get_type_abort(private_data, struct winbindd_async_request); if (!success) { DEBUG(5, ("Could not send async request\n")); state->response->length = sizeof(struct winbindd_response); state->response->result = WINBINDD_ERROR; - state->continuation(state->private, False); + state->continuation(state->private_data, False); return; } @@ -321,10 +321,10 @@ static void async_request_sent(void *private, BOOL success) async_reply_recv, state); } -static void async_reply_recv(void *private, BOOL success) +static void async_reply_recv(void *private_data, BOOL success) { struct winbindd_async_request *state = - talloc_get_type_abort(private, struct winbindd_async_request); + talloc_get_type_abort(private_data, struct winbindd_async_request); struct winbindd_child *child = state->child; state->response->length = sizeof(struct winbindd_response); @@ -343,7 +343,7 @@ static void async_reply_recv(void *private, BOOL success) schedule_async_request(child); - state->continuation(state->private, True); + state->continuation(state->private_data, True); } static BOOL fork_domain_child(struct winbindd_child *child); @@ -366,7 +366,7 @@ static void schedule_async_request(struct winbindd_child *child) while (request != NULL) { /* request might be free'd in the continuation */ struct winbindd_async_request *next = request->next; - request->continuation(request->private, False); + request->continuation(request->private_data, False); request = next; } return; @@ -383,31 +383,31 @@ struct domain_request_state { struct winbindd_domain *domain; struct winbindd_request *request; struct winbindd_response *response; - void (*continuation)(void *private, BOOL success); - void *private; + void (*continuation)(void *private_data, BOOL success); + void *private_data; }; -static void domain_init_recv(void *private, BOOL success); +static void domain_init_recv(void *private_data, BOOL success); void async_domain_request(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain, struct winbindd_request *request, struct winbindd_response *response, - void (*continuation)(void *private, BOOL success), - void *private) + void (*continuation)(void *private_data, BOOL success), + void *private_data) { struct domain_request_state *state; if (domain->initialized) { async_request(mem_ctx, &domain->child, request, response, - continuation, private); + continuation, private_data); return; } state = TALLOC_P(mem_ctx, struct domain_request_state); if (state == NULL) { DEBUG(0, ("talloc failed\n")); - continuation(private, False); + continuation(private_data, False); return; } @@ -416,15 +416,15 @@ void async_domain_request(TALLOC_CTX *mem_ctx, state->request = request; state->response = response; state->continuation = continuation; - state->private = private; + state->private_data = private_data; init_child_connection(domain, domain_init_recv, state); } -static void recvfrom_child(void *private, BOOL success) +static void recvfrom_child(void *private_data, BOOL success) { struct winbindd_cli_state *state = - talloc_get_type_abort(private, struct winbindd_cli_state); + talloc_get_type_abort(private_data, struct winbindd_cli_state); enum winbindd_result result = state->response.result; /* This is an optimization: The child has written directly to the @@ -456,20 +456,20 @@ void sendto_domain(struct winbindd_cli_state *state, recvfrom_child, state); } -static void domain_init_recv(void *private, BOOL success) +static void domain_init_recv(void *private_data, BOOL success) { struct domain_request_state *state = - talloc_get_type_abort(private, struct domain_request_state); + talloc_get_type_abort(private_data, struct domain_request_state); if (!success) { DEBUG(5, ("Domain init returned an error\n")); - state->continuation(state->private, False); + state->continuation(state->private_data, False); return; } async_request(state->mem_ctx, &state->domain->child, state->request, state->response, - state->continuation, state->private); + state->continuation, state->private_data); } struct winbindd_child_dispatch_table { diff --git a/source3/nsswitch/winbindd_group.c b/source3/nsswitch/winbindd_group.c index 65ae0bbf25..eb2adde98b 100644 --- a/source3/nsswitch/winbindd_group.c +++ b/source3/nsswitch/winbindd_group.c @@ -905,11 +905,11 @@ struct getgroups_state { int num_token_gids; }; -static void getgroups_usersid_recv(void *private, BOOL success, +static void getgroups_usersid_recv(void *private_data, BOOL success, const DOM_SID *sid, enum SID_NAME_USE type); -static void getgroups_tokensids_recv(void *private, BOOL success, +static void getgroups_tokensids_recv(void *private_data, BOOL success, DOM_SID *token_sids, int num_token_sids); -static void getgroups_sid2gid_recv(void *private, BOOL success, gid_t gid); +static void getgroups_sid2gid_recv(void *private_data, BOOL success, gid_t gid); void winbindd_getgroups(struct winbindd_cli_state *state) { @@ -967,10 +967,10 @@ void winbindd_getgroups(struct winbindd_cli_state *state) getgroups_usersid_recv, s); } -static void getgroups_usersid_recv(void *private, BOOL success, +static void getgroups_usersid_recv(void *private_data, BOOL success, const DOM_SID *sid, enum SID_NAME_USE type) { - struct getgroups_state *s = private; + struct getgroups_state *s = private_data; if ((!success) || ((type != SID_NAME_USER) && (type != SID_NAME_COMPUTER))) { @@ -984,10 +984,10 @@ static void getgroups_usersid_recv(void *private, BOOL success, getgroups_tokensids_recv, s); } -static void getgroups_tokensids_recv(void *private, BOOL success, +static void getgroups_tokensids_recv(void *private_data, BOOL success, DOM_SID *token_sids, int num_token_sids) { - struct getgroups_state *s = private; + struct getgroups_state *s = private_data; /* We need at least the user sid and the primary group in the token, * otherwise it's an error */ @@ -1007,9 +1007,9 @@ static void getgroups_tokensids_recv(void *private, BOOL success, getgroups_sid2gid_recv(s, False, 0); } -static void getgroups_sid2gid_recv(void *private, BOOL success, gid_t gid) +static void getgroups_sid2gid_recv(void *private_data, BOOL success, gid_t gid) { - struct getgroups_state *s = private; + struct getgroups_state *s = private_data; if (success) add_gid_to_array_unique(NULL, gid, @@ -1048,7 +1048,7 @@ static void getgroups_sid2gid_recv(void *private, BOOL success, gid_t gid) results. */ -static void getusersids_recv(void *private, BOOL success, DOM_SID *sids, +static void getusersids_recv(void *private_data, BOOL success, DOM_SID *sids, int num_sids); void winbindd_getusersids(struct winbindd_cli_state *state) @@ -1076,10 +1076,10 @@ void winbindd_getusersids(struct winbindd_cli_state *state) state); } -static void getusersids_recv(void *private, BOOL success, DOM_SID *sids, +static void getusersids_recv(void *private_data, BOOL success, DOM_SID *sids, int num_sids) { - struct winbindd_cli_state *state = private; + struct winbindd_cli_state *state = private_data; char *ret = NULL; unsigned ofs, ret_size = 0; int i; diff --git a/source3/nsswitch/winbindd_misc.c b/source3/nsswitch/winbindd_misc.c index 7a02c8f629..6f72a0e2c6 100644 --- a/source3/nsswitch/winbindd_misc.c +++ b/source3/nsswitch/winbindd_misc.c @@ -219,7 +219,7 @@ struct sequence_state { char *extra_data; }; -static void sequence_recv(void *private, BOOL success); +static void sequence_recv(void *private_data, BOOL success); void winbindd_show_sequence(struct winbindd_cli_state *state) { @@ -279,9 +279,9 @@ void winbindd_show_sequence(struct winbindd_cli_state *state) sequence_recv, seq); } -static void sequence_recv(void *private, BOOL success) +static void sequence_recv(void *private_data, BOOL success) { - struct sequence_state *state = private; + struct sequence_state *state = private_data; uint32 seq = DOM_SEQUENCE_NONE; if ((success) && (state->response->result == WINBINDD_OK)) @@ -345,7 +345,7 @@ struct domain_info_state { struct winbindd_cli_state *cli_state; }; -static void domain_info_init_recv(void *private, BOOL success); +static void domain_info_init_recv(void *private_data, BOOL success); void winbindd_domain_info(struct winbindd_cli_state *state) { @@ -400,9 +400,9 @@ void winbindd_domain_info(struct winbindd_cli_state *state) request_ok(state); } -static void domain_info_init_recv(void *private, BOOL success) +static void domain_info_init_recv(void *private_data, BOOL success) { - struct domain_info_state *istate = private; + struct domain_info_state *istate = private_data; struct winbindd_cli_state *state = istate->cli_state; struct winbindd_domain *domain = istate->domain; diff --git a/source3/nsswitch/winbindd_sid.c b/source3/nsswitch/winbindd_sid.c index 9bad2a6d41..2685e98555 100644 --- a/source3/nsswitch/winbindd_sid.c +++ b/source3/nsswitch/winbindd_sid.c @@ -28,7 +28,7 @@ /* Convert a string */ -static void lookupsid_recv(void *private, BOOL success, +static void lookupsid_recv(void *private_data, BOOL success, const char *dom_name, const char *name, enum SID_NAME_USE type); @@ -51,12 +51,12 @@ void winbindd_lookupsid(struct winbindd_cli_state *state) winbindd_lookupsid_async(state->mem_ctx, &sid, lookupsid_recv, state); } -static void lookupsid_recv(void *private, BOOL success, +static void lookupsid_recv(void *private_data, BOOL success, const char *dom_name, const char *name, enum SID_NAME_USE type) { struct winbindd_cli_state *state = - talloc_get_type_abort(private, struct winbindd_cli_state); + talloc_get_type_abort(private_data, struct winbindd_cli_state); if (!success) { DEBUG(5, ("lookupsid returned an error\n")); @@ -74,7 +74,7 @@ static void lookupsid_recv(void *private, BOOL success, * Look up the SID for a qualified name. **/ -static void lookupname_recv(void *private, BOOL success, +static void lookupname_recv(void *private_data, BOOL success, const DOM_SID *sid, enum SID_NAME_USE type); void winbindd_lookupname(struct winbindd_cli_state *state) @@ -106,11 +106,11 @@ void winbindd_lookupname(struct winbindd_cli_state *state) lookupname_recv, state); } -static void lookupname_recv(void *private, BOOL success, +static void lookupname_recv(void *private_data, BOOL success, const DOM_SID *sid, enum SID_NAME_USE type) { struct winbindd_cli_state *state = - talloc_get_type_abort(private, struct winbindd_cli_state); + talloc_get_type_abort(private_data, struct winbindd_cli_state); if (!success) { DEBUG(5, ("lookupname returned an error\n")); @@ -139,7 +139,7 @@ struct winbindd_child *idmap_child(void) /* Convert a sid to a uid. We assume we only have one rid attached to the sid. */ -static void sid2uid_recv(void *private, BOOL success, uid_t uid); +static void sid2uid_recv(void *private_data, BOOL success, uid_t uid); void winbindd_sid_to_uid(struct winbindd_cli_state *state) { @@ -178,10 +178,10 @@ void winbindd_sid_to_uid(struct winbindd_cli_state *state) winbindd_sid2uid_async(state->mem_ctx, &sid, sid2uid_recv, state); } -static void sid2uid_recv(void *private, BOOL success, uid_t uid) +static void sid2uid_recv(void *private_data, BOOL success, uid_t uid) { struct winbindd_cli_state *state = - talloc_get_type_abort(private, struct winbindd_cli_state); + talloc_get_type_abort(private_data, struct winbindd_cli_state); if (!success) { DEBUG(5, ("Could not convert sid %s\n", @@ -197,7 +197,7 @@ static void sid2uid_recv(void *private, BOOL success, uid_t uid) /* Convert a sid to a gid. We assume we only have one rid attached to the sid.*/ -static void sid2gid_recv(void *private, BOOL success, gid_t gid); +static void sid2gid_recv(void *private_data, BOOL success, gid_t gid); void winbindd_sid_to_gid(struct winbindd_cli_state *state) { @@ -236,10 +236,10 @@ void winbindd_sid_to_gid(struct winbindd_cli_state *state) winbindd_sid2gid_async(state->mem_ctx, &sid, sid2gid_recv, state); } -static void sid2gid_recv(void *private, BOOL success, gid_t gid) +static void sid2gid_recv(void *private_data, BOOL success, gid_t gid) { struct winbindd_cli_state *state = - talloc_get_type_abort(private, struct winbindd_cli_state); + talloc_get_type_abort(private_data, struct winbindd_cli_state); if (!success) { DEBUG(5, ("Could not convert sid %s\n", @@ -262,12 +262,12 @@ struct uid2sid_state { enum SID_NAME_USE type; }; -static void uid2sid_uid2name_recv(void *private, BOOL success, +static void uid2sid_uid2name_recv(void *private_data, BOOL success, const char *username); -static void uid2sid_lookupname_recv(void *private, BOOL success, +static void uid2sid_lookupname_recv(void *private_data, BOOL success, const DOM_SID *sid, enum SID_NAME_USE type); -static void uid2sid_idmap_set_mapping_recv(void *private, BOOL success); +static void uid2sid_idmap_set_mapping_recv(void *private_data, BOOL success); void winbindd_uid_to_sid(struct winbindd_cli_state *state) { @@ -326,11 +326,11 @@ void winbindd_uid_to_sid(struct winbindd_cli_state *state) uid2sid_uid2name_recv, uid2sid_state); } -static void uid2sid_uid2name_recv(void *private, BOOL success, +static void uid2sid_uid2name_recv(void *private_data, BOOL success, const char *username) { struct uid2sid_state *state = - talloc_get_type_abort(private, struct uid2sid_state); + talloc_get_type_abort(private_data, struct uid2sid_state); DEBUG(10, ("uid2sid: uid %lu has name %s\n", (unsigned long)state->uid, username)); @@ -347,11 +347,11 @@ static void uid2sid_uid2name_recv(void *private, BOOL success, uid2sid_lookupname_recv, state); } -static void uid2sid_lookupname_recv(void *private, BOOL success, +static void uid2sid_lookupname_recv(void *private_data, BOOL success, const DOM_SID *sid, enum SID_NAME_USE type) { struct uid2sid_state *state = - talloc_get_type_abort(private, struct uid2sid_state); + talloc_get_type_abort(private_data, struct uid2sid_state); unid_t id; if ((!success) || (type != SID_NAME_USER)) { @@ -367,10 +367,10 @@ static void uid2sid_lookupname_recv(void *private, BOOL success, uid2sid_idmap_set_mapping_recv, state ); } -static void uid2sid_idmap_set_mapping_recv(void *private, BOOL success) +static void uid2sid_idmap_set_mapping_recv(void *private_data, BOOL success) { struct uid2sid_state *state = - talloc_get_type_abort(private, struct uid2sid_state); + talloc_get_type_abort(private_data, struct uid2sid_state); /* don't fail if we can't store it */ @@ -389,12 +389,12 @@ struct gid2sid_state { enum SID_NAME_USE type; }; -static void gid2sid_gid2name_recv(void *private, BOOL success, +static void gid2sid_gid2name_recv(void *private_data, BOOL success, const char *groupname); -static void gid2sid_lookupname_recv(void *private, BOOL success, +static void gid2sid_lookupname_recv(void *private_data, BOOL success, const DOM_SID *sid, enum SID_NAME_USE type); -static void gid2sid_idmap_set_mapping_recv(void *private, BOOL success); +static void gid2sid_idmap_set_mapping_recv(void *private_data, BOOL success); void winbindd_gid_to_sid(struct winbindd_cli_state *state) { @@ -453,11 +453,11 @@ void winbindd_gid_to_sid(struct winbindd_cli_state *state) gid2sid_gid2name_recv, gid2sid_state); } -static void gid2sid_gid2name_recv(void *private, BOOL success, +static void gid2sid_gid2name_recv(void *private_data, BOOL success, const char *username) { struct gid2sid_state *state = - talloc_get_type_abort(private, struct gid2sid_state); + talloc_get_type_abort(private_data, struct gid2sid_state); DEBUG(10, ("gid2sid: gid %lu has name %s\n", (unsigned long)state->gid, username)); @@ -474,11 +474,11 @@ static void gid2sid_gid2name_recv(void *private, BOOL success, gid2sid_lookupname_recv, state); } -static void gid2sid_lookupname_recv(void *private, BOOL success, +static void gid2sid_lookupname_recv(void *private_data, BOOL success, const DOM_SID *sid, enum SID_NAME_USE type) { struct gid2sid_state *state = - talloc_get_type_abort(private, struct gid2sid_state); + talloc_get_type_abort(private_data, struct gid2sid_state); unid_t id; if ((!success) || @@ -495,9 +495,9 @@ static void gid2sid_lookupname_recv(void *private, BOOL success, gid2sid_idmap_set_mapping_recv, state ); } -static void gid2sid_idmap_set_mapping_recv(void *private, BOOL success) +static void gid2sid_idmap_set_mapping_recv(void *private_data, BOOL success) { - struct gid2sid_state *state = private; + struct gid2sid_state *state = private_data; /* don't fail if we can't store it */ diff --git a/source3/nsswitch/winbindd_user.c b/source3/nsswitch/winbindd_user.c index 82ab79eb4c..576ceaea23 100644 --- a/source3/nsswitch/winbindd_user.c +++ b/source3/nsswitch/winbindd_user.c @@ -157,11 +157,11 @@ struct getpwsid_state { gid_t gid; }; -static void getpwsid_queryuser_recv(void *private, BOOL success, +static void getpwsid_queryuser_recv(void *private_data, BOOL success, const char *acct_name, const char *full_name, uint32 group_rid); -static void getpwsid_sid2uid_recv(void *private, BOOL success, uid_t uid); -static void getpwsid_sid2gid_recv(void *private, BOOL success, gid_t gid); +static void getpwsid_sid2uid_recv(void *private_data, BOOL success, uid_t uid); +static void getpwsid_sid2gid_recv(void *private_data, BOOL success, gid_t gid); static void winbindd_getpwsid(struct winbindd_cli_state *state, const DOM_SID *sid) @@ -192,12 +192,12 @@ static void winbindd_getpwsid(struct winbindd_cli_state *state, request_error(state); } -static void getpwsid_queryuser_recv(void *private, BOOL success, +static void getpwsid_queryuser_recv(void *private_data, BOOL success, const char *acct_name, const char *full_name, uint32 group_rid) { struct getpwsid_state *s = - talloc_get_type_abort(private, struct getpwsid_state); + talloc_get_type_abort(private_data, struct getpwsid_state); if (!success) { DEBUG(5, ("Could not query user %s\\%s\n", s->domain->name, @@ -215,10 +215,10 @@ static void getpwsid_queryuser_recv(void *private, BOOL success, getpwsid_sid2uid_recv, s); } -static void getpwsid_sid2uid_recv(void *private, BOOL success, uid_t uid) +static void getpwsid_sid2uid_recv(void *private_data, BOOL success, uid_t uid) { struct getpwsid_state *s = - talloc_get_type_abort(private, struct getpwsid_state); + talloc_get_type_abort(private_data, struct getpwsid_state); if (!success) { DEBUG(5, ("Could not query user's %s\\%s uid\n", @@ -232,10 +232,10 @@ static void getpwsid_sid2uid_recv(void *private, BOOL success, uid_t uid) getpwsid_sid2gid_recv, s); } -static void getpwsid_sid2gid_recv(void *private, BOOL success, gid_t gid) +static void getpwsid_sid2gid_recv(void *private_data, BOOL success, gid_t gid) { struct getpwsid_state *s = - talloc_get_type_abort(private, struct getpwsid_state); + talloc_get_type_abort(private_data, struct getpwsid_state); struct winbindd_pw *pw; fstring output_username; char *homedir; @@ -297,7 +297,7 @@ static void getpwsid_sid2gid_recv(void *private, BOOL success, gid_t gid) /* Return a password structure from a username. */ -static void getpwnam_name2sid_recv(void *private, BOOL success, +static void getpwnam_name2sid_recv(void *private_data, BOOL success, const DOM_SID *sid, enum SID_NAME_USE type); void winbindd_getpwnam(struct winbindd_cli_state *state) @@ -343,10 +343,10 @@ void winbindd_getpwnam(struct winbindd_cli_state *state) getpwnam_name2sid_recv, state); } -static void getpwnam_name2sid_recv(void *private, BOOL success, +static void getpwnam_name2sid_recv(void *private_data, BOOL success, const DOM_SID *sid, enum SID_NAME_USE type) { - struct winbindd_cli_state *state = private; + struct winbindd_cli_state *state = private_data; if (!success) { DEBUG(5, ("Could not lookup name for user %s\n", diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c index 21ae4611c2..2be1520250 100644 --- a/source3/nsswitch/winbindd_util.c +++ b/source3/nsswitch/winbindd_util.c @@ -177,7 +177,7 @@ struct trustdom_state { struct winbindd_response *response; }; -static void trustdom_recv(void *private, BOOL success); +static void trustdom_recv(void *private_data, BOOL success); static void add_trusted_domains( struct winbindd_domain *domain ) { @@ -213,11 +213,11 @@ static void add_trusted_domains( struct winbindd_domain *domain ) trustdom_recv, state); } -static void trustdom_recv(void *private, BOOL success) +static void trustdom_recv(void *private_data, BOOL success) { extern struct winbindd_methods cache_methods; struct trustdom_state *state = - talloc_get_type_abort(private, struct trustdom_state); + talloc_get_type_abort(private_data, struct trustdom_state); struct winbindd_response *response = state->response; char *p; @@ -311,17 +311,17 @@ struct init_child_state { struct winbindd_domain *domain; struct winbindd_request *request; struct winbindd_response *response; - void (*continuation)(void *private, BOOL success); - void *private; + void (*continuation)(void *private_data, BOOL success); + void *private_data; }; -static void init_child_recv(void *private, BOOL success); -static void init_child_getdc_recv(void *private, BOOL success); +static void init_child_recv(void *private_data, BOOL success); +static void init_child_getdc_recv(void *private_data, BOOL success); enum winbindd_result init_child_connection(struct winbindd_domain *domain, - void (*continuation)(void *private, + void (*continuation)(void *private_data, BOOL success), - void *private) + void *private_data) { TALLOC_CTX *mem_ctx; struct winbindd_request *request; @@ -340,7 +340,7 @@ enum winbindd_result init_child_connection(struct winbindd_domain *domain, if ((request == NULL) || (response == NULL) || (state == NULL)) { DEBUG(0, ("talloc failed\n")); - continuation(private, False); + continuation(private_data, False); return WINBINDD_ERROR; } @@ -351,7 +351,7 @@ enum winbindd_result init_child_connection(struct winbindd_domain *domain, state->request = request; state->response = response; state->continuation = continuation; - state->private = private; + state->private_data = private_data; if (domain->primary) { /* The primary domain has to find the DC name itself */ @@ -376,10 +376,10 @@ enum winbindd_result init_child_connection(struct winbindd_domain *domain, return WINBINDD_PENDING; } -static void init_child_getdc_recv(void *private, BOOL success) +static void init_child_getdc_recv(void *private_data, BOOL success) { struct init_child_state *state = - talloc_get_type_abort(private, struct init_child_state); + talloc_get_type_abort(private_data, struct init_child_state); const char *dcname = ""; DEBUG(10, ("Received getdcname response\n")); @@ -398,17 +398,17 @@ static void init_child_getdc_recv(void *private, BOOL success) init_child_recv, state); } -static void init_child_recv(void *private, BOOL success) +static void init_child_recv(void *private_data, BOOL success) { struct init_child_state *state = - talloc_get_type_abort(private, struct init_child_state); + talloc_get_type_abort(private_data, struct init_child_state); DEBUG(5, ("Received child initialization response for domain %s\n", state->domain->name)); if ((!success) || (state->response->result != WINBINDD_OK)) { DEBUG(3, ("Could not init child\n")); - state->continuation(state->private, False); + state->continuation(state->private_data, False); talloc_destroy(state->mem_ctx); return; } @@ -429,7 +429,7 @@ static void init_child_recv(void *private, BOOL success) state->domain->initialized = 1; if (state->continuation != NULL) - state->continuation(state->private, True); + state->continuation(state->private_data, True); talloc_destroy(state->mem_ctx); } diff --git a/source3/nsswitch/winbindd_wins.c b/source3/nsswitch/winbindd_wins.c index 2e03becd5a..2cb835b373 100644 --- a/source3/nsswitch/winbindd_wins.c +++ b/source3/nsswitch/winbindd_wins.c @@ -65,12 +65,12 @@ static int wins_lookup_open_socket_in(void) } -static struct node_status *lookup_byaddr_backend(char *addr, int *count) +static NODE_STATUS_STRUCT *lookup_byaddr_backend(char *addr, int *count) { int fd; struct in_addr ip; struct nmb_name nname; - struct node_status *status; + NODE_STATUS_STRUCT *status; fd = wins_lookup_open_socket_in(); if (fd == -1) @@ -136,7 +136,7 @@ void winbindd_wins_byip(struct winbindd_cli_state *state) { fstring response; int i, count, maxlen, size; - struct node_status *status; + NODE_STATUS_STRUCT *status; /* Ensure null termination */ state->request.data.winsreq[sizeof(state->request.data.winsreq)-1]='\0'; diff --git a/source3/nsswitch/wins.c b/source3/nsswitch/wins.c index 8d26fc5297..6d4f6cfa26 100644 --- a/source3/nsswitch/wins.c +++ b/source3/nsswitch/wins.c @@ -128,12 +128,12 @@ static struct in_addr *lookup_byname_backend(const char *name, int *count) #ifdef HAVE_NS_API_H -static struct node_status *lookup_byaddr_backend(char *addr, int *count) +static NODE_STATUS_STRUCT *lookup_byaddr_backend(char *addr, int *count) { int fd; struct in_addr ip; struct nmb_name nname; - struct node_status *status; + NODE_STATUS_STRUCT *status; if (!initialised) { nss_wins_init(); @@ -166,7 +166,7 @@ int lookup(nsd_file_t *rq) char *key; char *addr; struct in_addr *ip_list; - struct node_status *status; + NODE_STATUS_STRUCT *status; int i, count, len, size; char response[1024]; BOOL found = False; diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index fd0154d275..2456304261 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1338,7 +1338,7 @@ static void init_globals(void) if ((parm_table[i].type == P_STRING || parm_table[i].type == P_USTRING) && parm_table[i].ptr) - string_set(parm_table[i].ptr, ""); + string_set((char **)parm_table[i].ptr, ""); string_set(&sDefault.fstype, FSTYPE_STRING); @@ -2272,12 +2272,12 @@ static void free_service(service *pservice) for (i = 0; parm_table[i].label; i++) { if ((parm_table[i].type == P_STRING || parm_table[i].type == P_USTRING) && - parm_table[i].class == P_LOCAL) + parm_table[i].p_class == P_LOCAL) string_free((char **) (((char *)pservice) + PTR_DIFF(parm_table[i].ptr, &sDefault))); else if (parm_table[i].type == P_LIST && - parm_table[i].class == P_LOCAL) + parm_table[i].p_class == P_LOCAL) str_list_free((char ***) (((char *)pservice) + PTR_DIFF(parm_table[i].ptr, &sDefault))); @@ -2541,7 +2541,7 @@ void show_parameter_list(void) for ( classIndex=0; section_names[classIndex]; classIndex++) { printf("[%s]\n", section_names[classIndex]); for (parmIndex = 0; parm_table[parmIndex].label; parmIndex++) { - if (parm_table[parmIndex].class == classIndex) { + if (parm_table[parmIndex].p_class == classIndex) { printf("%s=%s", parm_table[parmIndex].label, type[parm_table[parmIndex].type]); @@ -2632,7 +2632,7 @@ static void copy_service(service * pserviceDest, service * pserviceSource, BOOL BOOL not_added; for (i = 0; parm_table[i].label; i++) - if (parm_table[i].ptr && parm_table[i].class == P_LOCAL && + if (parm_table[i].ptr && parm_table[i].p_class == P_LOCAL && (bcopyall || pcopymapDest[i])) { void *def_ptr = parm_table[i].ptr; void *src_ptr = @@ -2659,12 +2659,12 @@ static void copy_service(service * pserviceDest, service * pserviceSource, BOOL break; case P_STRING: - string_set(dest_ptr, + string_set((char **)dest_ptr, *(char **)src_ptr); break; case P_USTRING: - string_set(dest_ptr, + string_set((char **)dest_ptr, *(char **)src_ptr); strupper_m(*(char **)dest_ptr); break; @@ -3268,7 +3268,7 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue if (snum < 0) { parm_ptr = def_ptr; } else { - if (parm_table[parmnum].class == P_GLOBAL) { + if (parm_table[parmnum].p_class == P_GLOBAL) { DEBUG(0, ("Global parameter %s found in service section!\n", pszParmName)); @@ -3300,11 +3300,11 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue switch (parm_table[parmnum].type) { case P_BOOL: - set_boolean(parm_ptr, pszParmValue); + set_boolean((BOOL *)parm_ptr, pszParmValue); break; case P_BOOLREV: - set_boolean(parm_ptr, pszParmValue); + set_boolean((BOOL *)parm_ptr, pszParmValue); *(BOOL *)parm_ptr = !*(BOOL *)parm_ptr; break; @@ -3321,16 +3321,16 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue break; case P_LIST: - str_list_free(parm_ptr); + str_list_free((char ***)parm_ptr); *(char ***)parm_ptr = str_list_make(pszParmValue, NULL); break; case P_STRING: - string_set(parm_ptr, pszParmValue); + string_set((char **)parm_ptr, pszParmValue); break; case P_USTRING: - string_set(parm_ptr, pszParmValue); + string_set((char **)parm_ptr, pszParmValue); strupper_m(*(char **)parm_ptr); break; @@ -3598,7 +3598,7 @@ static void dump_globals(FILE *f) fprintf(f, "[global]\n"); for (i = 0; parm_table[i].label; i++) - if (parm_table[i].class == P_GLOBAL && + if (parm_table[i].p_class == P_GLOBAL && parm_table[i].ptr && (i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr))) { if (defaults_saved && is_default(i)) @@ -3644,7 +3644,7 @@ static void dump_a_service(service * pService, FILE * f) for (i = 0; parm_table[i].label; i++) { - if (parm_table[i].class == P_LOCAL && + if (parm_table[i].p_class == P_LOCAL && parm_table[i].ptr && (*parm_table[i].label != '-') && (i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr))) @@ -3688,18 +3688,18 @@ BOOL dump_a_parameter(int snum, char *parm_name, FILE * f, BOOL isGlobal) { service * pService = ServicePtrs[snum]; int i, result = False; - parm_class class; + parm_class p_class; unsigned flag = 0; if (isGlobal) { - class = P_GLOBAL; + p_class = P_GLOBAL; flag = FLAG_GLOBAL; } else - class = P_LOCAL; + p_class = P_LOCAL; for (i = 0; parm_table[i].label; i++) { if (strwicmp(parm_table[i].label, parm_name) == 0 && - (parm_table[i].class == class || parm_table[i].flags & flag) && + (parm_table[i].p_class == p_class || parm_table[i].flags & flag) && parm_table[i].ptr && (*parm_table[i].label != '-') && (i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr))) @@ -3733,7 +3733,7 @@ struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters) if (snum < 0) { /* do the globals */ for (; parm_table[*i].label; (*i)++) { - if (parm_table[*i].class == P_SEPARATOR) + if (parm_table[*i].p_class == P_SEPARATOR) return &parm_table[(*i)++]; if (!parm_table[*i].ptr @@ -3751,10 +3751,10 @@ struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters) service *pService = ServicePtrs[snum]; for (; parm_table[*i].label; (*i)++) { - if (parm_table[*i].class == P_SEPARATOR) + if (parm_table[*i].p_class == P_SEPARATOR) return &parm_table[(*i)++]; - if (parm_table[*i].class == P_LOCAL && + if (parm_table[*i].p_class == P_LOCAL && parm_table[*i].ptr && (*parm_table[*i].label != '-') && ((*i) == 0 || @@ -3795,7 +3795,7 @@ static void dump_copy_map(BOOL *pcopymap) printf("\n\tNon-Copied parameters:\n"); for (i = 0; parm_table[i].label; i++) - if (parm_table[i].class == P_LOCAL && + if (parm_table[i].p_class == P_LOCAL && parm_table[i].ptr && !pcopymap[i] && (i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr))) { diff --git a/source3/param/params.c b/source3/param/params.c index 3b736113be..2a6c8b3e65 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -264,7 +264,7 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(const char *) ) if( i > (bSize - 2) ) { char *tb; - tb = SMB_REALLOC( bufr, bSize +BUFR_INC ); + tb = (char *)SMB_REALLOC( bufr, bSize +BUFR_INC ); if( NULL == tb ) { DEBUG(0, ("%s Memory re-allocation failure.", func) ); return False; @@ -356,7 +356,7 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *) /* Loop until we've found the start of the value. */ if( i > (bSize - 2) ) { /* Ensure there's space for next char. */ - char *tb = SMB_REALLOC( bufr, bSize + BUFR_INC ); + char *tb = (char *)SMB_REALLOC( bufr, bSize + BUFR_INC ); if( NULL == tb ) { DEBUG(0, ("%s Memory re-allocation failure.", func) ); return False; @@ -414,7 +414,7 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *) while( (EOF !=c) && (c > 0) ) { if( i > (bSize - 2) ) { /* Make sure there's enough room. */ - char *tb = SMB_REALLOC( bufr, bSize + BUFR_INC ); + char *tb = (char *)SMB_REALLOC( bufr, bSize + BUFR_INC ); if( NULL == tb ) { DEBUG(0, ("%s Memory re-allocation failure.", func)); return False; diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index 1dd8893c1c..283eb7f1c1 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -52,7 +52,7 @@ const char *get_default_sam_name(void) void pdb_fill_default_sam(SAM_ACCOUNT *user) { - ZERO_STRUCT(user->private); /* Don't touch the talloc context */ + ZERO_STRUCT(user->private_u); /* Don't touch the talloc context */ /* no initial methods */ user->methods = NULL; @@ -60,36 +60,36 @@ void pdb_fill_default_sam(SAM_ACCOUNT *user) /* Don't change these timestamp settings without a good reason. They are important for NT member server compatibility. */ - user->private.logon_time = (time_t)0; - user->private.pass_last_set_time = (time_t)0; - user->private.pass_can_change_time = (time_t)0; - user->private.logoff_time = - user->private.kickoff_time = - user->private.pass_must_change_time = get_time_t_max(); - user->private.fields_present = 0x00ffffff; - user->private.logon_divs = 168; /* hours per week */ - user->private.hours_len = 21; /* 21 times 8 bits = 168 */ - memset(user->private.hours, 0xff, user->private.hours_len); /* available at all hours */ - user->private.bad_password_count = 0; - user->private.logon_count = 0; - user->private.unknown_6 = 0x000004ec; /* don't know */ + user->private_u.logon_time = (time_t)0; + user->private_u.pass_last_set_time = (time_t)0; + user->private_u.pass_can_change_time = (time_t)0; + user->private_u.logoff_time = + user->private_u.kickoff_time = + user->private_u.pass_must_change_time = get_time_t_max(); + user->private_u.fields_present = 0x00ffffff; + user->private_u.logon_divs = 168; /* hours per week */ + user->private_u.hours_len = 21; /* 21 times 8 bits = 168 */ + memset(user->private_u.hours, 0xff, user->private_u.hours_len); /* available at all hours */ + user->private_u.bad_password_count = 0; + user->private_u.logon_count = 0; + user->private_u.unknown_6 = 0x000004ec; /* don't know */ /* Some parts of samba strlen their pdb_get...() returns, so this keeps the interface unchanged for now. */ - user->private.username = ""; - user->private.domain = ""; - user->private.nt_username = ""; - user->private.full_name = ""; - user->private.home_dir = ""; - user->private.logon_script = ""; - user->private.profile_path = ""; - user->private.acct_desc = ""; - user->private.workstations = ""; - user->private.unknown_str = ""; - user->private.munged_dial = ""; - - user->private.plaintext_pw = NULL; + user->private_u.username = ""; + user->private_u.domain = ""; + user->private_u.nt_username = ""; + user->private_u.full_name = ""; + user->private_u.home_dir = ""; + user->private_u.logon_script = ""; + user->private_u.profile_path = ""; + user->private_u.acct_desc = ""; + user->private_u.workstations = ""; + user->private_u.unknown_str = ""; + user->private_u.munged_dial = ""; + + user->private_u.plaintext_pw = NULL; /* Unless we know otherwise have a Account Control Bit @@ -97,17 +97,17 @@ void pdb_fill_default_sam(SAM_ACCOUNT *user) asks for a filtered list of users. */ - user->private.acct_ctrl = ACB_NORMAL; + user->private_u.acct_ctrl = ACB_NORMAL; } static void destroy_pdb_talloc(SAM_ACCOUNT **user) { if (*user) { - data_blob_clear_free(&((*user)->private.lm_pw)); - data_blob_clear_free(&((*user)->private.nt_pw)); + data_blob_clear_free(&((*user)->private_u.lm_pw)); + data_blob_clear_free(&((*user)->private_u.nt_pw)); - if((*user)->private.plaintext_pw!=NULL) - memset((*user)->private.plaintext_pw,'\0',strlen((*user)->private.plaintext_pw)); + if((*user)->private_u.plaintext_pw!=NULL) + memset((*user)->private_u.plaintext_pw,'\0',strlen((*user)->private_u.plaintext_pw)); talloc_destroy((*user)->mem_ctx); *user = NULL; } @@ -396,13 +396,13 @@ static void pdb_free_sam_contents(SAM_ACCOUNT *user) /* Kill off sensitive data. Free()ed by the talloc mechinism */ - data_blob_clear_free(&(user->private.lm_pw)); - data_blob_clear_free(&(user->private.nt_pw)); - if (user->private.plaintext_pw!=NULL) - memset(user->private.plaintext_pw,'\0',strlen(user->private.plaintext_pw)); + data_blob_clear_free(&(user->private_u.lm_pw)); + data_blob_clear_free(&(user->private_u.nt_pw)); + if (user->private_u.plaintext_pw!=NULL) + memset(user->private_u.plaintext_pw,'\0',strlen(user->private_u.plaintext_pw)); - if (user->private.backend_private_data && user->private.backend_private_data_free_fn) { - user->private.backend_private_data_free_fn(&user->private.backend_private_data); + if (user->private_u.backend_private_data && user->private_u.backend_private_data_free_fn) { + user->private_u.backend_private_data_free_fn(&user->private_u.backend_private_data); } } diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c index 99afac133a..12e8bcc9cf 100644 --- a/source3/passdb/pdb_get_set.c +++ b/source3/passdb/pdb_get_set.c @@ -43,7 +43,7 @@ uint16 pdb_get_acct_ctrl (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.acct_ctrl); + return (sampass->private_u.acct_ctrl); else return (ACB_DISABLED); } @@ -51,7 +51,7 @@ uint16 pdb_get_acct_ctrl (const SAM_ACCOUNT *sampass) time_t pdb_get_logon_time (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.logon_time); + return (sampass->private_u.logon_time); else return (0); } @@ -59,7 +59,7 @@ time_t pdb_get_logon_time (const SAM_ACCOUNT *sampass) time_t pdb_get_logoff_time (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.logoff_time); + return (sampass->private_u.logoff_time); else return (-1); } @@ -67,7 +67,7 @@ time_t pdb_get_logoff_time (const SAM_ACCOUNT *sampass) time_t pdb_get_kickoff_time (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.kickoff_time); + return (sampass->private_u.kickoff_time); else return (-1); } @@ -75,7 +75,7 @@ time_t pdb_get_kickoff_time (const SAM_ACCOUNT *sampass) time_t pdb_get_bad_password_time (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.bad_password_time); + return (sampass->private_u.bad_password_time); else return (-1); } @@ -83,7 +83,7 @@ time_t pdb_get_bad_password_time (const SAM_ACCOUNT *sampass) time_t pdb_get_pass_last_set_time (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.pass_last_set_time); + return (sampass->private_u.pass_last_set_time); else return (-1); } @@ -91,7 +91,7 @@ time_t pdb_get_pass_last_set_time (const SAM_ACCOUNT *sampass) time_t pdb_get_pass_can_change_time (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.pass_can_change_time); + return (sampass->private_u.pass_can_change_time); else return (-1); } @@ -99,7 +99,7 @@ time_t pdb_get_pass_can_change_time (const SAM_ACCOUNT *sampass) time_t pdb_get_pass_must_change_time (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.pass_must_change_time); + return (sampass->private_u.pass_must_change_time); else return (-1); } @@ -107,7 +107,7 @@ time_t pdb_get_pass_must_change_time (const SAM_ACCOUNT *sampass) uint16 pdb_get_logon_divs (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.logon_divs); + return (sampass->private_u.logon_divs); else return (-1); } @@ -115,7 +115,7 @@ uint16 pdb_get_logon_divs (const SAM_ACCOUNT *sampass) uint32 pdb_get_hours_len (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.hours_len); + return (sampass->private_u.hours_len); else return (-1); } @@ -123,7 +123,7 @@ uint32 pdb_get_hours_len (const SAM_ACCOUNT *sampass) const uint8* pdb_get_hours (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.hours); + return (sampass->private_u.hours); else return (NULL); } @@ -131,9 +131,9 @@ const uint8* pdb_get_hours (const SAM_ACCOUNT *sampass) const uint8* pdb_get_nt_passwd (const SAM_ACCOUNT *sampass) { if (sampass) { - SMB_ASSERT((!sampass->private.nt_pw.data) - || sampass->private.nt_pw.length == NT_HASH_LEN); - return ((uint8*)sampass->private.nt_pw.data); + SMB_ASSERT((!sampass->private_u.nt_pw.data) + || sampass->private_u.nt_pw.length == NT_HASH_LEN); + return ((uint8*)sampass->private_u.nt_pw.data); } else return (NULL); @@ -142,9 +142,9 @@ const uint8* pdb_get_nt_passwd (const SAM_ACCOUNT *sampass) const uint8* pdb_get_lanman_passwd (const SAM_ACCOUNT *sampass) { if (sampass) { - SMB_ASSERT((!sampass->private.lm_pw.data) - || sampass->private.lm_pw.length == LM_HASH_LEN); - return ((uint8*)sampass->private.lm_pw.data); + SMB_ASSERT((!sampass->private_u.lm_pw.data) + || sampass->private_u.lm_pw.length == LM_HASH_LEN); + return ((uint8*)sampass->private_u.lm_pw.data); } else return (NULL); @@ -153,10 +153,10 @@ const uint8* pdb_get_lanman_passwd (const SAM_ACCOUNT *sampass) const uint8* pdb_get_pw_history (const SAM_ACCOUNT *sampass, uint32 *current_hist_len) { if (sampass) { - SMB_ASSERT((!sampass->private.nt_pw_his.data) - || ((sampass->private.nt_pw_his.length % PW_HISTORY_ENTRY_LEN) == 0)); - *current_hist_len = sampass->private.nt_pw_his.length / PW_HISTORY_ENTRY_LEN; - return ((uint8*)sampass->private.nt_pw_his.data); + SMB_ASSERT((!sampass->private_u.nt_pw_his.data) + || ((sampass->private_u.nt_pw_his.length % PW_HISTORY_ENTRY_LEN) == 0)); + *current_hist_len = sampass->private_u.nt_pw_his.length / PW_HISTORY_ENTRY_LEN; + return ((uint8*)sampass->private_u.nt_pw_his.data); } else { *current_hist_len = 0; return (NULL); @@ -172,7 +172,7 @@ const uint8* pdb_get_pw_history (const SAM_ACCOUNT *sampass, uint32 *current_his const char* pdb_get_plaintext_passwd (const SAM_ACCOUNT *sampass) { if (sampass) { - return (sampass->private.plaintext_pw); + return (sampass->private_u.plaintext_pw); } else return (NULL); @@ -180,7 +180,7 @@ const char* pdb_get_plaintext_passwd (const SAM_ACCOUNT *sampass) const DOM_SID *pdb_get_user_sid(const SAM_ACCOUNT *sampass) { if (sampass) - return &sampass->private.user_sid; + return &sampass->private_u.user_sid; else return (NULL); } @@ -188,7 +188,7 @@ const DOM_SID *pdb_get_user_sid(const SAM_ACCOUNT *sampass) const DOM_SID *pdb_get_group_sid(const SAM_ACCOUNT *sampass) { if (sampass) - return &sampass->private.group_sid; + return &sampass->private_u.group_sid; else return (NULL); } @@ -203,15 +203,15 @@ enum pdb_value_state pdb_get_init_flags (const SAM_ACCOUNT *sampass, enum pdb_el { enum pdb_value_state ret = PDB_DEFAULT; - if (!sampass || !sampass->private.change_flags || !sampass->private.set_flags) + if (!sampass || !sampass->private_u.change_flags || !sampass->private_u.set_flags) return ret; - if (bitmap_query(sampass->private.set_flags, element)) { + if (bitmap_query(sampass->private_u.set_flags, element)) { DEBUG(11, ("element %d: SET\n", element)); ret = PDB_SET; } - if (bitmap_query(sampass->private.change_flags, element)) { + if (bitmap_query(sampass->private_u.change_flags, element)) { DEBUG(11, ("element %d: CHANGED\n", element)); ret = PDB_CHANGED; } @@ -226,7 +226,7 @@ enum pdb_value_state pdb_get_init_flags (const SAM_ACCOUNT *sampass, enum pdb_el const char* pdb_get_username (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.username); + return (sampass->private_u.username); else return (NULL); } @@ -234,7 +234,7 @@ const char* pdb_get_username (const SAM_ACCOUNT *sampass) const char* pdb_get_domain (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.domain); + return (sampass->private_u.domain); else return (NULL); } @@ -242,7 +242,7 @@ const char* pdb_get_domain (const SAM_ACCOUNT *sampass) const char* pdb_get_nt_username (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.nt_username); + return (sampass->private_u.nt_username); else return (NULL); } @@ -250,7 +250,7 @@ const char* pdb_get_nt_username (const SAM_ACCOUNT *sampass) const char* pdb_get_fullname (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.full_name); + return (sampass->private_u.full_name); else return (NULL); } @@ -258,7 +258,7 @@ const char* pdb_get_fullname (const SAM_ACCOUNT *sampass) const char* pdb_get_homedir (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.home_dir); + return (sampass->private_u.home_dir); else return (NULL); } @@ -266,7 +266,7 @@ const char* pdb_get_homedir (const SAM_ACCOUNT *sampass) const char* pdb_get_unix_homedir (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.unix_home_dir); + return (sampass->private_u.unix_home_dir); else return (NULL); } @@ -274,7 +274,7 @@ const char* pdb_get_unix_homedir (const SAM_ACCOUNT *sampass) const char* pdb_get_dir_drive (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.dir_drive); + return (sampass->private_u.dir_drive); else return (NULL); } @@ -282,7 +282,7 @@ const char* pdb_get_dir_drive (const SAM_ACCOUNT *sampass) const char* pdb_get_logon_script (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.logon_script); + return (sampass->private_u.logon_script); else return (NULL); } @@ -290,7 +290,7 @@ const char* pdb_get_logon_script (const SAM_ACCOUNT *sampass) const char* pdb_get_profile_path (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.profile_path); + return (sampass->private_u.profile_path); else return (NULL); } @@ -298,7 +298,7 @@ const char* pdb_get_profile_path (const SAM_ACCOUNT *sampass) const char* pdb_get_acct_desc (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.acct_desc); + return (sampass->private_u.acct_desc); else return (NULL); } @@ -306,7 +306,7 @@ const char* pdb_get_acct_desc (const SAM_ACCOUNT *sampass) const char* pdb_get_workstations (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.workstations); + return (sampass->private_u.workstations); else return (NULL); } @@ -314,7 +314,7 @@ const char* pdb_get_workstations (const SAM_ACCOUNT *sampass) const char* pdb_get_unknown_str (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.unknown_str); + return (sampass->private_u.unknown_str); else return (NULL); } @@ -322,7 +322,7 @@ const char* pdb_get_unknown_str (const SAM_ACCOUNT *sampass) const char* pdb_get_munged_dial (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.munged_dial); + return (sampass->private_u.munged_dial); else return (NULL); } @@ -330,7 +330,7 @@ const char* pdb_get_munged_dial (const SAM_ACCOUNT *sampass) uint16 pdb_get_bad_password_count(const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.bad_password_count); + return (sampass->private_u.bad_password_count); else return 0; } @@ -338,7 +338,7 @@ uint16 pdb_get_bad_password_count(const SAM_ACCOUNT *sampass) uint16 pdb_get_logon_count(const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.logon_count); + return (sampass->private_u.logon_count); else return 0; } @@ -346,15 +346,15 @@ uint16 pdb_get_logon_count(const SAM_ACCOUNT *sampass) uint32 pdb_get_unknown_6 (const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.unknown_6); + return (sampass->private_u.unknown_6); else return (-1); } void *pdb_get_backend_private_data (const SAM_ACCOUNT *sampass, const struct pdb_methods *my_methods) { - if (sampass && my_methods == sampass->private.backend_private_methods) - return sampass->private.backend_private_data; + if (sampass && my_methods == sampass->private_u.backend_private_methods) + return sampass->private_u.backend_private_data; else return NULL; } @@ -368,7 +368,7 @@ BOOL pdb_set_acct_ctrl (SAM_ACCOUNT *sampass, uint16 acct_ctrl, enum pdb_value_s if (!sampass) return False; - sampass->private.acct_ctrl = acct_ctrl; + sampass->private_u.acct_ctrl = acct_ctrl; return pdb_set_init_flags(sampass, PDB_ACCTCTRL, flag); } @@ -378,7 +378,7 @@ BOOL pdb_set_logon_time (SAM_ACCOUNT *sampass, time_t mytime, enum pdb_value_sta if (!sampass) return False; - sampass->private.logon_time = mytime; + sampass->private_u.logon_time = mytime; return pdb_set_init_flags(sampass, PDB_LOGONTIME, flag); } @@ -388,7 +388,7 @@ BOOL pdb_set_logoff_time (SAM_ACCOUNT *sampass, time_t mytime, enum pdb_value_st if (!sampass) return False; - sampass->private.logoff_time = mytime; + sampass->private_u.logoff_time = mytime; return pdb_set_init_flags(sampass, PDB_LOGOFFTIME, flag); } @@ -398,7 +398,7 @@ BOOL pdb_set_kickoff_time (SAM_ACCOUNT *sampass, time_t mytime, enum pdb_value_s if (!sampass) return False; - sampass->private.kickoff_time = mytime; + sampass->private_u.kickoff_time = mytime; return pdb_set_init_flags(sampass, PDB_KICKOFFTIME, flag); } @@ -409,7 +409,7 @@ BOOL pdb_set_bad_password_time (SAM_ACCOUNT *sampass, time_t mytime, if (!sampass) return False; - sampass->private.bad_password_time = mytime; + sampass->private_u.bad_password_time = mytime; return pdb_set_init_flags(sampass, PDB_BAD_PASSWORD_TIME, flag); } @@ -419,7 +419,7 @@ BOOL pdb_set_pass_can_change_time (SAM_ACCOUNT *sampass, time_t mytime, enum pdb if (!sampass) return False; - sampass->private.pass_can_change_time = mytime; + sampass->private_u.pass_can_change_time = mytime; return pdb_set_init_flags(sampass, PDB_CANCHANGETIME, flag); } @@ -429,7 +429,7 @@ BOOL pdb_set_pass_must_change_time (SAM_ACCOUNT *sampass, time_t mytime, enum pd if (!sampass) return False; - sampass->private.pass_must_change_time = mytime; + sampass->private_u.pass_must_change_time = mytime; return pdb_set_init_flags(sampass, PDB_MUSTCHANGETIME, flag); } @@ -439,7 +439,7 @@ BOOL pdb_set_pass_last_set_time (SAM_ACCOUNT *sampass, time_t mytime, enum pdb_v if (!sampass) return False; - sampass->private.pass_last_set_time = mytime; + sampass->private_u.pass_last_set_time = mytime; return pdb_set_init_flags(sampass, PDB_PASSLASTSET, flag); } @@ -449,7 +449,7 @@ BOOL pdb_set_hours_len (SAM_ACCOUNT *sampass, uint32 len, enum pdb_value_state f if (!sampass) return False; - sampass->private.hours_len = len; + sampass->private_u.hours_len = len; return pdb_set_init_flags(sampass, PDB_HOURSLEN, flag); } @@ -459,7 +459,7 @@ BOOL pdb_set_logon_divs (SAM_ACCOUNT *sampass, uint16 hours, enum pdb_value_stat if (!sampass) return False; - sampass->private.logon_divs = hours; + sampass->private_u.logon_divs = hours; return pdb_set_init_flags(sampass, PDB_LOGONDIVS, flag); } @@ -476,16 +476,16 @@ BOOL pdb_set_init_flags (SAM_ACCOUNT *sampass, enum pdb_elements element, enum p if (!sampass || !sampass->mem_ctx) return False; - if (!sampass->private.set_flags) { - if ((sampass->private.set_flags = + if (!sampass->private_u.set_flags) { + if ((sampass->private_u.set_flags = bitmap_talloc(sampass->mem_ctx, PDB_COUNT))==NULL) { DEBUG(0,("bitmap_talloc failed\n")); return False; } } - if (!sampass->private.change_flags) { - if ((sampass->private.change_flags = + if (!sampass->private_u.change_flags) { + if ((sampass->private_u.change_flags = bitmap_talloc(sampass->mem_ctx, PDB_COUNT))==NULL) { DEBUG(0,("bitmap_talloc failed\n")); @@ -495,22 +495,22 @@ BOOL pdb_set_init_flags (SAM_ACCOUNT *sampass, enum pdb_elements element, enum p switch(value_flag) { case PDB_CHANGED: - if (!bitmap_set(sampass->private.change_flags, element)) { + if (!bitmap_set(sampass->private_u.change_flags, element)) { DEBUG(0,("Can't set flag: %d in change_flags.\n",element)); return False; } - if (!bitmap_set(sampass->private.set_flags, element)) { + if (!bitmap_set(sampass->private_u.set_flags, element)) { DEBUG(0,("Can't set flag: %d in set_flags.\n",element)); return False; } DEBUG(11, ("element %d -> now CHANGED\n", element)); break; case PDB_SET: - if (!bitmap_clear(sampass->private.change_flags, element)) { + if (!bitmap_clear(sampass->private_u.change_flags, element)) { DEBUG(0,("Can't set flag: %d in change_flags.\n",element)); return False; } - if (!bitmap_set(sampass->private.set_flags, element)) { + if (!bitmap_set(sampass->private_u.set_flags, element)) { DEBUG(0,("Can't set flag: %d in set_flags.\n",element)); return False; } @@ -518,11 +518,11 @@ BOOL pdb_set_init_flags (SAM_ACCOUNT *sampass, enum pdb_elements element, enum p break; case PDB_DEFAULT: default: - if (!bitmap_clear(sampass->private.change_flags, element)) { + if (!bitmap_clear(sampass->private_u.change_flags, element)) { DEBUG(0,("Can't set flag: %d in change_flags.\n",element)); return False; } - if (!bitmap_clear(sampass->private.set_flags, element)) { + if (!bitmap_clear(sampass->private_u.set_flags, element)) { DEBUG(0,("Can't set flag: %d in set_flags.\n",element)); return False; } @@ -538,10 +538,10 @@ BOOL pdb_set_user_sid (SAM_ACCOUNT *sampass, const DOM_SID *u_sid, enum pdb_valu if (!sampass || !u_sid) return False; - sid_copy(&sampass->private.user_sid, u_sid); + sid_copy(&sampass->private_u.user_sid, u_sid); DEBUG(10, ("pdb_set_user_sid: setting user sid %s\n", - sid_string_static(&sampass->private.user_sid))); + sid_string_static(&sampass->private_u.user_sid))); return pdb_set_init_flags(sampass, PDB_USERSID, flag); } @@ -574,10 +574,10 @@ BOOL pdb_set_group_sid (SAM_ACCOUNT *sampass, const DOM_SID *g_sid, enum pdb_val if (!sampass || !g_sid) return False; - sid_copy(&sampass->private.group_sid, g_sid); + sid_copy(&sampass->private_u.group_sid, g_sid); DEBUG(10, ("pdb_set_group_sid: setting group sid %s\n", - sid_string_static(&sampass->private.group_sid))); + sid_string_static(&sampass->private_u.group_sid))); return pdb_set_init_flags(sampass, PDB_GROUPSID, flag); } @@ -614,17 +614,17 @@ BOOL pdb_set_username(SAM_ACCOUNT *sampass, const char *username, enum pdb_value if (username) { DEBUG(10, ("pdb_set_username: setting username %s, was %s\n", username, - (sampass->private.username)?(sampass->private.username):"NULL")); + (sampass->private_u.username)?(sampass->private_u.username):"NULL")); - sampass->private.username = talloc_strdup(sampass->mem_ctx, username); + sampass->private_u.username = talloc_strdup(sampass->mem_ctx, username); - if (!sampass->private.username) { + if (!sampass->private_u.username) { DEBUG(0, ("pdb_set_username: talloc_strdup() failed!\n")); return False; } } else { - sampass->private.username = PDB_NOT_QUITE_NULL; + sampass->private_u.username = PDB_NOT_QUITE_NULL; } return pdb_set_init_flags(sampass, PDB_USERNAME, flag); @@ -641,17 +641,17 @@ BOOL pdb_set_domain(SAM_ACCOUNT *sampass, const char *domain, enum pdb_value_sta if (domain) { DEBUG(10, ("pdb_set_domain: setting domain %s, was %s\n", domain, - (sampass->private.domain)?(sampass->private.domain):"NULL")); + (sampass->private_u.domain)?(sampass->private_u.domain):"NULL")); - sampass->private.domain = talloc_strdup(sampass->mem_ctx, domain); + sampass->private_u.domain = talloc_strdup(sampass->mem_ctx, domain); - if (!sampass->private.domain) { + if (!sampass->private_u.domain) { DEBUG(0, ("pdb_set_domain: talloc_strdup() failed!\n")); return False; } } else { - sampass->private.domain = PDB_NOT_QUITE_NULL; + sampass->private_u.domain = PDB_NOT_QUITE_NULL; } return pdb_set_init_flags(sampass, PDB_DOMAIN, flag); @@ -668,17 +668,17 @@ BOOL pdb_set_nt_username(SAM_ACCOUNT *sampass, const char *nt_username, enum pdb if (nt_username) { DEBUG(10, ("pdb_set_nt_username: setting nt username %s, was %s\n", nt_username, - (sampass->private.nt_username)?(sampass->private.nt_username):"NULL")); + (sampass->private_u.nt_username)?(sampass->private_u.nt_username):"NULL")); - sampass->private.nt_username = talloc_strdup(sampass->mem_ctx, nt_username); + sampass->private_u.nt_username = talloc_strdup(sampass->mem_ctx, nt_username); - if (!sampass->private.nt_username) { + if (!sampass->private_u.nt_username) { DEBUG(0, ("pdb_set_nt_username: talloc_strdup() failed!\n")); return False; } } else { - sampass->private.nt_username = PDB_NOT_QUITE_NULL; + sampass->private_u.nt_username = PDB_NOT_QUITE_NULL; } return pdb_set_init_flags(sampass, PDB_NTUSERNAME, flag); @@ -695,17 +695,17 @@ BOOL pdb_set_fullname(SAM_ACCOUNT *sampass, const char *full_name, enum pdb_valu if (full_name) { DEBUG(10, ("pdb_set_full_name: setting full name %s, was %s\n", full_name, - (sampass->private.full_name)?(sampass->private.full_name):"NULL")); + (sampass->private_u.full_name)?(sampass->private_u.full_name):"NULL")); - sampass->private.full_name = talloc_strdup(sampass->mem_ctx, full_name); + sampass->private_u.full_name = talloc_strdup(sampass->mem_ctx, full_name); - if (!sampass->private.full_name) { + if (!sampass->private_u.full_name) { DEBUG(0, ("pdb_set_fullname: talloc_strdup() failed!\n")); return False; } } else { - sampass->private.full_name = PDB_NOT_QUITE_NULL; + sampass->private_u.full_name = PDB_NOT_QUITE_NULL; } return pdb_set_init_flags(sampass, PDB_FULLNAME, flag); @@ -722,17 +722,17 @@ BOOL pdb_set_logon_script(SAM_ACCOUNT *sampass, const char *logon_script, enum p if (logon_script) { DEBUG(10, ("pdb_set_logon_script: setting logon script %s, was %s\n", logon_script, - (sampass->private.logon_script)?(sampass->private.logon_script):"NULL")); + (sampass->private_u.logon_script)?(sampass->private_u.logon_script):"NULL")); - sampass->private.logon_script = talloc_strdup(sampass->mem_ctx, logon_script); + sampass->private_u.logon_script = talloc_strdup(sampass->mem_ctx, logon_script); - if (!sampass->private.logon_script) { + if (!sampass->private_u.logon_script) { DEBUG(0, ("pdb_set_logon_script: talloc_strdup() failed!\n")); return False; } } else { - sampass->private.logon_script = PDB_NOT_QUITE_NULL; + sampass->private_u.logon_script = PDB_NOT_QUITE_NULL; } return pdb_set_init_flags(sampass, PDB_LOGONSCRIPT, flag); @@ -749,17 +749,17 @@ BOOL pdb_set_profile_path (SAM_ACCOUNT *sampass, const char *profile_path, enum if (profile_path) { DEBUG(10, ("pdb_set_profile_path: setting profile path %s, was %s\n", profile_path, - (sampass->private.profile_path)?(sampass->private.profile_path):"NULL")); + (sampass->private_u.profile_path)?(sampass->private_u.profile_path):"NULL")); - sampass->private.profile_path = talloc_strdup(sampass->mem_ctx, profile_path); + sampass->private_u.profile_path = talloc_strdup(sampass->mem_ctx, profile_path); - if (!sampass->private.profile_path) { + if (!sampass->private_u.profile_path) { DEBUG(0, ("pdb_set_profile_path: talloc_strdup() failed!\n")); return False; } } else { - sampass->private.profile_path = PDB_NOT_QUITE_NULL; + sampass->private_u.profile_path = PDB_NOT_QUITE_NULL; } return pdb_set_init_flags(sampass, PDB_PROFILE, flag); @@ -776,17 +776,17 @@ BOOL pdb_set_dir_drive (SAM_ACCOUNT *sampass, const char *dir_drive, enum pdb_va if (dir_drive) { DEBUG(10, ("pdb_set_dir_drive: setting dir drive %s, was %s\n", dir_drive, - (sampass->private.dir_drive)?(sampass->private.dir_drive):"NULL")); + (sampass->private_u.dir_drive)?(sampass->private_u.dir_drive):"NULL")); - sampass->private.dir_drive = talloc_strdup(sampass->mem_ctx, dir_drive); + sampass->private_u.dir_drive = talloc_strdup(sampass->mem_ctx, dir_drive); - if (!sampass->private.dir_drive) { + if (!sampass->private_u.dir_drive) { DEBUG(0, ("pdb_set_dir_drive: talloc_strdup() failed!\n")); return False; } } else { - sampass->private.dir_drive = PDB_NOT_QUITE_NULL; + sampass->private_u.dir_drive = PDB_NOT_QUITE_NULL; } return pdb_set_init_flags(sampass, PDB_DRIVE, flag); @@ -803,17 +803,17 @@ BOOL pdb_set_homedir (SAM_ACCOUNT *sampass, const char *home_dir, enum pdb_value if (home_dir) { DEBUG(10, ("pdb_set_homedir: setting home dir %s, was %s\n", home_dir, - (sampass->private.home_dir)?(sampass->private.home_dir):"NULL")); + (sampass->private_u.home_dir)?(sampass->private_u.home_dir):"NULL")); - sampass->private.home_dir = talloc_strdup(sampass->mem_ctx, home_dir); + sampass->private_u.home_dir = talloc_strdup(sampass->mem_ctx, home_dir); - if (!sampass->private.home_dir) { + if (!sampass->private_u.home_dir) { DEBUG(0, ("pdb_set_home_dir: talloc_strdup() failed!\n")); return False; } } else { - sampass->private.home_dir = PDB_NOT_QUITE_NULL; + sampass->private_u.home_dir = PDB_NOT_QUITE_NULL; } return pdb_set_init_flags(sampass, PDB_SMBHOME, flag); @@ -830,18 +830,18 @@ BOOL pdb_set_unix_homedir (SAM_ACCOUNT *sampass, const char *unix_home_dir, enum if (unix_home_dir) { DEBUG(10, ("pdb_set_unix_homedir: setting home dir %s, was %s\n", unix_home_dir, - (sampass->private.unix_home_dir)?(sampass->private.unix_home_dir):"NULL")); + (sampass->private_u.unix_home_dir)?(sampass->private_u.unix_home_dir):"NULL")); - sampass->private.unix_home_dir = talloc_strdup(sampass->mem_ctx, + sampass->private_u.unix_home_dir = talloc_strdup(sampass->mem_ctx, unix_home_dir); - if (!sampass->private.unix_home_dir) { + if (!sampass->private_u.unix_home_dir) { DEBUG(0, ("pdb_set_unix_home_dir: talloc_strdup() failed!\n")); return False; } } else { - sampass->private.unix_home_dir = PDB_NOT_QUITE_NULL; + sampass->private_u.unix_home_dir = PDB_NOT_QUITE_NULL; } return pdb_set_init_flags(sampass, PDB_UNIXHOMEDIR, flag); @@ -857,15 +857,15 @@ BOOL pdb_set_acct_desc (SAM_ACCOUNT *sampass, const char *acct_desc, enum pdb_va return False; if (acct_desc) { - sampass->private.acct_desc = talloc_strdup(sampass->mem_ctx, acct_desc); + sampass->private_u.acct_desc = talloc_strdup(sampass->mem_ctx, acct_desc); - if (!sampass->private.acct_desc) { + if (!sampass->private_u.acct_desc) { DEBUG(0, ("pdb_set_acct_desc: talloc_strdup() failed!\n")); return False; } } else { - sampass->private.acct_desc = PDB_NOT_QUITE_NULL; + sampass->private_u.acct_desc = PDB_NOT_QUITE_NULL; } return pdb_set_init_flags(sampass, PDB_ACCTDESC, flag); @@ -882,17 +882,17 @@ BOOL pdb_set_workstations (SAM_ACCOUNT *sampass, const char *workstations, enum if (workstations) { DEBUG(10, ("pdb_set_workstations: setting workstations %s, was %s\n", workstations, - (sampass->private.workstations)?(sampass->private.workstations):"NULL")); + (sampass->private_u.workstations)?(sampass->private_u.workstations):"NULL")); - sampass->private.workstations = talloc_strdup(sampass->mem_ctx, workstations); + sampass->private_u.workstations = talloc_strdup(sampass->mem_ctx, workstations); - if (!sampass->private.workstations) { + if (!sampass->private_u.workstations) { DEBUG(0, ("pdb_set_workstations: talloc_strdup() failed!\n")); return False; } } else { - sampass->private.workstations = PDB_NOT_QUITE_NULL; + sampass->private_u.workstations = PDB_NOT_QUITE_NULL; } return pdb_set_init_flags(sampass, PDB_WORKSTATIONS, flag); @@ -908,15 +908,15 @@ BOOL pdb_set_unknown_str (SAM_ACCOUNT *sampass, const char *unknown_str, enum pd return False; if (unknown_str) { - sampass->private.unknown_str = talloc_strdup(sampass->mem_ctx, unknown_str); + sampass->private_u.unknown_str = talloc_strdup(sampass->mem_ctx, unknown_str); - if (!sampass->private.unknown_str) { + if (!sampass->private_u.unknown_str) { DEBUG(0, ("pdb_set_unknown_str: talloc_strdup() failed!\n")); return False; } } else { - sampass->private.unknown_str = PDB_NOT_QUITE_NULL; + sampass->private_u.unknown_str = PDB_NOT_QUITE_NULL; } return pdb_set_init_flags(sampass, PDB_UNKNOWNSTR, flag); @@ -932,15 +932,15 @@ BOOL pdb_set_munged_dial (SAM_ACCOUNT *sampass, const char *munged_dial, enum pd return False; if (munged_dial) { - sampass->private.munged_dial = talloc_strdup(sampass->mem_ctx, munged_dial); + sampass->private_u.munged_dial = talloc_strdup(sampass->mem_ctx, munged_dial); - if (!sampass->private.munged_dial) { + if (!sampass->private_u.munged_dial) { DEBUG(0, ("pdb_set_munged_dial: talloc_strdup() failed!\n")); return False; } } else { - sampass->private.munged_dial = PDB_NOT_QUITE_NULL; + sampass->private_u.munged_dial = PDB_NOT_QUITE_NULL; } return pdb_set_init_flags(sampass, PDB_MUNGEDDIAL, flag); @@ -955,12 +955,12 @@ BOOL pdb_set_nt_passwd (SAM_ACCOUNT *sampass, const uint8 pwd[NT_HASH_LEN], enum if (!sampass) return False; - data_blob_clear_free(&sampass->private.nt_pw); + data_blob_clear_free(&sampass->private_u.nt_pw); if (pwd) { - sampass->private.nt_pw = data_blob(pwd, NT_HASH_LEN); + sampass->private_u.nt_pw = data_blob(pwd, NT_HASH_LEN); } else { - sampass->private.nt_pw = data_blob(NULL, 0); + sampass->private_u.nt_pw = data_blob(NULL, 0); } return pdb_set_init_flags(sampass, PDB_NTPASSWD, flag); @@ -975,12 +975,12 @@ BOOL pdb_set_lanman_passwd (SAM_ACCOUNT *sampass, const uint8 pwd[LM_HASH_LEN], if (!sampass) return False; - data_blob_clear_free(&sampass->private.lm_pw); + data_blob_clear_free(&sampass->private_u.lm_pw); if (pwd) { - sampass->private.lm_pw = data_blob(pwd, LM_HASH_LEN); + sampass->private_u.lm_pw = data_blob(pwd, LM_HASH_LEN); } else { - sampass->private.lm_pw = data_blob(NULL, 0); + sampass->private_u.lm_pw = data_blob(NULL, 0); } return pdb_set_init_flags(sampass, PDB_LMPASSWD, flag); @@ -999,14 +999,14 @@ BOOL pdb_set_pw_history (SAM_ACCOUNT *sampass, const uint8 *pwd, uint32 historyL return False; if (historyLen && pwd){ - sampass->private.nt_pw_his = data_blob_talloc(sampass->mem_ctx, + sampass->private_u.nt_pw_his = data_blob_talloc(sampass->mem_ctx, pwd, historyLen*PW_HISTORY_ENTRY_LEN); - if (!sampass->private.nt_pw_his.length) { + if (!sampass->private_u.nt_pw_his.length) { DEBUG(0, ("pdb_set_pw_history: data_blob_talloc() failed!\n")); return False; } } else { - sampass->private.nt_pw_his = data_blob_talloc(sampass->mem_ctx, NULL, 0); + sampass->private_u.nt_pw_his = data_blob_talloc(sampass->mem_ctx, NULL, 0); } return pdb_set_init_flags(sampass, PDB_PWHISTORY, flag); @@ -1023,18 +1023,18 @@ BOOL pdb_set_plaintext_pw_only (SAM_ACCOUNT *sampass, const char *password, enum return False; if (password) { - if (sampass->private.plaintext_pw!=NULL) - memset(sampass->private.plaintext_pw,'\0',strlen(sampass->private.plaintext_pw)+1); + if (sampass->private_u.plaintext_pw!=NULL) + memset(sampass->private_u.plaintext_pw,'\0',strlen(sampass->private_u.plaintext_pw)+1); - sampass->private.plaintext_pw = talloc_strdup(sampass->mem_ctx, password); + sampass->private_u.plaintext_pw = talloc_strdup(sampass->mem_ctx, password); - if (!sampass->private.plaintext_pw) { + if (!sampass->private_u.plaintext_pw) { DEBUG(0, ("pdb_set_unknown_str: talloc_strdup() failed!\n")); return False; } } else { - sampass->private.plaintext_pw = NULL; + sampass->private_u.plaintext_pw = NULL; } return pdb_set_init_flags(sampass, PDB_PLAINTEXT_PW, flag); @@ -1045,7 +1045,7 @@ BOOL pdb_set_bad_password_count(SAM_ACCOUNT *sampass, uint16 bad_password_count, if (!sampass) return False; - sampass->private.bad_password_count = bad_password_count; + sampass->private_u.bad_password_count = bad_password_count; return pdb_set_init_flags(sampass, PDB_BAD_PASSWORD_COUNT, flag); } @@ -1055,7 +1055,7 @@ BOOL pdb_set_logon_count(SAM_ACCOUNT *sampass, uint16 logon_count, enum pdb_valu if (!sampass) return False; - sampass->private.logon_count = logon_count; + sampass->private_u.logon_count = logon_count; return pdb_set_init_flags(sampass, PDB_LOGON_COUNT, flag); } @@ -1065,7 +1065,7 @@ BOOL pdb_set_unknown_6 (SAM_ACCOUNT *sampass, uint32 unkn, enum pdb_value_state if (!sampass) return False; - sampass->private.unknown_6 = unkn; + sampass->private_u.unknown_6 = unkn; return pdb_set_init_flags(sampass, PDB_UNKNOWN6, flag); } @@ -1076,11 +1076,11 @@ BOOL pdb_set_hours (SAM_ACCOUNT *sampass, const uint8 *hours, enum pdb_value_sta return False; if (!hours) { - memset ((char *)sampass->private.hours, 0, MAX_HOURS_LEN); + memset ((char *)sampass->private_u.hours, 0, MAX_HOURS_LEN); return True; } - memcpy (sampass->private.hours, hours, MAX_HOURS_LEN); + memcpy (sampass->private_u.hours, hours, MAX_HOURS_LEN); return pdb_set_init_flags(sampass, PDB_HOURS, flag); } @@ -1093,13 +1093,13 @@ BOOL pdb_set_backend_private_data (SAM_ACCOUNT *sampass, void *private_data, if (!sampass) return False; - if (sampass->private.backend_private_data && sampass->private.backend_private_data_free_fn) { - sampass->private.backend_private_data_free_fn(&sampass->private.backend_private_data); + if (sampass->private_u.backend_private_data && sampass->private_u.backend_private_data_free_fn) { + sampass->private_u.backend_private_data_free_fn(&sampass->private_u.backend_private_data); } - sampass->private.backend_private_data = private_data; - sampass->private.backend_private_data_free_fn = free_fn; - sampass->private.backend_private_methods = my_methods; + sampass->private_u.backend_private_data = private_data; + sampass->private_u.backend_private_data_free_fn = free_fn; + sampass->private_u.backend_private_methods = my_methods; return pdb_set_init_flags(sampass, PDB_BACKEND_PRIVATE_DATA, flag); } diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index c6880b1d50..d4407492c2 100644 --- a/source3/passdb/pdb_interface.c +++ b/source3/passdb/pdb_interface.c @@ -1614,7 +1614,7 @@ struct user_search { static BOOL next_entry_users(struct pdb_search *s, struct samr_displayentry *entry) { - struct user_search *state = s->private; + struct user_search *state = s->private_data; SAM_ACCOUNT *user = NULL; NTSTATUS status; @@ -1677,7 +1677,7 @@ static BOOL pdb_default_search_users(struct pdb_methods *methods, state->acct_flags = acct_flags; - search->private = state; + search->private_data = state; search->next_entry = next_entry_users; search->search_end = search_end_users; return True; @@ -1691,7 +1691,7 @@ struct group_search { static BOOL next_entry_groups(struct pdb_search *s, struct samr_displayentry *entry) { - struct group_search *state = s->private; + struct group_search *state = s->private_data; uint32 rid; GROUP_MAP *map = &state->groups[state->current_group]; @@ -1709,7 +1709,7 @@ static BOOL next_entry_groups(struct pdb_search *s, static void search_end_groups(struct pdb_search *search) { - struct group_search *state = search->private; + struct group_search *state = search->private_data; SAFE_FREE(state->groups); } @@ -1731,7 +1731,7 @@ static BOOL pdb_search_grouptype(struct pdb_search *search, } state->current_group = 0; - search->private = state; + search->private_data = state; search->next_entry = next_entry_groups; search->search_end = search_end_groups; return True; diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index d688a04dc4..002ec70464 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -3387,7 +3387,7 @@ struct ldap_search_state { static BOOL ldapsam_search_firstpage(struct pdb_search *search) { - struct ldap_search_state *state = search->private; + struct ldap_search_state *state = search->private_data; LDAP *ld; int rc = LDAP_OPERATIONS_ERROR; @@ -3439,7 +3439,7 @@ static BOOL ldapsam_search_firstpage(struct pdb_search *search) static BOOL ldapsam_search_nextpage(struct pdb_search *search) { - struct ldap_search_state *state = search->private; + struct ldap_search_state *state = search->private_data; LDAP *ld = state->connection->ldap_struct; int rc; @@ -3470,7 +3470,7 @@ static BOOL ldapsam_search_nextpage(struct pdb_search *search) static BOOL ldapsam_search_next_entry(struct pdb_search *search, struct samr_displayentry *entry) { - struct ldap_search_state *state = search->private; + struct ldap_search_state *state = search->private_data; LDAP *ld = state->connection->ldap_struct; BOOL result; @@ -3506,7 +3506,7 @@ static BOOL ldapsam_search_next_entry(struct pdb_search *search, static void ldapsam_search_end(struct pdb_search *search) { - struct ldap_search_state *state = search->private; + struct ldap_search_state *state = search->private_data; int rc; if (state->pagedresults_cookie == NULL) @@ -3657,7 +3657,7 @@ static BOOL ldapsam_search_users(struct pdb_methods *methods, return False; } - search->private = state; + search->private_data = state; search->next_entry = ldapsam_search_next_entry; search->search_end = ldapsam_search_end; @@ -3764,7 +3764,7 @@ static BOOL ldapsam_search_grouptype(struct pdb_methods *methods, return False; } - search->private = state; + search->private_data = state; search->next_entry = ldapsam_search_next_entry; search->search_end = ldapsam_search_end; diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 2146448ae3..2796de835a 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -2095,13 +2095,13 @@ int pack_devicemode(NT_DEVICEMODE *nt_devmode, char *buf, int buflen) nt_devmode->reserved2, nt_devmode->panningwidth, nt_devmode->panningheight, - nt_devmode->private); + nt_devmode->nt_dev_private); - if (nt_devmode->private) { + if (nt_devmode->nt_dev_private) { len += tdb_pack(buf+len, buflen-len, "B", nt_devmode->driverextra, - nt_devmode->private); + nt_devmode->nt_dev_private); } DEBUG(8,("Packed devicemode [%s]\n", nt_devmode->formname)); @@ -2360,7 +2360,7 @@ NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename) nt_devmode->panningwidth = 0; nt_devmode->panningheight = 0; - nt_devmode->private = NULL; + nt_devmode->nt_dev_private = NULL; return nt_devmode; } @@ -2380,9 +2380,9 @@ NT_DEVICEMODE *dup_nt_devicemode(NT_DEVICEMODE *nt_devicemode) return NULL; } - new_nt_devicemode->private = NULL; - if (nt_devicemode->private != NULL) { - if ((new_nt_devicemode->private = memdup(nt_devicemode->private, nt_devicemode->driverextra)) == NULL) { + new_nt_devicemode->nt_dev_private = NULL; + if (nt_devicemode->nt_dev_private != NULL) { + if ((new_nt_devicemode->nt_dev_private = memdup(nt_devicemode->nt_dev_private, nt_devicemode->driverextra)) == NULL) { SAFE_FREE(new_nt_devicemode); DEBUG(0,("dup_nt_devicemode: malloc fail.\n")); return NULL; @@ -2405,7 +2405,7 @@ void free_nt_devicemode(NT_DEVICEMODE **devmode_ptr) DEBUG(106,("free_nt_devicemode: deleting DEVMODE\n")); - SAFE_FREE(nt_devmode->private); + SAFE_FREE(nt_devmode->nt_dev_private); SAFE_FREE(*devmode_ptr); } @@ -2491,25 +2491,25 @@ int unpack_devicemode(NT_DEVICEMODE **nt_devmode, char *buf, int buflen) &devmode.reserved2, &devmode.panningwidth, &devmode.panningheight, - &devmode.private); + &devmode.nt_dev_private); - if (devmode.private) { + if (devmode.nt_dev_private) { /* the len in tdb_unpack is an int value and * devmode.driverextra is only a short */ - len += tdb_unpack(buf+len, buflen-len, "B", &extra_len, &devmode.private); + len += tdb_unpack(buf+len, buflen-len, "B", &extra_len, &devmode.nt_dev_private); devmode.driverextra=(uint16)extra_len; /* check to catch an invalid TDB entry so we don't segfault */ if (devmode.driverextra == 0) { - devmode.private = NULL; + devmode.nt_dev_private = NULL; } } *nt_devmode = (NT_DEVICEMODE *)memdup(&devmode, sizeof(devmode)); DEBUG(8,("Unpacked devicemode [%s](%s)\n", devmode.devicename, devmode.formname)); - if (devmode.private) + if (devmode.nt_dev_private) DEBUG(8,("with a private section of %d bytes\n", devmode.driverextra)); return len; diff --git a/source3/python/py_winbind.c b/source3/python/py_winbind.c index 6482a5b9e3..2f22649bfb 100644 --- a/source3/python/py_winbind.c +++ b/source3/python/py_winbind.c @@ -30,7 +30,7 @@ PyObject *winbind_error; /* A winbind call returned WINBINDD_ERROR */ /* Prototypes from common.h */ -NSS_STATUS winbindd_request(int req_type, +NSS_STATUS winbindd_request_response(int req_type, struct winbindd_request *request, struct winbindd_response *response); @@ -66,7 +66,7 @@ static PyObject *py_name_to_sid(PyObject *self, PyObject *args) fstrcpy(request.data.name.name, name); } - if (winbindd_request(WINBINDD_LOOKUPNAME, &request, &response) + if (winbindd_request_response(WINBINDD_LOOKUPNAME, &request, &response) != NSS_STATUS_SUCCESS) { PyErr_SetString(winbind_error, "lookup failed"); return NULL; @@ -94,7 +94,7 @@ static PyObject *py_sid_to_name(PyObject *self, PyObject *args) fstrcpy(request.data.sid, sid); - if (winbindd_request(WINBINDD_LOOKUPSID, &request, &response) + if (winbindd_request_response(WINBINDD_LOOKUPSID, &request, &response) != NSS_STATUS_SUCCESS) { PyErr_SetString(winbind_error, "lookup failed"); return NULL; @@ -126,7 +126,7 @@ static PyObject *py_enum_domain_users(PyObject *self, PyObject *args) ZERO_STRUCT(response); - if (winbindd_request(WINBINDD_LIST_USERS, NULL, &response) + if (winbindd_request_response(WINBINDD_LIST_USERS, NULL, &response) != NSS_STATUS_SUCCESS) { PyErr_SetString(winbind_error, "lookup failed"); return NULL; @@ -157,7 +157,7 @@ static PyObject *py_enum_domain_groups(PyObject *self, PyObject *args) ZERO_STRUCT(response); - if (winbindd_request(WINBINDD_LIST_GROUPS, NULL, &response) + if (winbindd_request_response(WINBINDD_LIST_GROUPS, NULL, &response) != NSS_STATUS_SUCCESS) { PyErr_SetString(winbind_error, "lookup failed"); return NULL; @@ -192,7 +192,7 @@ static PyObject *py_enum_trust_dom(PyObject *self, PyObject *args) ZERO_STRUCT(response); - if (winbindd_request(WINBINDD_LIST_TRUSTDOM, NULL, &response) + if (winbindd_request_response(WINBINDD_LIST_TRUSTDOM, NULL, &response) != NSS_STATUS_SUCCESS) { PyErr_SetString(winbind_error, "lookup failed"); return NULL; @@ -222,7 +222,7 @@ static PyObject *py_check_secret(PyObject *self, PyObject *args) ZERO_STRUCT(response); - if (winbindd_request(WINBINDD_CHECK_MACHACC, NULL, &response) + if (winbindd_request_response(WINBINDD_CHECK_MACHACC, NULL, &response) != NSS_STATUS_SUCCESS) { PyErr_SetString(winbind_error, "lookup failed"); return NULL; @@ -294,7 +294,7 @@ static PyObject *py_uid_to_sid(PyObject *self, PyObject *args) request.data.uid = id; - if (winbindd_request(WINBINDD_UID_TO_SID, &request, &response) + if (winbindd_request_response(WINBINDD_UID_TO_SID, &request, &response) != NSS_STATUS_SUCCESS) { PyErr_SetString(winbind_error, "lookup failed"); return NULL; @@ -319,7 +319,7 @@ static PyObject *py_gid_to_sid(PyObject *self, PyObject *args) request.data.gid = id; - if (winbindd_request(WINBINDD_GID_TO_SID, &request, &response) + if (winbindd_request_response(WINBINDD_GID_TO_SID, &request, &response) != NSS_STATUS_SUCCESS) { PyErr_SetString(winbind_error, "lookup failed"); return NULL; @@ -344,7 +344,7 @@ static PyObject *py_sid_to_uid(PyObject *self, PyObject *args) fstrcpy(request.data.sid, sid); - if (winbindd_request(WINBINDD_SID_TO_UID, &request, &response) + if (winbindd_request_response(WINBINDD_SID_TO_UID, &request, &response) != NSS_STATUS_SUCCESS) { PyErr_SetString(winbind_error, "lookup failed"); return NULL; @@ -369,7 +369,7 @@ static PyObject *py_sid_to_gid(PyObject *self, PyObject *args) fstrcpy(request.data.sid, sid); - if (winbindd_request(WINBINDD_SID_TO_GID, &request, &response) + if (winbindd_request_response(WINBINDD_SID_TO_GID, &request, &response) != NSS_STATUS_SUCCESS) { PyErr_SetString(winbind_error, "lookup failed"); return NULL; @@ -399,7 +399,7 @@ static PyObject *py_auth_plaintext(PyObject *self, PyObject *args) fstrcpy(request.data.auth.user, username); fstrcpy(request.data.auth.pass, password); - if (winbindd_request(WINBINDD_PAM_AUTH, &request, &response) + if (winbindd_request_response(WINBINDD_PAM_AUTH, &request, &response) != NSS_STATUS_SUCCESS) { PyErr_SetString(winbind_error, "lookup failed"); return NULL; @@ -446,7 +446,7 @@ static PyObject *py_auth_crap(PyObject *self, PyObject *args, PyObject *kw) request.data.auth_crap.nt_resp_len = 24; } - if (winbindd_request(WINBINDD_PAM_AUTH_CRAP, &request, &response) + if (winbindd_request_response(WINBINDD_PAM_AUTH_CRAP, &request, &response) != NSS_STATUS_SUCCESS) { PyErr_SetString(winbind_error, "lookup failed"); return NULL; @@ -506,7 +506,7 @@ static PyObject *py_auth_smbd(PyObject *self, PyObject *args, PyObject *kw) - if (winbindd_request(WINBINDD_SMBD_AUTH_CRAP, &request, &response) + if (winbindd_request_response(WINBINDD_SMBD_AUTH_CRAP, &request, &response) != NSS_STATUS_SUCCESS) { PyErr_SetString(winbind_error, "lookup failed"); return NULL; @@ -534,7 +534,7 @@ static PyObject *py_getpwnam(PyObject *self, PyObject *args) fstrcpy(request.data.username, username); - if (winbindd_request(WINBINDD_GETPWNAM, &request, &response) + if (winbindd_request_response(WINBINDD_GETPWNAM, &request, &response) != NSS_STATUS_SUCCESS) { PyErr_SetString(winbind_error, "lookup failed"); return NULL; @@ -565,7 +565,7 @@ static PyObject *py_getpwuid(PyObject *self, PyObject *args) request.data.uid = uid; - if (winbindd_request(WINBINDD_GETPWUID, &request, &response) + if (winbindd_request_response(WINBINDD_GETPWUID, &request, &response) != NSS_STATUS_SUCCESS) { PyErr_SetString(winbind_error, "lookup failed"); return NULL; diff --git a/source3/rpc_client/cli_reg.c b/source3/rpc_client/cli_reg.c index 6de2626dde..c3a1aba90d 100644 --- a/source3/rpc_client/cli_reg.c +++ b/source3/rpc_client/cli_reg.c @@ -214,7 +214,7 @@ WERROR cli_reg_query_key(struct cli_state *cli, TALLOC_CTX *mem_ctx, if ( W_ERROR_EQUAL( out.status, WERR_MORE_DATA ) ) { ZERO_STRUCT (in); - *class_len = out.class.string->uni_max_len; + *class_len = out.key_class.string->uni_max_len; if ( *class_len > saved_class_len ) return out.status; @@ -238,8 +238,8 @@ WERROR cli_reg_query_key(struct cli_state *cli, TALLOC_CTX *mem_ctx, if ( !W_ERROR_IS_OK( out.status ) ) return out.status; - *class_len = out.class.string->uni_max_len; - unistr2_to_ascii(key_class, out.class.string, saved_class_len-1); + *class_len = out.key_class.string->uni_max_len; + unistr2_to_ascii(key_class, out.key_class.string, saved_class_len-1); *num_subkeys = out.num_subkeys ; *max_subkeylen = out.max_subkeylen ; *num_values = out.num_values ; diff --git a/source3/rpc_parse/parse_reg.c b/source3/rpc_parse/parse_reg.c index fc2d3c4086..d71ecc33de 100644 --- a/source3/rpc_parse/parse_reg.c +++ b/source3/rpc_parse/parse_reg.c @@ -207,7 +207,7 @@ static BOOL reg_io_hdrbuf_sec(uint32 ptr, uint32 *ptr3, BUFHDR *hdr_sec, ********************************************************************/ void init_reg_q_create_key(REG_Q_CREATE_KEY *q_c, POLICY_HND *hnd, - char *name, char *class, uint32 access_desired, + char *name, char *key_class, uint32 access_desired, SEC_DESC_BUF *sec_buf) { ZERO_STRUCTP(q_c); @@ -216,7 +216,7 @@ void init_reg_q_create_key(REG_Q_CREATE_KEY *q_c, POLICY_HND *hnd, init_unistr4( &q_c->name, name, UNI_STR_TERMINATE ); - init_unistr4( &q_c->class, class, UNI_STR_TERMINATE ); + init_unistr4( &q_c->key_class, key_class, UNI_STR_TERMINATE ); q_c->access = access_desired; @@ -254,7 +254,7 @@ BOOL reg_io_q_create_key(const char *desc, REG_Q_CREATE_KEY *q_u, if(!prs_align(ps)) return False; - if(!prs_unistr4 ("class", ps, depth, &q_u->class)) + if(!prs_unistr4 ("key_class", ps, depth, &q_u->key_class)) return False; if(!prs_align(ps)) return False; @@ -436,12 +436,12 @@ BOOL reg_io_r_delete_key(const char *desc, REG_R_DELETE_KEY *r_u, prs_struct *p Inits a structure. ********************************************************************/ -void init_reg_q_query_key(REG_Q_QUERY_KEY *q_o, POLICY_HND *hnd, const char *class) +void init_reg_q_query_key(REG_Q_QUERY_KEY *q_o, POLICY_HND *hnd, const char *key_class) { ZERO_STRUCTP(q_o); memcpy(&q_o->pol, hnd, sizeof(q_o->pol)); - init_unistr4(&q_o->class, class, UNI_STR_TERMINATE); + init_unistr4(&q_o->key_class, key_class, UNI_STR_TERMINATE); } /******************************************************************* @@ -461,7 +461,7 @@ BOOL reg_io_q_query_key(const char *desc, REG_Q_QUERY_KEY *q_u, prs_struct *ps, if(!smb_io_pol_hnd("", &q_u->pol, ps, depth)) return False; - if(!prs_unistr4("class", ps, depth, &q_u->class)) + if(!prs_unistr4("key_class", ps, depth, &q_u->key_class)) return False; if(!prs_align(ps)) @@ -486,7 +486,7 @@ BOOL reg_io_r_query_key(const char *desc, REG_R_QUERY_KEY *r_u, prs_struct *ps, if(!prs_align(ps)) return False; - if(!prs_unistr4("class", ps, depth, &r_u->class)) + if(!prs_unistr4("key_class", ps, depth, &r_u->key_class)) return False; if(!prs_align(ps)) diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c index 6c2d6b4978..34e3f8fe35 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -774,15 +774,15 @@ BOOL spoolss_io_devmode(const char *desc, prs_struct *ps, int depth, DEVICEMODE if (devmode->driverextra!=0) { if (UNMARSHALLING(ps)) { - devmode->private=PRS_ALLOC_MEM(ps, uint8, devmode->driverextra); - if(devmode->private == NULL) + devmode->dev_private=PRS_ALLOC_MEM(ps, uint8, devmode->driverextra); + if(devmode->dev_private == NULL) return False; - DEBUG(7,("spoolss_io_devmode: allocated memory [%d] for private\n",devmode->driverextra)); + DEBUG(7,("spoolss_io_devmode: allocated memory [%d] for dev_private\n",devmode->driverextra)); } - DEBUG(7,("spoolss_io_devmode: parsing [%d] bytes of private\n",devmode->driverextra)); - if (!prs_uint8s(False, "private", ps, depth, - devmode->private, devmode->driverextra)) + DEBUG(7,("spoolss_io_devmode: parsing [%d] bytes of dev_private\n",devmode->driverextra)); + if (!prs_uint8s(False, "dev_private", ps, depth, + devmode->dev_private, devmode->driverextra)) return False; } @@ -6188,7 +6188,7 @@ BOOL spoolss_io_q_getjob(const char *desc, SPOOL_Q_GETJOB *q_u, prs_struct *ps, void free_devmode(DEVICEMODE *devmode) { if (devmode!=NULL) { - SAFE_FREE(devmode->private); + SAFE_FREE(devmode->dev_private); SAFE_FREE(devmode); } } @@ -6350,7 +6350,7 @@ BOOL spoolss_io_q_routerreplyprinter (const char *desc, SPOOL_Q_ROUTERREPLYPRINT if (!prs_uint32("change_id", ps, depth, &q_u->change_id)) return False; - if (!prs_uint8s(False, "private", ps, depth, q_u->unknown2, 5)) + if (!prs_uint8s(False, "dev_private", ps, depth, q_u->unknown2, 5)) return False; return True; diff --git a/source3/rpc_server/srv_eventlog_nt.c b/source3/rpc_server/srv_eventlog_nt.c index 3c6e9a100f..a9b0c9bed8 100644 --- a/source3/rpc_server/srv_eventlog_nt.c +++ b/source3/rpc_server/srv_eventlog_nt.c @@ -713,10 +713,10 @@ static Eventlog_entry *_eventlog_read_package_entry(prs_struct *ps, Eventlog_entry *entry) { uint8 *offset; - Eventlog_entry *new = NULL; + Eventlog_entry *ee_new = NULL; - new = PRS_ALLOC_MEM(ps, Eventlog_entry, 1); - if(new == NULL) + ee_new = PRS_ALLOC_MEM(ps, Eventlog_entry, 1); + if(ee_new == NULL) return NULL; entry->data_record.sid_padding = ((4 - ((entry->data_record.source_name_len @@ -767,14 +767,14 @@ static Eventlog_entry *_eventlog_read_package_entry(prs_struct *ps, memcpy(offset, &(entry->data_record.user_data), entry->data_record.user_data_len); offset += entry->data_record.user_data_len; - memcpy(&(new->record), &entry->record, sizeof(Eventlog_record)); - memcpy(&(new->data_record), &entry->data_record, sizeof(Eventlog_data_record)); - new->data = entry->data; + memcpy(&(ee_new->record), &entry->record, sizeof(Eventlog_record)); + memcpy(&(ee_new->data_record), &entry->data_record, sizeof(Eventlog_data_record)); + ee_new->data = entry->data; - return new; + return ee_new; } -static BOOL _eventlog_add_record_to_resp(EVENTLOG_R_READ_EVENTLOG *r_u, Eventlog_entry *new) +static BOOL _eventlog_add_record_to_resp(EVENTLOG_R_READ_EVENTLOG *r_u, Eventlog_entry *ee_new) { Eventlog_entry *insert_point; @@ -782,8 +782,8 @@ static BOOL _eventlog_add_record_to_resp(EVENTLOG_R_READ_EVENTLOG *r_u, Eventlog if (NULL == insert_point) { - r_u->entry = new; - new->next = NULL; + r_u->entry = ee_new; + ee_new->next = NULL; } else { @@ -791,11 +791,11 @@ static BOOL _eventlog_add_record_to_resp(EVENTLOG_R_READ_EVENTLOG *r_u, Eventlog { insert_point=insert_point->next; } - new->next = NULL; - insert_point->next = new; + ee_new->next = NULL; + insert_point->next = ee_new; } r_u->num_records++; - r_u->num_bytes_in_resp += new->record.length; + r_u->num_bytes_in_resp += ee_new->record.length; return True; } @@ -806,7 +806,7 @@ WERROR _eventlog_read_eventlog(pipes_struct *p, { Eventlog_info *info = NULL; POLICY_HND *handle; - Eventlog_entry entry, *new; + Eventlog_entry entry, *ee_new; BOOL eof = False, eor = False; const char *direction = ""; uint32 num_records_read = 0; @@ -854,20 +854,20 @@ WERROR _eventlog_read_eventlog(pipes_struct *p, _eventlog_read_parse_line(buffer[i], &entry, &eor); if(eor == True) { - /* package new entry */ - if((new = _eventlog_read_package_entry(ps, q_u, r_u, &entry)) == NULL) + /* package ee_new entry */ + if((ee_new = _eventlog_read_package_entry(ps, q_u, r_u, &entry)) == NULL) { free(buffer); return WERR_NOMEM; } /* Now see if there is enough room to add */ - if(r_u->num_bytes_in_resp + new->record.length > q_u->max_read_size) + if(r_u->num_bytes_in_resp + ee_new->record.length > q_u->max_read_size) { - r_u->bytes_in_next_record = new->record.length; + r_u->bytes_in_next_record = ee_new->record.length; /* response would be too big to fit in client-size buffer */ break; } - _eventlog_add_record_to_resp(r_u, new); + _eventlog_add_record_to_resp(r_u, ee_new); ZERO_STRUCT(entry); eor=False; num_records_read = r_u->num_records - num_records_read; diff --git a/source3/rpc_server/srv_samr_util.c b/source3/rpc_server/srv_samr_util.c index 61160ccaa0..66cf1cc46d 100644 --- a/source3/rpc_server/srv_samr_util.c +++ b/source3/rpc_server/srv_samr_util.c @@ -251,7 +251,7 @@ void copy_id21_to_sam_passwd(SAM_ACCOUNT *to, SAM_USER_INFO_21 *from) } if (from->fields_present & ACCT_LOGON_HOURS) { - pstring old, new; + pstring oldstr, newstr; DEBUG(15,("INFO_21 LOGON_DIVS: %08X -> %08X\n",pdb_get_logon_divs(to),from->logon_divs)); if (from->logon_divs != pdb_get_logon_divs(to)) { pdb_set_logon_divs(to, from->logon_divs, PDB_CHANGED); @@ -263,9 +263,9 @@ void copy_id21_to_sam_passwd(SAM_ACCOUNT *to, SAM_USER_INFO_21 *from) } DEBUG(15,("INFO_21 LOGON_HRS.HOURS: %s -> %s\n",pdb_get_hours(to),from->logon_hrs.hours)); - pdb_sethexhours(old, pdb_get_hours(to)); - pdb_sethexhours(new, from->logon_hrs.hours); - if (!strequal(old, new)) { + pdb_sethexhours(oldstr, pdb_get_hours(to)); + pdb_sethexhours(newstr, from->logon_hrs.hours); + if (!strequal(oldstr, newstr)) { pdb_set_hours(to, from->logon_hrs.hours, PDB_CHANGED); } } diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 972f6e9730..e05bfa1eaa 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -1445,7 +1445,7 @@ static DEVICEMODE* dup_devicemode(TALLOC_CTX *ctx, DEVICEMODE *devmode) return NULL; } - d->private = TALLOC_MEMDUP(ctx, devmode->private, devmode->driverextra); + d->dev_private = TALLOC_MEMDUP(ctx, devmode->dev_private, devmode->driverextra); return d; } @@ -1885,12 +1885,12 @@ BOOL convert_devicemode(const char *printername, const DEVICEMODE *devmode, * has a new one. JRA. */ - if ((devmode->driverextra != 0) && (devmode->private != NULL)) { - SAFE_FREE(nt_devmode->private); + if ((devmode->driverextra != 0) && (devmode->dev_private != NULL)) { + SAFE_FREE(nt_devmode->nt_dev_private); nt_devmode->driverextra=devmode->driverextra; - if((nt_devmode->private=SMB_MALLOC_ARRAY(uint8, nt_devmode->driverextra)) == NULL) + if((nt_devmode->nt_dev_private=SMB_MALLOC_ARRAY(uint8, nt_devmode->driverextra)) == NULL) return False; - memcpy(nt_devmode->private, devmode->private, nt_devmode->driverextra); + memcpy(nt_devmode->nt_dev_private, devmode->dev_private, nt_devmode->driverextra); } *pp_nt_devmode = nt_devmode; @@ -4089,7 +4089,7 @@ static void free_dev_mode(DEVICEMODE *dev) if (dev == NULL) return; - SAFE_FREE(dev->private); + SAFE_FREE(dev->dev_private); SAFE_FREE(dev); } @@ -4132,8 +4132,8 @@ static BOOL convert_nt_devicemode( DEVICEMODE *devmode, NT_DEVICEMODE *ntdevmode devmode->mediatype = ntdevmode->mediatype; devmode->dithertype = ntdevmode->dithertype; - if (ntdevmode->private != NULL) { - if ((devmode->private=(uint8 *)memdup(ntdevmode->private, ntdevmode->driverextra)) == NULL) + if (ntdevmode->nt_dev_private != NULL) { + if ((devmode->dev_private=(uint8 *)memdup(ntdevmode->nt_dev_private, ntdevmode->driverextra)) == NULL) return False; } diff --git a/source3/script/mkproto.awk b/source3/script/mkproto.awk index d9223a1973..3c48267587 100644 --- a/source3/script/mkproto.awk +++ b/source3/script/mkproto.awk @@ -136,6 +136,10 @@ END { gotstart = 1; } + if( $0 ~ /^NODE_STATUS_STRUCT/ ) { + gotstart = 1; + } + if(!gotstart) { next; } diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c index d0e0f6e143..56e5727b7d 100644 --- a/source3/smbd/chgpasswd.c +++ b/source3/smbd/chgpasswd.c @@ -970,8 +970,8 @@ static BOOL check_passwd_history(SAM_ACCOUNT *sampass, const char *plaintext) return True; } - dump_data(100, new_nt_p16, NT_HASH_LEN); - dump_data(100, pwhistory, PW_HISTORY_ENTRY_LEN*pwHisLen); + dump_data(100, (const char *)new_nt_p16, NT_HASH_LEN); + dump_data(100, (const char *)pwhistory, PW_HISTORY_ENTRY_LEN*pwHisLen); memset(zero_md5_nt_pw, '\0', SALTED_MD5_HASH_LEN); for (i=0; i<pwHisLen; i++) { diff --git a/source3/smbd/conn.c b/source3/smbd/conn.c index 26529c77a1..dc7dec4e97 100644 --- a/source3/smbd/conn.c +++ b/source3/smbd/conn.c @@ -283,7 +283,7 @@ void msg_force_tdis(int msg_type, pid_t pid, void *buf, size_t len) connection_struct *conn, *next; fstring sharename; - fstrcpy(sharename, buf); + fstrcpy(sharename, (const char *)buf); if (strcmp(sharename, "*") == 0) { DEBUG(1,("Forcing close of all shares\n")); diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c index 69b8b57642..ba0766c298 100644 --- a/source3/smbd/fileio.c +++ b/source3/smbd/fileio.c @@ -752,7 +752,7 @@ static BOOL setup_write_cache(files_struct *fsp, SMB_OFF_T file_size) wcp->offset = 0; wcp->alloc_size = alloc_size; wcp->data_size = 0; - if((wcp->data = SMB_MALLOC(wcp->alloc_size)) == NULL) { + if((wcp->data = (char *)SMB_MALLOC(wcp->alloc_size)) == NULL) { DEBUG(0,("setup_write_cache: malloc fail for buffer size %u.\n", (unsigned int)wcp->alloc_size )); SAFE_FREE(wcp); diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c index e3f6521fba..86c6d056a0 100644 --- a/source3/smbd/ipc.c +++ b/source3/smbd/ipc.c @@ -163,7 +163,7 @@ void send_trans_reply(char *outbuf, static BOOL api_rpc_trans_reply(char *outbuf, smb_np_struct *p) { BOOL is_data_outstanding; - char *rdata = SMB_MALLOC(p->max_trans_reply); + char *rdata = (char *)SMB_MALLOC(p->max_trans_reply); int data_len; if(rdata == NULL) { diff --git a/source3/smbd/password.c b/source3/smbd/password.c index 213ef98ea3..2ee8c1232e 100644 --- a/source3/smbd/password.c +++ b/source3/smbd/password.c @@ -168,7 +168,7 @@ int register_vuid(auth_serversupplied_info *server_info, DATA_BLOB session_key, vuser->n_groups = server_info->n_groups; if (vuser->n_groups) { - if (!(vuser->groups = memdup(server_info->groups, sizeof(gid_t) * vuser->n_groups))) { + if (!(vuser->groups = (gid_t *)memdup(server_info->groups, sizeof(gid_t) * vuser->n_groups))) { DEBUG(0,("register_vuid: failed to memdup vuser->groups\n")); data_blob_free(&session_key); free(vuser); @@ -316,7 +316,7 @@ void add_session_user(const char *user) DEBUG(3,("add_session_user: session userlist already too large.\n")); return; } - newlist = SMB_REALLOC( session_userlist, len_session_userlist + PSTRING_LEN ); + newlist = (char *)SMB_REALLOC( session_userlist, len_session_userlist + PSTRING_LEN ); if( newlist == NULL ) { DEBUG(1,("Unable to resize session_userlist\n")); return; diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 0373cd471c..1ec176bd08 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -87,7 +87,7 @@ static void free_queued_message(struct pending_message_list *msg) for processing. ****************************************************************************/ -static BOOL push_queued_message(enum q_type qt, char *buf, int msg_len, struct timeval *ptv, char *private, size_t private_len) +static BOOL push_queued_message(enum q_type qt, char *buf, int msg_len, struct timeval *ptv, char *private_data, size_t private_len) { struct pending_message_list *tmp_msg; struct pending_message_list *msg = SMB_MALLOC_P(struct pending_message_list); @@ -110,8 +110,8 @@ static BOOL push_queued_message(enum q_type qt, char *buf, int msg_len, struct t msg->msg_time = *ptv; } - if (private) { - msg->private_data = data_blob(private, private_len); + if (private_data) { + msg->private_data = data_blob(private_data, private_len); if (msg->private_data.data == NULL) { DEBUG(0,("push_message: malloc fail (3)\n")); data_blob_free(&msg->buf); @@ -249,7 +249,7 @@ struct pending_message_list *get_open_deferred_message(uint16 mid) for processing. ****************************************************************************/ -BOOL push_sharing_violation_open_smb_message(struct timeval *ptv, char *private, size_t priv_len) +BOOL push_sharing_violation_open_smb_message(struct timeval *ptv, char *private_data, size_t priv_len) { uint16 mid = SVAL(InBuffer,smb_mid); struct timeval tv; @@ -275,7 +275,7 @@ BOOL push_sharing_violation_open_smb_message(struct timeval *ptv, char *private, (unsigned int)tv.tv_sec, (unsigned int)tv.tv_usec)); return push_queued_message(SHARE_VIOLATION_QUEUE, InBuffer, - smb_len(InBuffer)+4, &tv, private, priv_len); + smb_len(InBuffer)+4, &tv, private_data, priv_len); } /**************************************************************************** diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c index 3b33db24e8..95fe571cff 100644 --- a/source3/smbd/sesssetup.c +++ b/source3/smbd/sesssetup.c @@ -223,7 +223,7 @@ static int reply_spnego_kerberos(connection_struct *conn, fstrcpy(wb_request.domain_name, domain); - wb_result = winbindd_request(WINBINDD_DOMAIN_INFO, + wb_result = winbindd_request_response(WINBINDD_DOMAIN_INFO, &wb_request, &wb_response); if (wb_result == NSS_STATUS_SUCCESS) { diff --git a/source3/smbd/vfs-wrap.c b/source3/smbd/vfs-wrap.c index abc17a37a2..57442edee6 100644 --- a/source3/smbd/vfs-wrap.c +++ b/source3/smbd/vfs-wrap.c @@ -432,15 +432,15 @@ static int copy_reg(const char *source, const char *dest) return -1; } -int vfswrap_rename(vfs_handle_struct *handle, connection_struct *conn, const char *old, const char *new) +int vfswrap_rename(vfs_handle_struct *handle, connection_struct *conn, const char *oldname, const char *newname) { int result; START_PROFILE(syscall_rename); - result = rename(old, new); + result = rename(oldname, newname); if (errno == EXDEV) { /* Rename across filesystems needed. */ - result = copy_reg(old, new); + result = copy_reg(oldname, newname); } END_PROFILE(syscall_rename); diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c index 47a2f070b6..2c94f94587 100644 --- a/source3/tdb/tdb.c +++ b/source3/tdb/tdb.c @@ -1309,7 +1309,7 @@ static int tdb_next_lock(TDB_CONTEXT *tdb, struct tdb_traverse_lock *tlock, if fn is NULL then it is not called a non-zero return value from fn() indicates that the traversal should stop */ -int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *private) +int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *private_val) { TDB_DATA key, dbuf; struct list_struct rec; @@ -1347,7 +1347,7 @@ int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *private) ret = -1; goto out; } - if (fn && fn(tdb, key, dbuf, private)) { + if (fn && fn(tdb, key, dbuf, private_val)) { /* They want us to terminate traversal */ ret = count; if (unlock_record(tdb, tl.off) != 0) { diff --git a/source3/torture/nbio.c b/source3/torture/nbio.c index 4d61fa0531..16e0b4a191 100644 --- a/source3/torture/nbio.c +++ b/source3/torture/nbio.c @@ -228,9 +228,9 @@ void nb_rmdir(const char *fname) } } -void nb_rename(const char *old, const char *new) +void nb_rename(const char *oldname, const char *newname) { - if (!cli_rename(c, old, new)) { + if (!cli_rename(c, oldname, newname)) { printf("ERROR: rename %s %s failed (%s)\n", old, new, cli_errstr(c)); exit(1); diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index cf45216b6e..2e8e6b64f8 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -3684,7 +3684,7 @@ static BOOL get_user_sids(const char *domain, const char *user, fstrcpy(request.data.name.dom_name, domain); fstrcpy(request.data.name.name, user); - result = winbindd_request(WINBINDD_LOOKUPNAME, &request, &response); + result = winbindd_request_response(WINBINDD_LOOKUPNAME, &request, &response); if (result != NSS_STATUS_SUCCESS) { DEBUG(1, ("winbind could not find %s\n", full_name)); @@ -3706,7 +3706,7 @@ static BOOL get_user_sids(const char *domain, const char *user, fstrcpy(request.data.username, full_name); - result = winbindd_request(WINBINDD_GETGROUPS, &request, &response); + result = winbindd_request_response(WINBINDD_GETGROUPS, &request, &response); if (result != NSS_STATUS_SUCCESS) { DEBUG(1, ("winbind could not get groups of %s\n", full_name)); @@ -3725,7 +3725,7 @@ static BOOL get_user_sids(const char *domain, const char *user, sidrequest.data.gid = gid; - result = winbindd_request(WINBINDD_GID_TO_SID, + result = winbindd_request_response(WINBINDD_GID_TO_SID, &sidrequest, &sidresponse); if (result != NSS_STATUS_SUCCESS) { @@ -3769,7 +3769,7 @@ static BOOL get_user_tokens(int *num_tokens, struct user_token **user_tokens) ZERO_STRUCT(request); ZERO_STRUCT(response); - if (winbindd_request(WINBINDD_LIST_USERS, &request, &response) != + if (winbindd_request_response(WINBINDD_LIST_USERS, &request, &response) != NSS_STATUS_SUCCESS) return False; diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c index 84872897fc..ef12038d5e 100644 --- a/source3/utils/net_rpc_samsync.c +++ b/source3/utils/net_rpc_samsync.c @@ -425,10 +425,10 @@ sam_account_from_delta(SAM_ACCOUNT *account, SAM_ACCOUNT_INFO *delta) /* Logon Hours */ if (delta->buf_logon_hrs.buffer) { - pstring old, new; - pdb_sethexhours(old, pdb_get_hours(account)); - pdb_sethexhours(new, delta->buf_logon_hrs.buffer); - if (!strequal(old, new)) + pstring oldstr, newstr; + pdb_sethexhours(oldstr, pdb_get_hours(account)); + pdb_sethexhours(newstr, delta->buf_logon_hrs.buffer); + if (!strequal(oldstr, newstr)) pdb_set_hours(account, (const char *)delta->buf_logon_hrs.buffer, PDB_CHANGED); } diff --git a/source3/utils/nmblookup.c b/source3/utils/nmblookup.c index 4ed4284786..d1d735f7f9 100644 --- a/source3/utils/nmblookup.c +++ b/source3/utils/nmblookup.c @@ -101,7 +101,7 @@ static void do_node_status(int fd, const char *name, int type, struct in_addr ip { struct nmb_name nname; int count, i, j; - struct node_status *status; + NODE_STATUS_STRUCT *status; struct node_status_extra extra; fstring cleanname; diff --git a/source3/utils/ntlm_auth.c b/source3/utils/ntlm_auth.c index fcaad18ef6..6d5737aad4 100644 --- a/source3/utils/ntlm_auth.c +++ b/source3/utils/ntlm_auth.c @@ -105,7 +105,7 @@ static char winbind_separator(void) /* Send off request */ - if (winbindd_request(WINBINDD_INFO, NULL, &response) != + if (winbindd_request_response(WINBINDD_INFO, NULL, &response) != NSS_STATUS_SUCCESS) { d_printf("could not obtain winbind separator!\n"); return *lp_winbind_separator(); @@ -135,7 +135,7 @@ const char *get_winbind_domain(void) /* Send off request */ - if (winbindd_request(WINBINDD_DOMAIN_NAME, NULL, &response) != + if (winbindd_request_response(WINBINDD_DOMAIN_NAME, NULL, &response) != NSS_STATUS_SUCCESS) { DEBUG(0, ("could not obtain winbind domain name!\n")); return lp_workgroup(); @@ -161,7 +161,7 @@ const char *get_winbind_netbios_name(void) /* Send off request */ - if (winbindd_request(WINBINDD_NETBIOS_NAME, NULL, &response) != + if (winbindd_request_response(WINBINDD_NETBIOS_NAME, NULL, &response) != NSS_STATUS_SUCCESS) { DEBUG(0, ("could not obtain winbind netbios name!\n")); return global_myname(); @@ -231,7 +231,7 @@ static BOOL get_require_membership_sid(void) { return False; } - if (winbindd_request(WINBINDD_LOOKUPNAME, &request, &response) != + if (winbindd_request_response(WINBINDD_LOOKUPNAME, &request, &response) != NSS_STATUS_SUCCESS) { DEBUG(0, ("Winbindd lookupname failed to resolve %s into a SID!\n", require_membership_of)); @@ -268,7 +268,7 @@ static BOOL check_plaintext_auth(const char *user, const char *pass, if (require_membership_of_sid) fstrcpy(request.data.auth.require_membership_of_sid, require_membership_of_sid); - result = winbindd_request(WINBINDD_PAM_AUTH, &request, &response); + result = winbindd_request_response(WINBINDD_PAM_AUTH, &request, &response); /* Display response */ @@ -348,7 +348,7 @@ NTSTATUS contact_winbind_auth_crap(const char *username, request.data.auth_crap.nt_resp_len = nt_response->length; } - result = winbindd_request(WINBINDD_PAM_AUTH_CRAP, &request, &response); + result = winbindd_request_response(WINBINDD_PAM_AUTH_CRAP, &request, &response); /* Display response */ diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c index 88ec6b1f4f..7c934cdb6c 100644 --- a/source3/utils/pdbedit.c +++ b/source3/utils/pdbedit.c @@ -76,9 +76,9 @@ static int export_database (struct pdb_context *in, struct pdb_context while (NT_STATUS_IS_OK(in->pdb_getsampwent(in, user))) { DEBUG(4, ("Processing account %s\n", - user->private.username)); + user->private_u.username)); if (!username || - (strcmp(username, user->private.username) + (strcmp(username, user->private_u.username) == 0)) { out->pdb_add_sam_account(out, user); if (!NT_STATUS_IS_OK(pdb_reset_sam(user))) { diff --git a/source3/utils/profiles.c b/source3/utils/profiles.c index 0830d6b74b..b718770ba3 100644 --- a/source3/utils/profiles.c +++ b/source3/utils/profiles.c @@ -395,7 +395,7 @@ static void print_sid(DOM_SID *sid); int verbose = 1; DOM_SID old_sid, new_sid; -int change = 0, new = 0; +int change = 0, new_val = 0; /* Compare two SIDs for equality */ static int my_sid_equal(DOM_SID *s1, DOM_SID *s2) @@ -562,7 +562,7 @@ int main(int argc, char *argv[]) break; case 'n': - new = 1; + new_val = 1; if (!get_sid(&new_sid, poptGetOptArg(pc))) { fprintf(stderr, "Argument to -n should be a SID in form of S-1-5-...\n"); poptPrintUsage(pc, stderr, 0); @@ -584,7 +584,7 @@ int main(int argc, char *argv[]) exit(1); } - if ((!change & new) || (change & !new)) { + if ((!change & new_val) || (change & !new_val)) { fprintf(stderr, "You must specify both -c and -n if one or the other is set!\n"); poptPrintUsage(pc, stderr, 0); exit(252); diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c index 048ec8dc3e..00000b5cfb 100644 --- a/source3/utils/smbcacls.c +++ b/source3/utils/smbcacls.c @@ -318,7 +318,7 @@ static BOOL parse_ace(SEC_ACE *ace, char *str) /* add an ACE to a list of ACEs in a SEC_ACL */ static BOOL add_ace(SEC_ACL **the_acl, SEC_ACE *ace) { - SEC_ACL *new; + SEC_ACL *new_ace; SEC_ACE *aces; if (! *the_acl) { (*the_acl) = make_sec_acl(ctx, 3, 1, ace); @@ -328,9 +328,9 @@ static BOOL add_ace(SEC_ACL **the_acl, SEC_ACE *ace) aces = SMB_CALLOC_ARRAY(SEC_ACE, 1+(*the_acl)->num_aces); memcpy(aces, (*the_acl)->ace, (*the_acl)->num_aces * sizeof(SEC_ACE)); memcpy(aces+(*the_acl)->num_aces, ace, sizeof(SEC_ACE)); - new = make_sec_acl(ctx,(*the_acl)->revision,1+(*the_acl)->num_aces, aces); + new_ace = make_sec_acl(ctx,(*the_acl)->revision,1+(*the_acl)->num_aces, aces); SAFE_FREE(aces); - (*the_acl) = new; + (*the_acl) = new_ace; return True; } diff --git a/source3/web/diagnose.c b/source3/web/diagnose.c index f4b022cf58..d259717da0 100644 --- a/source3/web/diagnose.c +++ b/source3/web/diagnose.c @@ -25,10 +25,6 @@ extern struct in_addr loopback_ip; #ifdef WITH_WINBIND -NSS_STATUS winbindd_request(int req_type, - struct winbindd_request *request, - struct winbindd_response *response); - /* check to see if winbind is running by pinging it */ BOOL winbindd_running(void) diff --git a/source3/web/swat.c b/source3/web/swat.c index 8505f1a685..14889e35aa 100644 --- a/source3/web/swat.c +++ b/source3/web/swat.c @@ -216,7 +216,7 @@ static void show_parameter(int snum, struct parm_struct *parm) void *ptr = parm->ptr; char *utf8_s1, *utf8_s2; - if (parm->class == P_LOCAL && snum >= 0) { + if (parm->p_class == P_LOCAL && snum >= 0) { ptr = lp_local_ptr(snum, ptr); } @@ -344,9 +344,9 @@ static void show_parameters(int snum, int allparameters, unsigned int parm_filte const char *last_heading = NULL; while ((parm = lp_next_parameter(snum, &i, allparameters))) { - if (snum < 0 && parm->class == P_LOCAL && !(parm->flags & FLAG_GLOBAL)) + if (snum < 0 && parm->p_class == P_LOCAL && !(parm->flags & FLAG_GLOBAL)) continue; - if (parm->class == P_SEPARATOR) { + if (parm->p_class == P_SEPARATOR) { heading = parm->label; continue; } @@ -360,7 +360,7 @@ static void show_parameters(int snum, int allparameters, unsigned int parm_filte if (!(parm->flags & FLAG_BASIC)) { void *ptr = parm->ptr; - if (parm->class == P_LOCAL && snum >= 0) { + if (parm->p_class == P_LOCAL && snum >= 0) { ptr = lp_local_ptr(snum, ptr); } @@ -488,7 +488,7 @@ static void commit_parameter(int snum, struct parm_struct *parm, const char *v) int i; char *s; - if (snum < 0 && parm->class == P_LOCAL) { + if (snum < 0 && parm->p_class == P_LOCAL) { /* this handles the case where we are changing a local variable globally. We need to change the parameter in all shares where it is currently set to the default */ |