r2787: force masktest to use RAW_SEARCH_BOTH_DIRECTORY_INFO so it can obtain the...
authorAndrew Tridgell <tridge@samba.org>
Sat, 2 Oct 2004 12:30:02 +0000 (12:30 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:59:33 +0000 (12:59 -0500)
(This used to be commit ad5a5ea08d5be812e0ef662948477add2433bc6f)

source4/libcli/clilist.c
source4/torture/masktest.c

index 2659e8141990c3070e654aec176d258f26943775..84d96d62f44865b0136b2d93f6225f9a8a4b7b30 100644 (file)
@@ -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);
 }
index 4097c8c35a6603980cb7ea3fa06b024c93e0733c..dbd7c2f74b6bd9e51948d520077593b43129f3aa 100644 (file)
@@ -121,8 +121,9 @@ static void get_real_name(struct smbcli_state *cli,
        f_info_hit = False;
 
        smbcli_list_new(cli->tree, mask, 
-                    FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_DIRECTORY, 
-                    listfn, NULL);
+                       FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_DIRECTORY, 
+                       RAW_SEARCH_BOTH_DIRECTORY_INFO,
+                       listfn, NULL);
 
        if (f_info_hit) {
                fstrcpy(short_name, last_hit.short_name);