[SCM] Samba Shared Repository - branch v3-5-test updated

Jeremy Allison jra at samba.org
Mon Nov 2 17:21:02 MST 2009


The branch, v3-5-test has been updated
       via  21e527c... Convert from numbers to correct SMB_FIND_XX constant names. Jeremy.
      from  a385927... Fix bug 6867 - trans2findnext returns reply_nterror(req, ntstatus) In a directory with a lot of files. Jeremy.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test


- Log -----------------------------------------------------------------
commit 21e527c5d3d98c6e730c23281d68b0b18737b704
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Nov 2 16:17:36 2009 -0800

    Convert from numbers to correct SMB_FIND_XX constant names.
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 source3/libsmb/clilist.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c
index a84a647..5a97204 100644
--- a/source3/libsmb/clilist.c
+++ b/source3/libsmb/clilist.c
@@ -38,8 +38,9 @@ static size_t calc_next_entry_offset(const char *base, const char *pdata_end)
 /****************************************************************************
  Interpret a long filename structure - this is mostly guesses at the moment.
  The length of the structure is returned
- The structure of a long filename depends on the info level. 260 is used
- by NT and 2 is used by OS/2
+ The structure of a long filename depends on the info level.
+ SMB_FIND_FILE_BOTH_DIRECTORY_INFO is used
+ by NT and SMB_FIND_EA_SIZE is used by OS/2
 ****************************************************************************/
 
 static size_t interpret_long_filename(TALLOC_CTX *ctx,
@@ -64,7 +65,7 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx,
 	finfo->cli = cli;
 
 	switch (level) {
-		case 1: /* OS/2 understands this */
+		case SMB_FIND_INFO_STANDARD: /* OS/2 understands this */
 			/* these dates are converted to GMT by
                            make_unix_date */
 			if (pdata_end - base < 27) {
@@ -109,7 +110,7 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx,
 			p += ret;
 			return PTR_DIFF(p, base);
 
-		case 2: /* this is what OS/2 uses mostly */
+		case SMB_FIND_EA_SIZE: /* this is what OS/2 uses mostly */
 			/* these dates are converted to GMT by
                            make_unix_date */
 			if (pdata_end - base < 31) {
@@ -138,7 +139,7 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx,
 			p += ret;
 			return PTR_DIFF(p, base) + 1;
 
-		case 260: /* NT uses this, but also accepts 2 */
+		case SMB_FIND_FILE_BOTH_DIRECTORY_INFO: /* NT uses this, but also accepts 2 */
 		{
 			size_t namelen, slen;
 
@@ -248,8 +249,10 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
 	TALLOC_CTX *frame = talloc_stackframe();
 	DATA_BLOB last_name_raw = data_blob(NULL, 0);
 
-	/* NT uses 260, OS/2 uses 2. Both accept 1. */
-	info_level = (cli->capabilities&CAP_NT_SMBS)?260:1;
+	/* NT uses SMB_FIND_FILE_BOTH_DIRECTORY_INFO,
+	   OS/2 uses SMB_FIND_EA_SIZE. Both accept SMB_FIND_INFO_STANDARD. */
+	info_level = (cli->capabilities&CAP_NT_SMBS)?
+		SMB_FIND_FILE_BOTH_DIRECTORY_INFO : SMB_FIND_INFO_STANDARD;
 
 	mask = SMB_STRDUP(Mask);
 	if (!mask) {
@@ -389,7 +392,8 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
 
 		/* we might need the lastname for continuations */
 		for (p2=p,i=0;i<ff_searchcount && p2 < rdata_end;i++) {
-			if ((info_level == 260) && (i == ff_searchcount-1)) {
+			if ((info_level == SMB_FIND_FILE_BOTH_DIRECTORY_INFO) &&
+					(i == ff_searchcount-1)) {
 				/* Last entry - fixup the last offset length. */
 				SIVAL(p2,0,PTR_DIFF((rdata + data_len),p2));
 			}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list