diff options
author | Jeremy Allison <jra@samba.org> | 2004-06-15 18:36:45 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:51:57 -0500 |
commit | 2acd0848663f28afedff9b11b738e048f5ead2cc (patch) | |
tree | 3f36e5c0fc1bba20f626ae58ee5cfa9371a4f8d0 /source3/libsmb | |
parent | 2895acb6e7c476e88735096b7f5d01f616739fe3 (diff) | |
download | samba-2acd0848663f28afedff9b11b738e048f5ead2cc.tar.gz samba-2acd0848663f28afedff9b11b738e048f5ead2cc.tar.bz2 samba-2acd0848663f28afedff9b11b738e048f5ead2cc.zip |
r1154: Change default setting for case sensitivity to "auto". If set to auto
then is the client supports it (current clients supported are Samba and
CIFSVFS - detected by the negprot strings "Samba", "POSIX 2" and a bare
"NT LM 0.12" string) then the setting of the per packet flag smb_flag
FLAG_CASELESS_PATHNAMES is taken into account per packet. This allows
the linux CIFS client to use Samba in a case sensitive manner.
Additional command in smbclient "case_sensitive", toggles the
flag in subsequent packets.
Docs to follow.
Jeremy.
(This used to be commit cf84c0fe1a061acc0313f7db124b8f947cdf623d)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clientgen.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index b75d6be0a6..281ee3af84 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -176,7 +176,12 @@ void cli_setup_packet(struct cli_state *cli) SSVAL(cli->outbuf,smb_mid,cli->mid); if (cli->protocol > PROTOCOL_CORE) { uint16 flags2; - SCVAL(cli->outbuf,smb_flg,0x8); + if (cli->case_sensitive) { + SCVAL(cli->outbuf,smb_flg,0x0); + } else { + /* Default setting, case insensitive. */ + SCVAL(cli->outbuf,smb_flg,0x8); + } flags2 = FLAGS2_LONG_PATH_COMPONENTS; if (cli->capabilities & CAP_UNICODE) flags2 |= FLAGS2_UNICODE_STRINGS; @@ -273,6 +278,7 @@ struct cli_state *cli_initialise(struct cli_state *cli) cli->outbuf = (char *)malloc(cli->bufsize+SAFETY_MARGIN); cli->inbuf = (char *)malloc(cli->bufsize+SAFETY_MARGIN); cli->oplock_handler = cli_oplock_ack; + cli->case_sensitive = False; cli->use_spnego = lp_client_use_spnego(); @@ -441,6 +447,17 @@ uint16 cli_setpid(struct cli_state *cli, uint16 pid) } /**************************************************************************** + Set the case sensitivity flag on the packets. Returns old state. +****************************************************************************/ + +BOOL cli_set_case_sensitive(struct cli_state *cli, BOOL case_sensitive) +{ + BOOL ret = cli->case_sensitive; + cli->case_sensitive = case_sensitive; + return ret; +} + +/**************************************************************************** Send a keepalive packet to the server ****************************************************************************/ BOOL cli_send_keepalive(struct cli_state *cli) |