mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
r5183: Ensure we correctly set the per-connection "case_sensitive" setting.
Rename dptrs_open to the more correct dirhandles_open.
Remove old #if 1.
Jeremy.
(This used to be commit c43bae306a
)
This commit is contained in:
parent
4523bd1446
commit
91ef89daa0
@ -57,7 +57,7 @@ struct dptr_struct {
|
||||
|
||||
static struct bitmap *dptr_bmap;
|
||||
static struct dptr_struct *dirptrs;
|
||||
static int dptrs_open = 0;
|
||||
static int dirhandles_open = 0;
|
||||
|
||||
#define INVALID_DPTR_KEY (-3)
|
||||
|
||||
@ -135,7 +135,7 @@ static struct dptr_struct *dptr_get(int key, BOOL forclose)
|
||||
for(dptr = dirptrs; dptr; dptr = dptr->next) {
|
||||
if(dptr->dnum == key) {
|
||||
if (!forclose && !dptr->dir_hnd) {
|
||||
if (dptrs_open >= MAX_OPEN_DIRECTORIES)
|
||||
if (dirhandles_open >= MAX_OPEN_DIRECTORIES)
|
||||
dptr_idleoldest();
|
||||
DEBUG(4,("dptr_get: Reopening dptr key %d\n",key));
|
||||
if (!(dptr->dir_hnd = OpenDir(dptr->conn, dptr->path))) {
|
||||
@ -385,7 +385,7 @@ int dptr_create(connection_struct *conn, pstring path, BOOL old_handle, BOOL exp
|
||||
|
||||
string_set(&conn->dirpath,dir2);
|
||||
|
||||
if (dptrs_open >= MAX_OPEN_DIRECTORIES)
|
||||
if (dirhandles_open >= MAX_OPEN_DIRECTORIES)
|
||||
dptr_idleoldest();
|
||||
|
||||
dptr = SMB_MALLOC_P(struct dptr_struct);
|
||||
@ -968,7 +968,7 @@ struct smb_Dir *OpenDir(connection_struct *conn, const char *name)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
dptrs_open++;
|
||||
dirhandles_open++;
|
||||
return dirp;
|
||||
|
||||
fail:
|
||||
@ -1004,7 +1004,7 @@ int CloseDir(struct smb_Dir *dirp)
|
||||
}
|
||||
SAFE_FREE(dirp->name_cache);
|
||||
SAFE_FREE(dirp);
|
||||
dptrs_open--;
|
||||
dirhandles_open--;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -150,11 +150,7 @@ BOOL unix_convert(pstring name,connection_struct *conn,char *saved_last_componen
|
||||
pstrcpy(saved_last_component, name);
|
||||
}
|
||||
|
||||
#if 1
|
||||
if (!conn->case_preserve || (mangle_is_8_3(name, False) && !conn->short_case_preserve))
|
||||
#else
|
||||
if (!conn->case_sensitive && (!conn->case_preserve || (mangle_is_8_3(name, False) && !conn->short_case_preserve)))
|
||||
#endif
|
||||
strnorm(name, lp_defaultcase(SNUM(conn)));
|
||||
|
||||
start = name;
|
||||
|
@ -60,17 +60,26 @@ BOOL set_current_service(connection_struct *conn, uint16 flags, BOOL do_chdir)
|
||||
last_flags = flags;
|
||||
|
||||
/* Obey the client case sensitivity requests - only for clients that support it. */
|
||||
if (lp_casesensitive(snum) == Auto) {
|
||||
/* We need this uglyness due to DOS/Win9x clients that lie about case insensitivity. */
|
||||
enum remote_arch_types ra_type = get_remote_arch();
|
||||
if ((ra_type != RA_SAMBA) && (ra_type != RA_CIFSFS)) {
|
||||
/* Client can't support per-packet case sensitive pathnames. */
|
||||
switch (lp_casesensitive(snum)) {
|
||||
case Auto:
|
||||
{
|
||||
/* We need this uglyness due to DOS/Win9x clients that lie about case insensitivity. */
|
||||
enum remote_arch_types ra_type = get_remote_arch();
|
||||
if ((ra_type != RA_SAMBA) && (ra_type != RA_CIFSFS)) {
|
||||
/* Client can't support per-packet case sensitive pathnames. */
|
||||
conn->case_sensitive = False;
|
||||
} else {
|
||||
conn->case_sensitive = !(flags & FLAG_CASELESS_PATHNAMES);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case True:
|
||||
conn->case_sensitive = True;
|
||||
break;
|
||||
default:
|
||||
conn->case_sensitive = False;
|
||||
} else {
|
||||
conn->case_sensitive = !(flags & FLAG_CASELESS_PATHNAMES);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
magic_char = lp_magicchar(snum);
|
||||
return(True);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user