diff options
| author | Jelmer Vernooij <jelmer@samba.org> | 2009-01-18 16:19:39 +0100 |
|---|---|---|
| committer | Jelmer Vernooij <jelmer@samba.org> | 2009-01-18 16:19:39 +0100 |
| commit | bfbb0fb17f4eedb8f22d0694c5d4a3b82dfe189b (patch) | |
| tree | 068b3849e31c7b90a465be8172aac7c2b472d205 /source3/libsmb/libsmb_server.c | |
| parent | 5cf9989a70a23e5b955b7229fa95d3e604b1883d (diff) | |
| parent | c45b6ec29a5b3a39b83209e970b645e5ed0a411c (diff) | |
| download | samba-bfbb0fb17f4eedb8f22d0694c5d4a3b82dfe189b.tar.gz samba-bfbb0fb17f4eedb8f22d0694c5d4a3b82dfe189b.tar.bz2 samba-bfbb0fb17f4eedb8f22d0694c5d4a3b82dfe189b.zip | |
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source3/libsmb/libsmb_server.c')
| -rw-r--r-- | source3/libsmb/libsmb_server.c | 64 |
1 files changed, 63 insertions, 1 deletions
diff --git a/source3/libsmb/libsmb_server.c b/source3/libsmb/libsmb_server.c index f4714346d1..0ece5bb649 100644 --- a/source3/libsmb/libsmb_server.c +++ b/source3/libsmb/libsmb_server.c @@ -245,6 +245,8 @@ SMBC_server(TALLOC_CTX *ctx, int tried_reverse = 0; int port_try_first; int port_try_next; + int is_ipc = (share != NULL && strcmp(share, "IPC$") == 0); + uint32 fs_attrs = 0; const char *username_used; NTSTATUS status; @@ -310,6 +312,38 @@ SMBC_server(TALLOC_CTX *ctx, srv = NULL; } + /* Determine if this share supports case sensitivity */ + if (is_ipc) { + DEBUG(4, + ("IPC$ so ignore case sensitivity\n")); + } else if (!cli_get_fs_attr_info(c, &fs_attrs)) { + DEBUG(4, ("Could not retrieve " + "case sensitivity flag: %s.\n", + cli_errstr(c))); + + /* + * We can't determine the case sensitivity of + * the share. We have no choice but to use the + * user-specified case sensitivity setting. + */ + if (smbc_getOptionCaseSensitive(context)) { + cli_set_case_sensitive(c, True); + } else { + cli_set_case_sensitive(c, False); + } + } else { + DEBUG(4, + ("Case sensitive: %s\n", + (fs_attrs & FILE_CASE_SENSITIVE_SEARCH + ? "True" + : "False"))); + cli_set_case_sensitive( + c, + (fs_attrs & FILE_CASE_SENSITIVE_SEARCH + ? True + : False)); + } + /* * Regenerate the dev value since it's based on both * server and share @@ -370,7 +404,7 @@ again: * Force use of port 139 for first try if share is $IPC, empty, or * null, so browse lists can work */ - if (share == NULL || *share == '\0' || strcmp(share, "IPC$") == 0) { + if (share == NULL || *share == '\0' || is_ipc) { port_try_first = 139; port_try_next = 445; } else { @@ -476,6 +510,34 @@ again: DEBUG(4,(" tconx ok\n")); + /* Determine if this share supports case sensitivity */ + if (is_ipc) { + DEBUG(4, ("IPC$ so ignore case sensitivity\n")); + } else if (!cli_get_fs_attr_info(c, &fs_attrs)) { + DEBUG(4, ("Could not retrieve case sensitivity flag: %s.\n", + cli_errstr(c))); + + /* + * We can't determine the case sensitivity of the share. We + * have no choice but to use the user-specified case + * sensitivity setting. + */ + if (smbc_getOptionCaseSensitive(context)) { + cli_set_case_sensitive(c, True); + } else { + cli_set_case_sensitive(c, False); + } + } else { + DEBUG(4, ("Case sensitive: %s\n", + (fs_attrs & FILE_CASE_SENSITIVE_SEARCH + ? "True" + : "False"))); + cli_set_case_sensitive(c, + (fs_attrs & FILE_CASE_SENSITIVE_SEARCH + ? True + : False)); + } + if (context->internal->smb_encryption_level) { /* Attempt UNIX smb encryption. */ if (!NT_STATUS_IS_OK(cli_force_encryption(c, |
