svn commit: samba r2787 - in branches/SAMBA_4_0/source: libcli torture

tridge at samba.org tridge at samba.org
Sat Oct 2 12:30:03 GMT 2004


Author: tridge
Date: 2004-10-02 12:30:02 +0000 (Sat, 02 Oct 2004)
New Revision: 2787

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=2787&nolog=1

Log:
force masktest to use RAW_SEARCH_BOTH_DIRECTORY_INFO so it can obtain the short name



Modified:
   branches/SAMBA_4_0/source/libcli/clilist.c
   branches/SAMBA_4_0/source/torture/masktest.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/clilist.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/clilist.c	2004-10-02 12:25:02 UTC (rev 2786)
+++ branches/SAMBA_4_0/source/libcli/clilist.c	2004-10-02 12:30:02 UTC (rev 2787)
@@ -103,8 +103,9 @@
 }
 
 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 @@
 	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 @@
 {
 	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);
 }

Modified: branches/SAMBA_4_0/source/torture/masktest.c
===================================================================
--- branches/SAMBA_4_0/source/torture/masktest.c	2004-10-02 12:25:02 UTC (rev 2786)
+++ branches/SAMBA_4_0/source/torture/masktest.c	2004-10-02 12:30:02 UTC (rev 2787)
@@ -121,8 +121,9 @@
 	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);



More information about the samba-cvs mailing list