diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-03-10 11:57:38 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-03-10 11:57:38 +0000 |
commit | 20d3a2986e793deaa2243ee26bfa33f580a6d2e2 (patch) | |
tree | 0e598a64946e268d632887c9fa78935363366548 /source3 | |
parent | b08b70faf873455ff14dcd633a7c9eb860ba4b28 (diff) | |
download | samba-20d3a2986e793deaa2243ee26bfa33f580a6d2e2.tar.gz samba-20d3a2986e793deaa2243ee26bfa33f580a6d2e2.tar.bz2 samba-20d3a2986e793deaa2243ee26bfa33f580a6d2e2.zip |
converted reply_open, reply_open_and_x and reply_fclose
(This used to be commit 2c8da0ae22309f153bde4e29095b60996fa8fcc5)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/reply.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 4f98c264b8..a505160b7d 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -1507,22 +1507,26 @@ int reply_fclose(connection_struct *conn, char *inbuf,char *outbuf, int dum_size { int outsize = 0; int status_len; - char *path; + pstring path; char status[21]; int dptr_num= -2; + char *p; + START_PROFILE(SMBfclose); outsize = set_message(outbuf,1,0,True); - 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|STR_CONVERT); + p++; + status_len = SVAL(p,0); + p += 2; - if (status_len == 0) { END_PROFILE(SMBfclose); return(ERROR(ERRSRV,ERRsrverror)); } - memcpy(status,smb_buf(inbuf) + 1 + strlen(path) + 4,21); + memcpy(status,p,21); if(dptr_fetch(status+12,&dptr_num)) { /* Close the dptr - we know it's gone */ @@ -1560,7 +1564,7 @@ int reply_open(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, share_mode = SVAL(inbuf,smb_vwv0); - pstrcpy(fname,smb_buf(inbuf)+1); + srvstr_pull(inbuf, fname, smb_buf(inbuf)+1, sizeof(fname), -1, STR_TERMINATE); RESOLVE_DFSPATH(fname, conn, inbuf, outbuf); @@ -1654,8 +1658,7 @@ int reply_open_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt } /* XXXX we need to handle passed times, sattr and flags */ - - pstrcpy(fname,smb_buf(inbuf)); + srvstr_pull(inbuf, fname, smb_buf(inbuf), sizeof(fname), -1, STR_TERMINATE); RESOLVE_DFSPATH(fname, conn, inbuf, outbuf); |