Commit e0da56a8 authored by Jeremy Allison's avatar Jeremy Allison Committed by Gerald (Jerry) Carter
Browse files

r570: Remove lots of globals to handle case issues - move them

to connection struct entries (as they should have been from
the start). Jerry, once you've cut over to 3.0.4 release
branch I'll add this to 3.0 also.
- Jerry cut over :-).
Jeremy.
(This used to be commit 578a508509d21226ad3332fc54c3ab54cd8ae452)
parent 5cb65233
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9,6 +9,6 @@ struct mangle_fns {
	BOOL (*is_8_3)(const char *fname, BOOL check_case, BOOL allow_wildcards);
	void (*reset)(void);
	BOOL (*check_cache)(char *s);
	void (*name_map)(char *OutName, BOOL need83, BOOL cache83);
	void (*name_map)(char *OutName, BOOL need83, BOOL cache83, int default_case);
};
#endif /* _MANGLE_H_ */
+5 −0
Original line number Diff line number Diff line
@@ -503,6 +503,11 @@ typedef struct connection_struct
	time_t lastused;
	BOOL used;
	int num_files_open;

	BOOL case_sensitive;
	BOOL case_preserve;
	BOOL short_case_preserve;

	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. */       
+3 −3
Original line number Diff line number Diff line
@@ -122,9 +122,9 @@
#define MAP_HIDDEN(conn)   ((conn) && lp_map_hidden((conn)->service))
#define MAP_SYSTEM(conn)   ((conn) && lp_map_system((conn)->service))
#define MAP_ARCHIVE(conn)   ((conn) && lp_map_archive((conn)->service))
#define IS_HIDDEN_PATH(conn,path)  ((conn) && is_in_path((path),(conn)->hide_list))
#define IS_VETO_PATH(conn,path)  ((conn) && is_in_path((path),(conn)->veto_list))
#define IS_VETO_OPLOCK_PATH(conn,path)  ((conn) && is_in_path((path),(conn)->veto_oplock_list))
#define IS_HIDDEN_PATH(conn,path)  ((conn) && is_in_path((path),(conn)->hide_list,(conn)->case_sensitive))
#define IS_VETO_PATH(conn,path)  ((conn) && is_in_path((path),(conn)->veto_list,(conn)->case_sensitive))
#define IS_VETO_OPLOCK_PATH(conn,path)  ((conn) && is_in_path((path),(conn)->veto_oplock_list,(conn)->case_sensitive))

/* 
 * Used by the stat cache code to check if a returned
+2 −15
Original line number Diff line number Diff line
@@ -63,19 +63,6 @@ int chain_size = 0;

int trans_num = 0;

/*
   case handling on filenames 
*/
int case_default = CASE_LOWER;

/* the following control case operations - they are put here so the
   client can link easily */
BOOL case_sensitive;
BOOL case_preserve;
BOOL use_mangled_map = False;
BOOL short_case_preserve;
BOOL case_mangle;

static enum remote_arch_types ra_type = RA_UNKNOWN;
pstring user_socket_options=DEFAULT_SOCKET_OPTIONS;   

@@ -609,7 +596,7 @@ void unix_clean_name(char *s)
 Make a dir struct.
****************************************************************************/

void make_dir_struct(char *buf, const char *mask, const char *fname,SMB_OFF_T size,int mode,time_t date)
void make_dir_struct(char *buf, const char *mask, const char *fname,SMB_OFF_T size,int mode,time_t date, BOOL case_sensitive)
{  
	char *p;
	pstring mask2;
@@ -1500,7 +1487,7 @@ 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 is_in_path(const char *name, name_compare_entry *namelist, BOOL case_sensitive)
{
	pstring last_component;
	char *p;
+2 −4
Original line number Diff line number Diff line
@@ -334,9 +334,8 @@ char *strupper_static(const char *s)
 Convert a string to "normal" form.
**/

void strnorm(char *s)
void strnorm(char *s, int case_default)
{
	extern int case_default;
	if (case_default == CASE_UPPER)
		strupper_m(s);
	else
@@ -347,9 +346,8 @@ void strnorm(char *s)
 Check if a string is in "normal" case.
**/

BOOL strisnormal(const char *s)
BOOL strisnormal(const char *s, int case_default)
{
	extern int case_default;
	if (case_default == CASE_UPPER)
		return(!strhaslower(s));
	
Loading