diff options
author | Jeremy Allison <jra@samba.org> | 2004-04-02 22:11:08 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2004-04-02 22:11:08 +0000 |
commit | f16c79732e263020af94aeed0fd03835921ea29a (patch) | |
tree | b4bae256fe8a3d82aa8a53e68793b1393c60a38e /source3/smbd | |
parent | becfb420f743183caa49ff135948c13861fcc379 (diff) | |
download | samba-f16c79732e263020af94aeed0fd03835921ea29a.tar.gz samba-f16c79732e263020af94aeed0fd03835921ea29a.tar.bz2 samba-f16c79732e263020af94aeed0fd03835921ea29a.zip |
Fix reply_ctemp - make compatible with w2k3.
Jeremy.
(This used to be commit ddb40a6b1cfed9022dadc627b38d3c3938e8e6b4)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/reply.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 9f311c6d57..130601cd9c 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -1293,6 +1293,7 @@ int reply_ctemp(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, SMB_STRUCT_STAT sbuf; char *p, *s; NTSTATUS status; + unsigned int namelen; START_PROFILE(SMBctemp); @@ -1302,7 +1303,11 @@ int reply_ctemp(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, END_PROFILE(SMBctemp); return ERROR_NT(status); } - pstrcat(fname,"\\TMXXXXXX"); + if (*fname) { + pstrcat(fname,"/TMXXXXXX"); + } else { + pstrcat(fname,"TMXXXXXX"); + } RESOLVE_DFSPATH(fname, conn, inbuf, outbuf); @@ -1342,10 +1347,13 @@ int reply_ctemp(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, s++; p = smb_buf(outbuf); +#if 0 + /* Tested vs W2K3 - this doesn't seem to be here - null terminated filename is the only + thing in the byte section. JRA */ SSVALS(p, 0, -1); /* what is this? not in spec */ - SSVAL(p, 2, strlen(s)); - p += 4; - p += srvstr_push(outbuf, p, s, -1, STR_ASCII); +#endif + namelen = srvstr_push(outbuf, p, s, -1, STR_ASCII|STR_TERMINATE); + p += namelen; outsize = set_message_end(outbuf, p); if (oplock_request && lp_fake_oplocks(SNUM(conn))) |