summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-02 12:30:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:33 -0500
commitd1a568363049c82f4314f7a1c5453a92bee84343 (patch)
treecedcff10931077c5bdbce835f6d9049cfbcbb04b /source4/libcli
parent84bbe948f3beff0fbdc51c9c63e2f674b70b5bbe (diff)
downloadsamba-d1a568363049c82f4314f7a1c5453a92bee84343.tar.gz
samba-d1a568363049c82f4314f7a1c5453a92bee84343.tar.bz2
samba-d1a568363049c82f4314f7a1c5453a92bee84343.zip
r2787: force masktest to use RAW_SEARCH_BOTH_DIRECTORY_INFO so it can obtain the short name
(This used to be commit ad5a5ea08d5be812e0ef662948477add2433bc6f)
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/clilist.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/source4/libcli/clilist.c b/source4/libcli/clilist.c
index 2659e81419..84d96d62f4 100644
--- a/source4/libcli/clilist.c
+++ b/source4/libcli/clilist.c
@@ -103,8 +103,9 @@ static BOOL smbcli_list_new_callback(void *private, union smb_search_data *file)
}
int smbcli_list_new(struct smbcli_tree *tree, const char *Mask, uint16_t attribute,
- void (*fn)(file_info *, const char *, void *),
- void *caller_state)
+ enum smb_search_level level,
+ void (*fn)(file_info *, const char *, void *),
+ void *caller_state)
{
union smb_search_first first_parms;
union smb_search_next next_parms;
@@ -125,11 +126,14 @@ int smbcli_list_new(struct smbcli_tree *tree, const char *Mask, uint16_t attribu
state.dirlist = talloc(state.mem_ctx, 0);
mask = talloc_strdup(state.mem_ctx, Mask);
- if (tree->session->transport->negotiate.capabilities & CAP_NT_SMBS) {
- state.info_level = RAW_SEARCH_BOTH_DIRECTORY_INFO;
- } else {
- state.info_level = RAW_SEARCH_STANDARD;
+ if (level == RAW_SEARCH_GENERIC) {
+ if (tree->session->transport->negotiate.capabilities & CAP_NT_SMBS) {
+ level = RAW_SEARCH_BOTH_DIRECTORY_INFO;
+ } else {
+ level = RAW_SEARCH_STANDARD;
+ }
}
+ state.info_level = level;
while (1) {
state.ff_searchcount = 0;
@@ -336,5 +340,5 @@ int smbcli_list(struct smbcli_tree *tree, const char *Mask,uint16_t attribute,
{
if (tree->session->transport->negotiate.protocol <= PROTOCOL_LANMAN1)
return smbcli_list_old(tree, Mask, attribute, fn, state);
- return smbcli_list_new(tree, Mask, attribute, fn, state);
+ return smbcli_list_new(tree, Mask, attribute, RAW_SEARCH_GENERIC, fn, state);
}