From: Ralph Boehme Date: Sat, 20 Jan 2024 18:12:09 +0000 (+0100) Subject: s3/lib: remove name_compare_entry typedef X-Git-Tag: tdb-1.4.11~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0c6725a73ce8c595f276b304aace8978784f2b78;p=thirdparty%2Fsamba.git s3/lib: remove name_compare_entry typedef Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- diff --git a/source3/include/proto.h b/source3/include/proto.h index 1db239f0559..639f93c237f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -315,9 +315,12 @@ gid_t nametogid(const char *name); void smb_panic_s3(const char *why); void log_panic_action(const char *msg); const char *readdirname(DIR *p); -bool is_in_path(const char *name, name_compare_entry *namelist, bool case_sensitive); -void set_namearray(name_compare_entry **ppname_array, const char *namelist); -void free_namearray(name_compare_entry *name_array); +bool is_in_path(const char *name, + struct name_compare_entry *namelist, + bool case_sensitive); +void set_namearray(struct name_compare_entry **ppname_array, + const char *namelist); +void free_namearray(struct name_compare_entry *name_array); bool fcntl_lock(int fd, int op, off_t offset, off_t count, int type); bool fcntl_getlock(int fd, int op, off_t *poffset, off_t *pcount, int *ptype, pid_t *ppid); int map_process_lock_to_ofd_lock(int op); diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 1e2e88d65ce..56fe0a69195 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -702,10 +702,10 @@ struct vuid_cache { struct vuid_cache_entry array[VUID_CACHE_SIZE]; }; -typedef struct { +struct name_compare_entry { char *name; bool is_wild; -} name_compare_entry; +}; struct share_params { int service; @@ -767,10 +767,10 @@ typedef struct connection_struct { Used to ensure unique FileIndex returns. */ SMB_DEV_T base_share_dev; - name_compare_entry *hide_list; /* Per-share list of files to return as hidden. */ - name_compare_entry *veto_list; /* Per-share list of files to veto (never show). */ - name_compare_entry *veto_oplock_list; /* Per-share list of files to refuse oplocks on. */ - name_compare_entry *aio_write_behind_list; /* Per-share list of files to use aio write behind on. */ + struct name_compare_entry *hide_list; /* Per-share list of files to return as hidden. */ + struct name_compare_entry *veto_list; /* Per-share list of files to veto (never show). */ + struct name_compare_entry *veto_oplock_list; /* Per-share list of files to refuse oplocks on. */ + struct name_compare_entry *aio_write_behind_list; /* Per-share list of files to use aio write behind on. */ struct trans_state *pending_trans; struct rpc_pipe_client *spoolss_pipe; diff --git a/source3/lib/namearray.c b/source3/lib/namearray.c index e5c3bd983b5..f66dd0ae46b 100644 --- a/source3/lib/namearray.c +++ b/source3/lib/namearray.c @@ -26,7 +26,7 @@ Routine to free a namearray. ****************************************************************************/ -void free_namearray(name_compare_entry *name_array) +void free_namearray(struct name_compare_entry *name_array) { int i; diff --git a/source3/lib/util.c b/source3/lib/util.c index 0deda2394f4..d7d1c48aa98 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -747,7 +747,9 @@ const char *readdirname(DIR *p) of a path matches a (possibly wildcarded) entry in a namelist. ********************************************************************/ -bool is_in_path(const char *name, name_compare_entry *namelist, bool case_sensitive) +bool is_in_path(const char *name, + struct name_compare_entry *namelist, + bool case_sensitive) { const char *last_component; @@ -800,7 +802,7 @@ bool is_in_path(const char *name, name_compare_entry *namelist, bool case_sensit if possible. ********************************************************************/ -void set_namearray(name_compare_entry **ppname_array, const char *namelist_in) +void set_namearray(struct name_compare_entry **ppname_array, const char *namelist_in) { char *name_end; char *namelist; @@ -855,7 +857,7 @@ void set_namearray(name_compare_entry **ppname_array, const char *namelist_in) return; } - if(( (*ppname_array) = SMB_MALLOC_ARRAY(name_compare_entry, num_entries + 1)) == NULL) { + if(( (*ppname_array) = SMB_MALLOC_ARRAY(struct name_compare_entry, num_entries + 1)) == NULL) { DEBUG(0,("set_namearray: malloc fail\n")); talloc_free(namelist); return; diff --git a/source3/modules/vfs_virusfilter_common.h b/source3/modules/vfs_virusfilter_common.h index 24359bf5a3a..988d384d74d 100644 --- a/source3/modules/vfs_virusfilter_common.h +++ b/source3/modules/vfs_virusfilter_common.h @@ -78,10 +78,10 @@ struct virusfilter_config { size_t min_file_size; /* Exclude files */ - name_compare_entry *exclude_files; + struct name_compare_entry *exclude_files; /* Infected files */ - name_compare_entry *infected_files; + struct name_compare_entry *infected_files; /* Scan result cache */ struct virusfilter_cache *cache; diff --git a/source3/torture/test_matching.c b/source3/torture/test_matching.c index 647b758a34a..5c2f75bfbfe 100644 --- a/source3/torture/test_matching.c +++ b/source3/torture/test_matching.c @@ -24,7 +24,7 @@ bool run_str_match_mswild(int dummy) { const char *namelist = "/abc*.txt/xyz*.dat/a0123456789Z/"; - name_compare_entry *name_entries = NULL; + struct name_compare_entry *name_entries = NULL; struct samba_path_matching *pmcs = NULL; struct samba_path_matching *pmci = NULL; const struct str_match_mswild_name {