1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-19 21:57:57 +03:00

converted reply_search

(This used to be commit 0331f93a8117d4c295cda327c3a290296ff621d0)
This commit is contained in:
Andrew Tridgell 2001-03-16 03:25:33 +00:00
parent 871a429404
commit 7906e8168c

View File

@ -1295,7 +1295,7 @@ int reply_search(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
char *p;
BOOL ok = False;
int status_len;
char *path;
pstring path;
char status[21];
int dptr_num= -1;
BOOL check_descend = False;
@ -1313,9 +1313,11 @@ int reply_search(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
outsize = set_message(outbuf,1,3,True);
maxentries = SVAL(inbuf,smb_vwv0);
dirtype = SVAL(inbuf,smb_vwv1);
path = smb_buf(inbuf) + 1;
status_len = SVAL(smb_buf(inbuf),3 + strlen(path));
p = smb_buf(inbuf) + 1;
p += srvstr_pull(inbuf, path, p, sizeof(path), -1, STR_TERMINATE);
p++;
status_len = SVAL(p, 0);
p += 2;
/* dirtype &= ~aDIR; */
@ -1324,8 +1326,8 @@ int reply_search(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
SMB_STRUCT_STAT sbuf;
pstring dir2;
pstrcpy(directory,smb_buf(inbuf)+1);
pstrcpy(dir2,smb_buf(inbuf)+1);
pstrcpy(directory,path);
pstrcpy(dir2,path);
unix_convert(directory,conn,0,&bad_path,&sbuf);
unix_format(dir2);
@ -1357,7 +1359,7 @@ int reply_search(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
}
else
{
memcpy(status,smb_buf(inbuf) + 1 + strlen(path) + 4,21);
memcpy(status,p,21);
dirtype = CVAL(status,0) & 0x1F;
conn->dirptr = dptr_fetch(status+12,&dptr_num);
if (!conn->dirptr)