diff options
-rw-r--r-- | source/Makefile.in | 4 | ||||
-rw-r--r-- | source/auth/auth.c | 3 | ||||
-rw-r--r-- | source/auth/auth_domain.c | 11 | ||||
-rw-r--r-- | source/auth/auth_ntlmssp.c | 12 | ||||
-rw-r--r-- | source/auth/auth_sam.c | 2 | ||||
-rw-r--r-- | source/auth/auth_script.c | 7 | ||||
-rw-r--r-- | source/auth/auth_winbind.c | 10 | ||||
-rw-r--r-- | source/auth/pampass.c | 5 | ||||
-rwxr-xr-x | source/client/mount.cifs.c | 40 | ||||
-rwxr-xr-x | source/configure.developer | 5 | ||||
-rw-r--r-- | source/groupdb/mapping_ldb.c | 4 | ||||
-rw-r--r-- | source/include/ads.h | 4 | ||||
-rw-r--r-- | source/include/adt_tree.h | 4 | ||||
-rw-r--r-- | source/include/dlinklist.h | 60 | ||||
-rw-r--r-- | source/include/local.h | 3 | ||||
-rw-r--r-- | source/include/messages.h | 1 | ||||
-rw-r--r-- | source/include/privileges.h | 4 | ||||
-rw-r--r-- | source/include/socket_wrapper.h | 48 | ||||
-rw-r--r-- | source/include/talloc.h | 145 | ||||
-rw-r--r-- | source/lib/smbldap.c | 5 | ||||
-rw-r--r-- | source/libsmb/clikrb5.c | 21 | ||||
-rw-r--r-- | source/printing/notify.c | 8 | ||||
-rw-r--r-- | source/smbd/blocking.c | 4 | ||||
-rw-r--r-- | source/smbd/nttrans.c | 5 | ||||
-rw-r--r-- | source/smbd/posix_acls.c | 16 | ||||
-rw-r--r-- | source/smbd/process.c | 3 | ||||
-rw-r--r-- | source/smbd/trans2.c | 26 |
27 files changed, 149 insertions, 311 deletions
diff --git a/source/Makefile.in b/source/Makefile.in index 411ac1558fc..f0b2b45c237 100644 --- a/source/Makefile.in +++ b/source/Makefile.in @@ -345,7 +345,9 @@ RPC_PARSE_OBJ = rpc_parse/parse_lsa.o rpc_parse/parse_net.o \ rpc_parse/parse_rpc.o rpc_parse/parse_samr.o \ rpc_parse/parse_ds.o rpc_parse/parse_spoolss.o \ rpc_parse/parse_eventlog.o rpc_parse/parse_buffer.o \ - rpc_parse/parse_ntsvcs.o rpc_parse/parse_svcctl.o $(REGOBJS_OBJ) + rpc_parse/parse_ntsvcs.o rpc_parse/parse_svcctl.o $(REGOBJS_OBJ) \ + rpc_parse/parse_srv.o rpc_parse/parse_dfs.o \ + rpc_parse/parse_reg.o RPC_CLIENT_OBJ = rpc_client/cli_pipe.o diff --git a/source/auth/auth.c b/source/auth/auth.c index 139ba5482b7..0b868b265ed 100644 --- a/source/auth/auth.c +++ b/source/auth/auth.c @@ -432,7 +432,6 @@ static NTSTATUS make_auth_context_text_list(struct auth_context **auth_context, { auth_methods *list = NULL; auth_methods *t = NULL; - auth_methods *tmp; NTSTATUS nt_status; if (!text_list) { @@ -445,7 +444,7 @@ static NTSTATUS make_auth_context_text_list(struct auth_context **auth_context, for (;*text_list; text_list++) { if (load_auth_module(*auth_context, *text_list, &t)) { - DLIST_ADD_END(list, t, tmp); + DLIST_ADD_END(list, t, auth_methods *); } } diff --git a/source/auth/auth_domain.c b/source/auth/auth_domain.c index bedd318c3c3..8ad6329da98 100644 --- a/source/auth/auth_domain.c +++ b/source/auth/auth_domain.c @@ -50,6 +50,8 @@ static NTSTATUS connect_to_domain_password_server(struct cli_state **cli, NTSTATUS result; struct rpc_pipe_client *netlogon_pipe = NULL; + *cli = NULL; + *pipe_ret = NULL; /* TODO: Send a SAMLOGON request to determine whether this is a valid @@ -81,6 +83,11 @@ static NTSTATUS connect_to_domain_password_server(struct cli_state **cli, result = NT_STATUS_NO_LOGON_SERVERS; } + if (*cli) { + cli_shutdown(*cli); + *cli = NULL; + } + release_server_mutex(); return result; } @@ -111,6 +118,7 @@ static NTSTATUS connect_to_domain_password_server(struct cli_state **cli, DEBUG(0,("connect_to_domain_password_server: unable to open the domain client session to \ machine %s. Error was : %s.\n", dc_name, nt_errstr(result))); cli_shutdown(*cli); + *cli = NULL; release_server_mutex(); return result; } @@ -126,6 +134,7 @@ machine %s. Error was : %s.\n", dc_name, nt_errstr(result))); "trust account password for domain '%s'\n", domain)); cli_shutdown(*cli); + *cli = NULL; release_server_mutex(); return NT_STATUS_CANT_ACCESS_DOMAIN_INFO; } @@ -141,6 +150,7 @@ machine %s. Error was : %s.\n", dc_name, nt_errstr(result))); if (!NT_STATUS_IS_OK(result)) { cli_shutdown(*cli); + *cli = NULL; release_server_mutex(); return result; } @@ -150,6 +160,7 @@ machine %s. Error was : %s.\n", dc_name, nt_errstr(result))); DEBUG(0,("connect_to_domain_password_server: unable to open the domain client session to \ machine %s. Error was : %s.\n", dc_name, cli_errstr(*cli))); cli_shutdown(*cli); + *cli = NULL; release_server_mutex(); return NT_STATUS_NO_LOGON_SERVERS; } diff --git a/source/auth/auth_ntlmssp.c b/source/auth/auth_ntlmssp.c index 6cf987a48b1..51b145a7608 100644 --- a/source/auth/auth_ntlmssp.c +++ b/source/auth/auth_ntlmssp.c @@ -30,7 +30,8 @@ static const uint8 *auth_ntlmssp_get_challenge(const struct ntlmssp_state *ntlmssp_state) { - AUTH_NTLMSSP_STATE *auth_ntlmssp_state = ntlmssp_state->auth_context; + AUTH_NTLMSSP_STATE *auth_ntlmssp_state = + (AUTH_NTLMSSP_STATE *)ntlmssp_state->auth_context; return auth_ntlmssp_state->auth_context->get_ntlm_challenge(auth_ntlmssp_state->auth_context); } @@ -41,7 +42,8 @@ static const uint8 *auth_ntlmssp_get_challenge(const struct ntlmssp_state *ntlms */ static BOOL auth_ntlmssp_may_set_challenge(const struct ntlmssp_state *ntlmssp_state) { - AUTH_NTLMSSP_STATE *auth_ntlmssp_state = ntlmssp_state->auth_context; + AUTH_NTLMSSP_STATE *auth_ntlmssp_state = + (AUTH_NTLMSSP_STATE *)ntlmssp_state->auth_context; struct auth_context *auth_context = auth_ntlmssp_state->auth_context; return auth_context->challenge_may_be_modified; @@ -53,7 +55,8 @@ static BOOL auth_ntlmssp_may_set_challenge(const struct ntlmssp_state *ntlmssp_s */ static NTSTATUS auth_ntlmssp_set_challenge(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *challenge) { - AUTH_NTLMSSP_STATE *auth_ntlmssp_state = ntlmssp_state->auth_context; + AUTH_NTLMSSP_STATE *auth_ntlmssp_state = + (AUTH_NTLMSSP_STATE *)ntlmssp_state->auth_context; struct auth_context *auth_context = auth_ntlmssp_state->auth_context; SMB_ASSERT(challenge->length == 8); @@ -77,7 +80,8 @@ static NTSTATUS auth_ntlmssp_set_challenge(struct ntlmssp_state *ntlmssp_state, static NTSTATUS auth_ntlmssp_check_password(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *user_session_key, DATA_BLOB *lm_session_key) { - AUTH_NTLMSSP_STATE *auth_ntlmssp_state = ntlmssp_state->auth_context; + AUTH_NTLMSSP_STATE *auth_ntlmssp_state = + (AUTH_NTLMSSP_STATE *)ntlmssp_state->auth_context; auth_usersupplied_info *user_info = NULL; NTSTATUS nt_status; BOOL username_was_mapped; diff --git a/source/auth/auth_sam.c b/source/auth/auth_sam.c index ec405dd2be4..847315ef888 100644 --- a/source/auth/auth_sam.c +++ b/source/auth/auth_sam.c @@ -168,7 +168,7 @@ static NTSTATUS sam_account_ok(TALLOC_CTX *mem_ctx, time_t last_set_time = pdb_get_pass_last_set_time(sampass); /* check for immediate expiry "must change at next logon" */ - if (must_change_time == 0 && last_set_time != 0) { + if (last_set_time == 0) { DEBUG(1,("sam_account_ok: Account for user '%s' password must change!.\n", pdb_get_username(sampass))); return NT_STATUS_PASSWORD_MUST_CHANGE; } diff --git a/source/auth/auth_script.c b/source/auth/auth_script.c index ec7264924cd..3d007b77303 100644 --- a/source/auth/auth_script.c +++ b/source/auth/auth_script.c @@ -69,7 +69,7 @@ static NTSTATUS script_check_user_credentials(const struct auth_context *auth_co 48 + 1 + /* 24 bytes of challenge going to 48 */ 48 + 1; - secret_str = malloc(secret_str_len); + secret_str = (char *)malloc(secret_str_len); if (!secret_str) { return NT_STATUS_NO_MEMORY; } @@ -132,10 +132,11 @@ static NTSTATUS auth_init_script(struct auth_context *auth_context, const char * if (param && *param) { /* we load the 'fallback' module - if script isn't here, call this module */ - if (!load_auth_module(auth_context, param, (auth_methods **)&(*auth_method)->private_data)) { + auth_methods *priv; + if (!load_auth_module(auth_context, param, &priv)) { return NT_STATUS_UNSUCCESSFUL; } - + (*auth_method)->private_data = (void *)priv; } return NT_STATUS_OK; } diff --git a/source/auth/auth_winbind.c b/source/auth/auth_winbind.c index d8ac348d040..fa56757950d 100644 --- a/source/auth/auth_winbind.c +++ b/source/auth/auth_winbind.c @@ -32,7 +32,7 @@ static NTSTATUS get_info3_from_ndr(TALLOC_CTX *mem_ctx, struct winbindd_response size_t len = response->length - sizeof(struct winbindd_response); prs_struct ps; if (len > 0) { - info3_ndr = response->extra_data.data; + info3_ndr = (uint8 *)response->extra_data.data; if (!prs_init(&ps, len, mem_ctx, UNMARSHALL)) { return NT_STATUS_NO_MEMORY; } @@ -112,7 +112,8 @@ static NTSTATUS check_winbind_security(const struct auth_context *auth_context, unbecome_root(); if ( result == NSS_STATUS_UNAVAIL ) { - struct auth_methods *auth_method = my_private_data; + struct auth_methods *auth_method = + (struct auth_methods *)my_private_data; if ( auth_method ) return auth_method->auth(auth_context, auth_method->private_data, @@ -157,10 +158,11 @@ static NTSTATUS auth_init_winbind(struct auth_context *auth_context, const char if (param && *param) { /* we load the 'fallback' module - if winbind isn't here, call this module */ - if (!load_auth_module(auth_context, param, (auth_methods **)&(*auth_method)->private_data)) { + auth_methods *priv; + if (!load_auth_module(auth_context, param, &priv)) { return NT_STATUS_UNSUCCESSFUL; } - + (*auth_method)->private_data = (void *)priv; } return NT_STATUS_OK; } diff --git a/source/auth/pampass.c b/source/auth/pampass.c index 26b45c5ff8a..ba11d2e8fc2 100644 --- a/source/auth/pampass.c +++ b/source/auth/pampass.c @@ -208,7 +208,6 @@ static struct chat_struct *make_pw_chat(const char *p) fstring reply; struct chat_struct *list = NULL; struct chat_struct *t; - struct chat_struct *tmp; while (1) { t = SMB_MALLOC_P(struct chat_struct); @@ -219,7 +218,7 @@ static struct chat_struct *make_pw_chat(const char *p) ZERO_STRUCTP(t); - DLIST_ADD_END(list, t, tmp); + DLIST_ADD_END(list, t, struct chat_struct*); if (!next_token(&p, prompt, NULL, sizeof(fstring))) break; @@ -511,7 +510,7 @@ static NTSTATUS smb_pam_auth(pam_handle_t *pamh, const char *user) pam_error = pam_authenticate(pamh, PAM_SILENT | lp_null_passwords() ? 0 : PAM_DISALLOW_NULL_AUTHTOK); switch( pam_error ){ case PAM_AUTH_ERR: - DEBUG(2, ("smb_pam_auth: PAM: Athentication Error for user %s\n", user)); + DEBUG(2, ("smb_pam_auth: PAM: Authentication Error for user %s\n", user)); break; case PAM_CRED_INSUFFICIENT: DEBUG(2, ("smb_pam_auth: PAM: Insufficient Credentials for user %s\n", user)); diff --git a/source/client/mount.cifs.c b/source/client/mount.cifs.c index ac98b992bb2..076001ccc07 100755 --- a/source/client/mount.cifs.c +++ b/source/client/mount.cifs.c @@ -143,7 +143,7 @@ static int open_cred_file(char * file_name) fs = fopen(file_name,"r"); if(fs == NULL) return errno; - line_buf = malloc(4096); + line_buf = (char *)malloc(4096); if(line_buf == NULL) { fclose(fs); return -ENOMEM; @@ -176,7 +176,7 @@ static int open_cred_file(char * file_name) exit(1); } else { got_user = 1; - user_name = calloc(1 + length,1); + user_name = (char *)calloc(1 + length,1); /* BB adding free of user_name string before exit, not really necessary but would be cleaner */ strncpy(user_name,temp_val, length); @@ -200,7 +200,7 @@ static int open_cred_file(char * file_name) exit(1); } else { if(mountpassword == NULL) { - mountpassword = calloc(65,1); + mountpassword = (char *)calloc(65,1); } else memset(mountpassword,0,64); if(mountpassword) { @@ -228,7 +228,7 @@ static int open_cred_file(char * file_name) exit(1); } else { if(domain_name == NULL) { - domain_name = calloc(65,1); + domain_name = (char *)calloc(65,1); } else memset(domain_name,0,64); if(domain_name) { @@ -255,7 +255,7 @@ static int get_password_from_file(int file_descript, char * filename) char c; if(mountpassword == NULL) - mountpassword = calloc(65,1); + mountpassword = (char *)calloc(65,1); else memset(mountpassword, 0, 64); @@ -374,7 +374,7 @@ static int parse_options(char ** optionsp, int * filesys_flags) if(percent_char) { *percent_char = ','; if(mountpassword == NULL) - mountpassword = calloc(65,1); + mountpassword = (char *)calloc(65,1); if(mountpassword) { if(got_password) printf("\nmount.cifs warning - password specified twice\n"); @@ -596,7 +596,7 @@ static int parse_options(char ** optionsp, int * filesys_flags) if (value) word_len += 1 + strlen(value); - out = realloc(out, out_len + word_len + 2); + out = (char *)realloc(out, out_len + word_len + 2); if (out == NULL) { perror("malloc"); exit(1); @@ -646,7 +646,7 @@ static void check_for_comma(char ** ppasswrd) return; } - new_pass_buf = malloc(len+number_of_commas+1); + new_pass_buf = (char *)malloc(len+number_of_commas+1); if(new_pass_buf == NULL) return; @@ -710,7 +710,7 @@ static char * check_for_domain(char **ppuser) len = strlen(domainnm); /* reset domainm to new buffer, and copy domain name into it */ - domainnm = malloc(len+1); + domainnm = (char *)malloc(len+1); if(domainnm == NULL) return NULL; @@ -769,7 +769,7 @@ static char * parse_server(char ** punc_name) share = strchr(unc_name,':'); if(share) { free_share_name = 1; - *punc_name = malloc(length+3); + *punc_name = (char *)malloc(length+3); if(*punc_name == NULL) { /* put the original string back if no memory left */ @@ -935,10 +935,20 @@ int main(int argc, char ** argv) ++nomtab; break; case 'b': +#ifdef MS_BIND flags |= MS_BIND; +#else + fprintf(stderr, + "option 'b' (MS_BIND) not supported\n"); +#endif break; case 'm': +#ifdef MS_MOVE flags |= MS_MOVE; +#else + fprintf(stderr, + "option 'm' (MS_MOVE) not supported\n"); +#endif break; case 'o': orgoptions = strdup(optarg); @@ -1020,7 +1030,7 @@ int main(int argc, char ** argv) break; case 'p': if(mountpassword == NULL) - mountpassword = calloc(65,1); + mountpassword = (char *)calloc(65,1); if(mountpassword) { got_password = 1; strncpy(mountpassword,optarg,64); @@ -1045,7 +1055,7 @@ int main(int argc, char ** argv) if (getenv("PASSWD")) { if(mountpassword == NULL) - mountpassword = calloc(65,1); + mountpassword = (char *)calloc(65,1); if(mountpassword) { strncpy(mountpassword,getenv("PASSWD"),64); got_password = 1; @@ -1065,7 +1075,7 @@ int main(int argc, char ** argv) } /* BB save off path and pop after mount returns? */ - resolved_path = malloc(PATH_MAX+1); + resolved_path = (char *)malloc(PATH_MAX+1); if(resolved_path) { /* Note that if we can not canonicalize the name, we get another chance to see if it is valid when we chdir to it */ @@ -1131,7 +1141,7 @@ mount_retry: optlen += strlen(ipaddr) + 4; if(mountpassword) optlen += strlen(mountpassword) + 6; - options = malloc(optlen + 10 + 64 /* space for commas in password */ + 8 /* space for domain= , domain name itself was counted as part of the length username string above */); + options = (char *)malloc(optlen + 10 + 64 /* space for commas in password */ + 8 /* space for domain= , domain name itself was counted as part of the length username string above */); if(options == NULL) { printf("Could not allocate memory for mount options\n"); @@ -1223,7 +1233,7 @@ mount_retry: mountent.mnt_fsname = share_name; mountent.mnt_dir = mountpoint; mountent.mnt_type = CONST_DISCARD(char *,"cifs"); - mountent.mnt_opts = malloc(220); + mountent.mnt_opts = (char *)malloc(220); if(mountent.mnt_opts) { char * mount_user = getusername(); memset(mountent.mnt_opts,0,200); diff --git a/source/configure.developer b/source/configure.developer index a7074acfd3a..b8cf6d68b10 100755 --- a/source/configure.developer +++ b/source/configure.developer @@ -1,2 +1,5 @@ #!/bin/sh -`dirname $0`/configure --enable-developer "$@" +`dirname $0`/configure -C \ + --enable-developer \ + --enable-socket-wrapper \ + "$@" diff --git a/source/groupdb/mapping_ldb.c b/source/groupdb/mapping_ldb.c index 5d350e477ca..1b69b81e290 100644 --- a/source/groupdb/mapping_ldb.c +++ b/source/groupdb/mapping_ldb.c @@ -193,7 +193,7 @@ static BOOL msg_to_group_map(struct ldb_message *msg, GROUP_MAP *map) if (!string_to_sid(&map->sid, sidstr) || map->gid == (gid_t)-1 || - map->sid_name_use == (enum lsa_SidType)-1) { + map->sid_name_use == (enum SID_NAME_USE)-1) { DEBUG(0,("Unable to unpack group mapping\n")); return False; } @@ -320,7 +320,7 @@ failed: /* Enumerate the group mappings for a domain */ - BOOL enum_group_mapping(const DOM_SID *domsid, enum lsa_SidType sid_name_use, + BOOL enum_group_mapping(const DOM_SID *domsid, enum SID_NAME_USE sid_name_use, GROUP_MAP **pp_rmap, size_t *p_num_entries, BOOL unix_only) { diff --git a/source/include/ads.h b/source/include/ads.h index f70c5a6f12a..58fac369206 100644 --- a/source/include/ads.h +++ b/source/include/ads.h @@ -15,7 +15,11 @@ enum wb_posix_mapping { }; typedef struct { +#ifdef HAVE_LDAP + LDAP *ld; +#else void *ld; /* the active ldap structure */ +#endif struct in_addr ldap_ip; /* the ip of the active connection, if any */ time_t last_attempt; /* last attempt to reconnect */ int ldap_port; diff --git a/source/include/adt_tree.h b/source/include/adt_tree.h index 51b6fb1c88b..a053013a9bc 100644 --- a/source/include/adt_tree.h +++ b/source/include/adt_tree.h @@ -21,9 +21,9 @@ #ifndef ADT_TREE_H #define ADT_TREE_H -#ifndef _BOOL +#ifndef _UPPER_BOOL typedef int BOOL; -#define _BOOL +#define _UPPER_BOOL #endif diff --git a/source/include/dlinklist.h b/source/include/dlinklist.h index daec7640e40..f267e77ea6d 100644 --- a/source/include/dlinklist.h +++ b/source/include/dlinklist.h @@ -21,10 +21,13 @@ /* To use these macros you must have a structure containing a next and prev pointer */ +#ifndef _DLINKLIST_H +#define _DLINKLIST_H + /* hook into the front of the list */ #define DLIST_ADD(list, p) \ -{ \ +do { \ if (!(list)) { \ (list) = (p); \ (p)->next = (p)->prev = NULL; \ @@ -34,11 +37,11 @@ (p)->prev = NULL; \ (list) = (p); \ }\ -} +} while (0) /* remove an element from a list - element doesn't have to be in list. */ #define DLIST_REMOVE(list, p) \ -{ \ +do { \ if ((p) == (list)) { \ (list) = (p)->next; \ if (list) (list)->prev = NULL; \ @@ -47,28 +50,29 @@ if ((p)->next) (p)->next->prev = (p)->prev; \ } \ if ((p) != (list)) (p)->next = (p)->prev = NULL; \ -} +} while (0) /* promote an element to the top of the list */ #define DLIST_PROMOTE(list, p) \ -{ \ - DLIST_REMOVE(list, p) \ - DLIST_ADD(list, p) \ -} +do { \ + DLIST_REMOVE(list, p); \ + DLIST_ADD(list, p); \ +} while (0) /* hook into the end of the list - needs a tmp pointer */ -#define DLIST_ADD_END(list, p, tmp) \ -{ \ +#define DLIST_ADD_END(list, p, type) \ +do { \ if (!(list)) { \ (list) = (p); \ (p)->next = (p)->prev = NULL; \ } else { \ - for ((tmp) = (list); (tmp)->next; (tmp) = (tmp)->next) ; \ - (tmp)->next = (p); \ + type tmp; \ + for (tmp = (list); tmp->next; tmp = tmp->next) ; \ + tmp->next = (p); \ (p)->next = NULL; \ - (p)->prev = (tmp); \ + (p)->prev = tmp; \ } \ -} +} while (0) /* insert 'p' after the given element 'el' in a list. If el is NULL then this is the same as a DLIST_ADD() */ @@ -84,9 +88,27 @@ do { \ }\ } while (0) -/* demote an element to the top of the list, needs a tmp pointer */ +/* demote an element to the end of the list, needs a tmp pointer */ #define DLIST_DEMOTE(list, p, tmp) \ -{ \ - DLIST_REMOVE(list, p) \ - DLIST_ADD_END(list, p, tmp) \ -} +do { \ + DLIST_REMOVE(list, p); \ + DLIST_ADD_END(list, p, tmp); \ +} while (0) + +/* concatenate two lists - putting all elements of the 2nd list at the + end of the first list */ +#define DLIST_CONCATENATE(list1, list2, type) \ +do { \ + if (!(list1)) { \ + (list1) = (list2); \ + } else { \ + type tmp; \ + for (tmp = (list1); tmp->next; tmp = tmp->next) ; \ + tmp->next = (list2); \ + if (list2) { \ + (list2)->prev = tmp; \ + } \ + } \ +} while (0) + +#endif /* _DLINKLIST_H */ diff --git a/source/include/local.h b/source/include/local.h index fb931976362..6d32f4fe6e9 100644 --- a/source/include/local.h +++ b/source/include/local.h @@ -247,4 +247,7 @@ /* Default hash size for the winbindd cache. */ #define WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE 5000 +/* Windows minimum lock resolution timeout in ms */ +#define WINDOWS_MINIMUM_LOCK_TIMEOUT_MS 200 + #endif diff --git a/source/include/messages.h b/source/include/messages.h index e246123ea9f..b0305373c0d 100644 --- a/source/include/messages.h +++ b/source/include/messages.h @@ -70,6 +70,7 @@ #define MSG_SMB_KERNEL_BREAK 3010 #define MSG_SMB_FILE_RENAME 3011 #define MSG_SMB_INJECT_FAULT 3012 +#define MSG_SMB_BLOCKING_LOCK_CANCEL 3013 /* winbind messages */ #define MSG_WINBIND_FINISHED 4001 diff --git a/source/include/privileges.h b/source/include/privileges.h index 3f425f6d728..eac42e0ba93 100644 --- a/source/include/privileges.h +++ b/source/include/privileges.h @@ -93,9 +93,9 @@ typedef struct { uint32 attr; } LUID_ATTR; -#ifndef _BOOL +#ifndef _UPPER_BOOL typedef int BOOL; -#define _BOOL /* So we don't typedef BOOL again in vfs.h */ +#define _UPPER_BOOL #endif typedef struct { diff --git a/source/include/socket_wrapper.h b/source/include/socket_wrapper.h deleted file mode 100644 index d8815a25757..00000000000 --- a/source/include/socket_wrapper.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright (C) Jelmer Vernooij 2005 <jelmer@samba.org> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#ifndef __SOCKET_WRAPPER_H__ -#define __SOCKET_WRAPPER_H__ - -int swrap_socket(int domain, int type, int protocol); -int swrap_accept(int s, struct sockaddr *addr, socklen_t *addrlen); -int swrap_connect(int s, const struct sockaddr *serv_addr, socklen_t addrlen); -int swrap_bind(int s, const struct sockaddr *myaddr, socklen_t addrlen); -int swrap_getpeername(int s, struct sockaddr *name, socklen_t *addrlen); -int swrap_getsockname(int s, struct sockaddr *name, socklen_t *addrlen); -int swrap_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen); -int swrap_setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen); -ssize_t swrap_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen); -ssize_t swrap_sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); -int swrap_close(int); - -#ifdef SOCKET_WRAPPER_REPLACE -#define accept(s,addr,addrlen) swrap_accept(s,addr,addrlen) -#define connect(s,serv_addr,addrlen) swrap_connect(s,serv_addr,addrlen) -#define bind(s,myaddr,addrlen) swrap_bind(s,myaddr,addrlen) -#define getpeername(s,name,addrlen) swrap_getpeername(s,name,addrlen) -#define getsockname(s,name,addrlen) swrap_getsockname(s,name,addrlen) -#define getsockopt(s,level,optname,optval,optlen) swrap_getsockopt(s,level,optname,optval,optlen) -#define setsockopt(s,level,optname,optval,optlen) swrap_setsockopt(s,level,optname,optval,optlen) -#define recvfrom(s,buf,len,flags,from,fromlen) swrap_recvfrom(s,buf,len,flags,from,fromlen) -#define sendto(s,buf,len,flags,to,tolen) swrap_sendto(s,buf,len,flags,to,tolen) -#define socket(domain,type,protocol) swrap_socket(domain,type,protocol) -#define close(s) swrap_close(s) -#endif - -#endif /* __SOCKET_WRAPPER_H__ */ diff --git a/source/include/talloc.h b/source/include/talloc.h deleted file mode 100644 index 17032ac7acc..00000000000 --- a/source/include/talloc.h +++ /dev/null @@ -1,145 +0,0 @@ -#ifndef _TALLOC_H_ -#define _TALLOC_H_ -/* - Unix SMB/CIFS implementation. - Samba temporary memory allocation functions - - Copyright (C) Andrew Tridgell 2004-2005 - - ** NOTE! The following LGPL license applies to the talloc - ** library. This does NOT imply that all of Samba is released - ** under the LGPL - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* this is only needed for compatibility with the old talloc */ -typedef void TALLOC_CTX; - -/* - this uses a little trick to allow __LINE__ to be stringified -*/ -#define _STRING_LINE_(s) #s -#define _STRING_LINE2_(s) _STRING_LINE_(s) -#define __LINESTR__ _STRING_LINE2_(__LINE__) -#define __location__ __FILE__ ":" __LINESTR__ - -#ifndef TALLOC_DEPRECATED -#define TALLOC_DEPRECATED 0 -#endif - -/* useful macros for creating type checked pointers */ -#define talloc(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type) -#define talloc_size(ctx, size) talloc_named_const(ctx, size, __location__) - -#define talloc_new(ctx) talloc_named_const(ctx, 0, "talloc_new: " __location__) - -#define talloc_zero(ctx, type) (type *)_talloc_zero(ctx, sizeof(type), #type) -#define talloc_zero_size(ctx, size) _talloc_zero(ctx, size, __location__) - -#define talloc_zero_array(ctx, type, count) (type *)_talloc_zero_array(ctx, sizeof(type), count, #type) -#define talloc_array(ctx, type, count) (type *)_talloc_array(ctx, sizeof(type), count, #type) -#define talloc_array_size(ctx, size, count) _talloc_array(ctx, size, count, __location__) - -#define talloc_realloc(ctx, p, type, count) (type *)_talloc_realloc_array(ctx, p, sizeof(type), count, #type) -#define talloc_realloc_size(ctx, ptr, size) _talloc_realloc(ctx, ptr, size, __location__) - -#define talloc_memdup(t, p, size) _talloc_memdup(t, p, size, __location__) - -#define malloc_p(type) (type *)malloc(sizeof(type)) -#define malloc_array_p(type, count) (type *)realloc_array(NULL, sizeof(type), count) -#define realloc_p(p, type, count) (type *)realloc_array(p, sizeof(type), count) - -#if 0 -/* Not correct for Samba3. */ -#define data_blob(ptr, size) data_blob_named(ptr, size, "DATA_BLOB: "__location__) -#define data_blob_talloc(ctx, ptr, size) data_blob_talloc_named(ctx, ptr, size, "DATA_BLOB: "__location__) -#define data_blob_dup_talloc(ctx, blob) data_blob_talloc_named(ctx, (blob)->data, (blob)->length, "DATA_BLOB: "__location__) -#endif - -#define talloc_set_type(ptr, type) talloc_set_name_const(ptr, #type) -#define talloc_get_type(ptr, type) (type *)talloc_check_name(ptr, #type) - -#define talloc_find_parent_bytype(ptr, type) (type *)talloc_find_parent_byname(ptr, #type) - - -#if TALLOC_DEPRECATED -#define talloc_zero_p(ctx, type) talloc_zero(ctx, type) -#define talloc_p(ctx, type) talloc(ctx, type) -#define talloc_array_p(ctx, type, count) talloc_array(ctx, type, count) -#define talloc_realloc_p(ctx, p, type, count) talloc_realloc(ctx, p, type, count) -#define talloc_destroy(ctx) talloc_free(ctx) -#endif - -#ifndef PRINTF_ATTRIBUTE -#if (__GNUC__ >= 3) -/** Use gcc attribute to check printf fns. a1 is the 1-based index of - * the parameter containing the format, and a2 the index of the first - * argument. Note that some gcc 2.x versions don't handle this - * properly **/ -#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2))) -#else -#define PRINTF_ATTRIBUTE(a1, a2) -#endif -#endif - - -/* The following definitions come from talloc.c */ -void *_talloc(const void *context, size_t size); -void talloc_set_destructor(const void *ptr, int (*destructor)(void *)); -void talloc_increase_ref_count(const void *ptr); -void *talloc_reference(const void *context, const void *ptr); -int talloc_unlink(const void *context, void *ptr); -void talloc_set_name(const void *ptr, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); -void talloc_set_name_const(const void *ptr, const char *name); -void *talloc_named(const void *context, size_t size, - const char *fmt, ...) PRINTF_ATTRIBUTE(3,4); -void *talloc_named_const(const void *context, size_t size, const char *name); -const char *talloc_get_name(const void *ptr); -void *talloc_check_name(const void *ptr, const char *name); -void talloc_report_depth(const void *ptr, FILE *f, int depth); -void *talloc_parent(const void *ptr); -void *talloc_init(const char *fmt, ...) PRINTF_ATTRIBUTE(1,2); -int talloc_free(void *ptr); -void *_talloc_realloc(const void *context, void *ptr, size_t size, const char *name); -void *talloc_steal(const void *new_ctx, const void *ptr); -off_t talloc_total_size(const void *ptr); -off_t talloc_total_blocks(const void *ptr); -void talloc_report_full(const void *ptr, FILE *f); -void talloc_report(const void *ptr, FILE *f); -void talloc_enable_null_tracking(void); -void talloc_enable_leak_report(void); -void talloc_enable_leak_report_full(void); -void *_talloc_zero(const void *ctx, size_t size, const char *name); -void *_talloc_memdup(const void *t, const void *p, size_t size, const char *name); -char *talloc_strdup(const void *t, const char *p); -char *talloc_strndup(const void *t, const char *p, size_t n); -char *talloc_append_string(const void *t, char *orig, const char *append); -char *talloc_vasprintf(const void *t, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2,0); -char *talloc_asprintf(const void *t, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); -char *talloc_asprintf_append(char *s, - const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); -void *_talloc_array(const void *ctx, size_t el_size, unsigned count, const char *name); -void *_talloc_zero_array(const void *ctx, size_t el_size, unsigned count, const char *name); -void *_talloc_realloc_array(const void *ctx, void *ptr, size_t el_size, unsigned count, const char *name); -void *talloc_realloc_fn(const void *context, void *ptr, size_t size); -void *talloc_autofree_context(void); -size_t talloc_get_size(const void *ctx); -void *talloc_find_parent_byname(const void *ctx, const char *name); -void talloc_show_parents(const void *context, FILE *file); -int talloc_is_parent(const void *context, const char *ptr); - -#endif - diff --git a/source/lib/smbldap.c b/source/lib/smbldap.c index a63e1c1bcc3..575e6fa06d7 100644 --- a/source/lib/smbldap.c +++ b/source/lib/smbldap.c @@ -574,7 +574,6 @@ static void smbldap_store_state(LDAP *ld, struct smbldap_state *smbldap_state) { struct smbldap_state *tmp_ldap_state; struct smbldap_state_lookup *t; - struct smbldap_state_lookup *tmp; if ((tmp_ldap_state = smbldap_find_state(ld))) { SMB_ASSERT(tmp_ldap_state == smbldap_state); @@ -584,7 +583,7 @@ static void smbldap_store_state(LDAP *ld, struct smbldap_state *smbldap_state) t = SMB_XMALLOC_P(struct smbldap_state_lookup); ZERO_STRUCTP(t); - DLIST_ADD_END(smbldap_state_lookup_list, t, tmp); + DLIST_ADD_END(smbldap_state_lookup_list, t, struct smbldap_state_lookup *); t->ld = ld; t->smbldap_state = smbldap_state; } @@ -1289,7 +1288,7 @@ int smbldap_search_paged(struct smbldap_state *ldap_state, /* construct cookie */ if (*cookie != NULL) { ber_printf(cookie_be, "{iO}", (ber_int_t) pagesize, *cookie); - ber_bvfree(*cookie); /* don't need it from last time */ + ber_bvfree((struct berval *)*cookie); /* don't need it from last time */ *cookie = NULL; } else { ber_printf(cookie_be, "{io}", (ber_int_t) pagesize, "", 0); diff --git a/source/libsmb/clikrb5.c b/source/libsmb/clikrb5.c index 14b5285e45a..485f5abc0a8 100644 --- a/source/libsmb/clikrb5.c +++ b/source/libsmb/clikrb5.c @@ -852,27 +852,6 @@ failed: #endif } -static int get_kvno_from_ap_req(krb5_ap_req *ap_req) -{ -#ifdef HAVE_TICKET_POINTER_IN_KRB5_AP_REQ /* MIT */ - if (ap_req->ticket->enc_part.kvno) - return ap_req->ticket->enc_part.kvno; -#else /* Heimdal */ - if (ap_req->ticket.enc_part.kvno) - return *ap_req->ticket.enc_part.kvno; -#endif - return 0; -} - -static krb5_enctype get_enctype_from_ap_req(krb5_ap_req *ap_req) -{ -#ifdef HAVE_ETYPE_IN_ENCRYPTEDDATA /* Heimdal */ - return ap_req->ticket.enc_part.etype; -#else /* MIT */ - return ap_req->ticket->enc_part.enctype; -#endif -} - static krb5_error_code get_key_from_keytab(krb5_context context, krb5_const_principal server, diff --git a/source/printing/notify.c b/source/printing/notify.c index f27eb2011ff..7d5b7027819 100644 --- a/source/printing/notify.c +++ b/source/printing/notify.c @@ -99,7 +99,7 @@ again: msg->len, msg->notify.data); if (buflen != len) { - buf = TALLOC_REALLOC(send_ctx, buf, len); + buf = (char *)TALLOC_REALLOC(send_ctx, buf, len); if (!buf) return False; buflen = len; @@ -140,7 +140,7 @@ static void print_notify_send_messages_to_printer(const char *printer, unsigned } offset += 4; /* For count. */ - buf = TALLOC(send_ctx, offset); + buf = (char *)TALLOC(send_ctx, offset); if (!buf) { DEBUG(0,("print_notify_send_messages: Out of memory\n")); talloc_free_children(send_ctx); @@ -220,7 +220,7 @@ static BOOL copy_notify2_msg( SPOOLSS_NOTIFY_MSG *to, SPOOLSS_NOTIFY_MSG *from ) memcpy( to, from, sizeof(SPOOLSS_NOTIFY_MSG) ); if ( from->len ) { - to->notify.data = TALLOC_MEMDUP(send_ctx, from->notify.data, from->len ); + to->notify.data = (char *)TALLOC_MEMDUP(send_ctx, from->notify.data, from->len ); if ( !to->notify.data ) { DEBUG(0,("copy_notify2_msg: talloc_memdup() of size [%d] failed!\n", from->len )); return False; @@ -295,7 +295,7 @@ to notify_queue_head\n", msg->type, msg->field, msg->printer)); * the messages are sent in the order they were received. JRA. */ - DLIST_ADD_END(notify_queue_head, pnqueue, tmp_ptr); + DLIST_ADD_END(notify_queue_head, pnqueue, struct notify_queue *); num_messages++; } diff --git a/source/smbd/blocking.c b/source/smbd/blocking.c index a8db498ef5a..934857c2c09 100644 --- a/source/smbd/blocking.c +++ b/source/smbd/blocking.c @@ -80,7 +80,7 @@ BOOL push_blocking_lock_request( char *inbuf, int length, SMB_BIG_UINT offset, SMB_BIG_UINT count) { static BOOL set_lock_msg; - blocking_lock_record *blr, *tmp; + blocking_lock_record *blr; BOOL my_lock_ctx = False; struct byte_range_lock *br_lck = NULL; NTSTATUS status; @@ -144,7 +144,7 @@ BOOL push_blocking_lock_request( char *inbuf, int length, return False; } - DLIST_ADD_END(blocking_lock_queue, blr, tmp); + DLIST_ADD_END(blocking_lock_queue, blr, blocking_lock_record *); /* Ensure we'll receive messages when this is unlocked. */ if (!set_lock_msg) { diff --git a/source/smbd/nttrans.c b/source/smbd/nttrans.c index aa6f79e1657..edd57a3917d 100644 --- a/source/smbd/nttrans.c +++ b/source/smbd/nttrans.c @@ -52,7 +52,7 @@ static char *nttrans_realloc(char **ptr, size_t size) smb_panic("nttrans_realloc() called with NULL ptr\n"); } - *ptr = SMB_REALLOC(*ptr, size); + *ptr = (char *)SMB_REALLOC(*ptr, size); if(*ptr == NULL) { return NULL; } @@ -1060,14 +1060,13 @@ static struct ea_list *read_nttrans_ea_list(TALLOC_CTX *ctx, const char *pdata, while (offset + 4 <= data_size) { size_t next_offset = IVAL(pdata,offset); - struct ea_list *tmp; struct ea_list *eal = read_ea_list_entry(ctx, pdata + offset + 4, data_size - offset - 4, NULL); if (!eal) { return NULL; } - DLIST_ADD_END(ea_list_head, eal, tmp); + DLIST_ADD_END(ea_list_head, eal, struct ea_list *); if (next_offset == 0) { break; } diff --git a/source/smbd/posix_acls.c b/source/smbd/posix_acls.c index 8466528f1b4..1c2cf3091fe 100644 --- a/source/smbd/posix_acls.c +++ b/source/smbd/posix_acls.c @@ -1241,7 +1241,6 @@ static BOOL create_canon_ace_lists(files_struct *fsp, SMB_STRUCT_STAT *pst, BOOL all_aces_are_inherit_only = (fsp->is_directory ? True : False); canon_ace *file_ace = NULL; canon_ace *dir_ace = NULL; - canon_ace *tmp_ace = NULL; canon_ace *current_ace = NULL; BOOL got_dir_allow = False; BOOL got_file_allow = False; @@ -1429,7 +1428,7 @@ static BOOL create_canon_ace_lists(files_struct *fsp, SMB_STRUCT_STAT *pst, if ((psa->flags & (SEC_ACE_FLAG_OBJECT_INHERIT|SEC_ACE_FLAG_CONTAINER_INHERIT)) == (SEC_ACE_FLAG_OBJECT_INHERIT|SEC_ACE_FLAG_CONTAINER_INHERIT)) { - DLIST_ADD_END(dir_ace, current_ace, tmp_ace); + DLIST_ADD_END(dir_ace, current_ace, canon_ace *); /* * Note if this was an allow ace. We can't process @@ -1487,7 +1486,7 @@ Deny entry after Allow entry. Failing to set on file %s.\n", fsp->fsp_name )); */ if (current_ace && !(psa->flags & SEC_ACE_FLAG_INHERIT_ONLY)) { - DLIST_ADD_END(file_ace, current_ace, tmp_ace); + DLIST_ADD_END(file_ace, current_ace, canon_ace *); /* * Note if this was an allow ace. We can't process @@ -1734,7 +1733,6 @@ static void process_deny_list( canon_ace **pp_ace_list ) for (curr_ace = ace_list; curr_ace; curr_ace = curr_ace_next) { mode_t new_perms = (mode_t)0; canon_ace *allow_ace_p; - canon_ace *tmp_ace; curr_ace_next = curr_ace->next; /* So we can't lose the link. */ @@ -1753,7 +1751,7 @@ static void process_deny_list( canon_ace **pp_ace_list ) curr_ace->attr = ALLOW_ACE; curr_ace->perms = (mode_t)0; - DLIST_DEMOTE(ace_list, curr_ace, tmp_ace); + DLIST_DEMOTE(ace_list, curr_ace, canon_ace *); continue; } @@ -1778,13 +1776,12 @@ static void process_deny_list( canon_ace **pp_ace_list ) curr_ace->attr = ALLOW_ACE; curr_ace->perms = (new_perms & ~curr_ace->perms); - DLIST_DEMOTE(ace_list, curr_ace, tmp_ace); + DLIST_DEMOTE(ace_list, curr_ace, canon_ace *); } /* Pass 3 above - deal with deny group entries. */ for (curr_ace = ace_list; curr_ace; curr_ace = curr_ace_next) { - canon_ace *tmp_ace; canon_ace *allow_ace_p; canon_ace *allow_everyone_p = NULL; @@ -1826,8 +1823,7 @@ static void process_deny_list( canon_ace **pp_ace_list ) curr_ace->perms = allow_everyone_p->perms & ~curr_ace->perms; else curr_ace->perms = (mode_t)0; - DLIST_DEMOTE(ace_list, curr_ace, tmp_ace); - + DLIST_DEMOTE(ace_list, curr_ace, canon_ace *); } /* Doing this fourth pass allows Windows semantics to be layered @@ -2067,7 +2063,7 @@ static void arrange_posix_perms( char *filename, canon_ace **pp_list_head) } if (other_ace) { - DLIST_DEMOTE(list_head, other_ace, ace); + DLIST_DEMOTE(list_head, other_ace, canon_ace *); } /* We have probably changed the head of the list. */ diff --git a/source/smbd/process.c b/source/smbd/process.c index b3ce49360d8..987fa08d0ff 100644 --- a/source/smbd/process.c +++ b/source/smbd/process.c @@ -75,7 +75,6 @@ static BOOL push_queued_message(char *buf, int msg_len, struct timeval end_time, char *private_data, size_t private_len) { - struct pending_message_list *tmp_msg; struct pending_message_list *msg; msg = TALLOC_ZERO_P(NULL, struct pending_message_list); @@ -105,7 +104,7 @@ static BOOL push_queued_message(char *buf, int msg_len, } } - DLIST_ADD_END(deferred_open_queue, msg, tmp_msg); + DLIST_ADD_END(deferred_open_queue, msg, struct pending_message_list *); DEBUG(10,("push_message: pushed message length %u on " "deferred_open_queue\n", (unsigned int)msg_len)); diff --git a/source/smbd/trans2.c b/source/smbd/trans2.c index a3b872e855f..00357c2a35e 100644 --- a/source/smbd/trans2.c +++ b/source/smbd/trans2.c @@ -170,7 +170,7 @@ static struct ea_list *get_ea_list_from_file(TALLOC_CTX *mem_ctx, connection_str return NULL; } - for (i = 0, ea_namelist = TALLOC(mem_ctx, ea_namelist_size); i < 6; + for (i = 0, ea_namelist = TALLOC_ARRAY(mem_ctx, char, ea_namelist_size); i < 6; ea_namelist = TALLOC_REALLOC_ARRAY(mem_ctx, ea_namelist, char, ea_namelist_size), i++) { if (!ea_namelist) { @@ -197,7 +197,7 @@ static struct ea_list *get_ea_list_from_file(TALLOC_CTX *mem_ctx, connection_str if (sizeret) { for (p = ea_namelist; p - ea_namelist < sizeret; p += strlen(p) + 1) { - struct ea_list *listp, *tmp; + struct ea_list *listp; if (strnequal(p, "system.", 7) || samba_private_attr_name(p)) continue; @@ -218,7 +218,7 @@ static struct ea_list *get_ea_list_from_file(TALLOC_CTX *mem_ctx, connection_str (unsigned int)*pea_total_len, dos_ea_name, (unsigned int)listp->ea.value.length )); } - DLIST_ADD_END(ea_list_head, listp, tmp); + DLIST_ADD_END(ea_list_head, listp, struct ea_list *); } /* Add on 4 for total length. */ if (*pea_total_len) { @@ -396,7 +396,6 @@ static struct ea_list *read_ea_name_list(TALLOC_CTX *ctx, const char *pdata, siz size_t offset = 0; while (offset + 2 < data_size) { - struct ea_list *tmp; struct ea_list *eal = TALLOC_ZERO_P(ctx, struct ea_list); unsigned int namelen = CVAL(pdata,offset); @@ -418,7 +417,7 @@ static struct ea_list *read_ea_name_list(TALLOC_CTX *ctx, const char *pdata, siz } offset += (namelen + 1); /* Go past the name + terminating zero. */ - DLIST_ADD_END(ea_list_head, eal, tmp); + DLIST_ADD_END(ea_list_head, eal, struct ea_list *); DEBUG(10,("read_ea_name_list: read ea name %s\n", eal->ea.name)); } @@ -493,14 +492,13 @@ static struct ea_list *read_ea_list(TALLOC_CTX *ctx, const char *pdata, size_t d size_t bytes_used = 0; while (offset < data_size) { - struct ea_list *tmp; struct ea_list *eal = read_ea_list_entry(ctx, pdata + offset, data_size - offset, &bytes_used); if (!eal) { return NULL; } - DLIST_ADD_END(ea_list_head, eal, tmp); + DLIST_ADD_END(ea_list_head, eal, struct ea_list *); offset += bytes_used; } @@ -899,7 +897,7 @@ static int call_trans2open(connection_struct *conn, char *inbuf, char *outbuf, i } /* Realloc the size of parameters and data we will return */ - *pparams = SMB_REALLOC(*pparams, 30); + *pparams = (char *)SMB_REALLOC(*pparams, 30); if(*pparams == NULL ) { return ERROR_NT(NT_STATUS_NO_MEMORY); } @@ -1070,7 +1068,7 @@ static BOOL get_lanman2_dir_entry(connection_struct *conn, BOOL was_8_3; uint32 nt_extmode; /* Used for NT connections instead of mode */ BOOL needslash = ( conn->dirpath[strlen(conn->dirpath) -1] != '/'); - BOOL check_mangled_names = lp_manglednames(SNUM(conn)); + BOOL check_mangled_names = lp_manglednames(conn->params); *fname = 0; *out_of_space = False; @@ -3854,7 +3852,7 @@ static int call_trans2setfilepathinfo(connection_struct *conn, char *inbuf, char tran_call,fname, fsp ? fsp->fnum : -1, info_level,total_data)); /* Realloc the parameter size */ - *pparams = SMB_REALLOC(*pparams,2); + *pparams = (char *)SMB_REALLOC(*pparams,2); if (*pparams == NULL) { return ERROR_NT(NT_STATUS_NO_MEMORY); } @@ -4830,7 +4828,7 @@ static int call_trans2mkdir(connection_struct *conn, char *inbuf, char *outbuf, } /* Realloc the parameter and data sizes */ - *pparams = SMB_REALLOC(*pparams,2); + *pparams = (char *)SMB_REALLOC(*pparams,2); if(*pparams == NULL) { return ERROR_NT(NT_STATUS_NO_MEMORY); } @@ -4872,7 +4870,7 @@ static int call_trans2findnotifyfirst(connection_struct *conn, char *inbuf, char } /* Realloc the parameter and data sizes */ - *pparams = SMB_REALLOC(*pparams,6); + *pparams = (char *)SMB_REALLOC(*pparams,6); if (*pparams == NULL) { return ERROR_NT(NT_STATUS_NO_MEMORY); } @@ -4906,7 +4904,7 @@ static int call_trans2findnotifynext(connection_struct *conn, char *inbuf, char DEBUG(3,("call_trans2findnotifynext\n")); /* Realloc the parameter and data sizes */ - *pparams = SMB_REALLOC(*pparams,4); + *pparams = (char *)SMB_REALLOC(*pparams,4); if (*pparams == NULL) { return ERROR_NT(NT_STATUS_NO_MEMORY); } @@ -4975,7 +4973,7 @@ static int call_trans2ioctl(connection_struct *conn, char* inbuf, char* outbuf, if ((SVAL(inbuf,(smb_setup+4)) == LMCAT_SPL) && (SVAL(inbuf,(smb_setup+6)) == LMFUNC_GETJOBID)) { - *ppdata = SMB_REALLOC(*ppdata, 32); + *ppdata = (char *)SMB_REALLOC(*ppdata, 32); if (*ppdata == NULL) { return ERROR_NT(NT_STATUS_NO_MEMORY); } |