Author: jra
Date: 2005-03-08 23:03:30 +0000 (Tue, 08 Mar 2005)
New Revision: 5699

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5699

Log:
Fix problems where we're not pointing to the start of entry for a
couple of info levels - W2K3 always points to the start, not the name.
Jeremy.

Modified:
   trunk/source/smbd/trans2.c


Changeset:
Modified: trunk/source/smbd/trans2.c
===================================================================
--- trunk/source/smbd/trans2.c  2005-03-08 22:42:32 UTC (rev 5698)
+++ trunk/source/smbd/trans2.c  2005-03-08 23:03:30 UTC (rev 5699)
@@ -811,7 +811,7 @@
                                 BOOL dont_descend,char **ppdata, 
                                 char *base_data, int space_remaining, 
                                 BOOL *out_of_space, BOOL *got_exact_match,
-                                int *last_name_off)
+                                int *last_entry_off)
 {
        const char *dname;
        BOOL found = False;
@@ -828,6 +828,7 @@
        uint32 len;
        time_t mdate=0, adate=0, cdate=0;
        char *nameptr;
+       char *last_entry_ptr;
        BOOL was_8_3;
        int nt_extmode; /* Used for NT connections instead of mode */
        BOOL needslash = ( conn->dirpath[strlen(conn->dirpath) -1] != '/');
@@ -964,7 +965,7 @@
        mangle_map(fname,False,True,SNUM(conn));
 
        p = pdata;
-       nameptr = p;
+       last_entry_ptr = p;
 
        nt_extmode = mode ? mode : FILE_ATTRIBUTE_NORMAL;
 
@@ -1294,8 +1295,8 @@
                return False; /* Not finished - just out of space */
        }
 
-       /* Setup the last_filename pointer, as an offset from base_data */
-       *last_name_off = PTR_DIFF(nameptr,base_data);
+       /* Setup the last entry pointer, as an offset from base_data */
+       *last_entry_off = PTR_DIFF(last_entry_ptr,base_data);
        /* Advance the data pointer to the next slot */
        *ppdata = p;
 
@@ -1327,7 +1328,7 @@
        pstring directory;
        pstring mask;
        char *p;
-       int last_name_off=0;
+       int last_entry_off=0;
        int dptr_num = -1;
        int numentries = 0;
        int i;
@@ -1454,7 +1455,7 @@
                                        mask,dirtype,info_level,
                                        requires_resume_key,dont_descend,
                                        &p,pdata,space_remaining, 
&out_of_space, &got_exact_match,
-                                       &last_name_off);
+                                       &last_entry_off);
                }
 
                if (finished && out_of_space)
@@ -1499,7 +1500,7 @@
        SSVAL(params,2,numentries);
        SSVAL(params,4,finished);
        SSVAL(params,6,0); /* Never an EA error */
-       SSVAL(params,8,last_name_off);
+       SSVAL(params,8,last_entry_off);
 
        send_trans2_replies( outbuf, bufsize, params, 10, pdata, 
PTR_DIFF(p,pdata));
 
@@ -1554,7 +1555,7 @@
        char *p;
        uint16 dirtype;
        int numentries = 0;
-       int i, last_name_off=0;
+       int i, last_entry_off=0;
        BOOL finished = False;
        BOOL dont_descend = False;
        BOOL out_of_space = False;
@@ -1691,7 +1692,7 @@
                                                mask,dirtype,info_level,
                                                
requires_resume_key,dont_descend,
                                                &p,pdata,space_remaining, 
&out_of_space, &got_exact_match,
-                                               &last_name_off);
+                                               &last_entry_off);
                }
 
                if (finished && out_of_space)
@@ -1723,7 +1724,7 @@
        SSVAL(params,0,numentries);
        SSVAL(params,2,finished);
        SSVAL(params,4,0); /* Never an EA error */
-       SSVAL(params,6,last_name_off);
+       SSVAL(params,6,last_entry_off);
 
        send_trans2_replies( outbuf, bufsize, params, 8, pdata, 
PTR_DIFF(p,pdata));
 

Reply via email to