From f16c79732e263020af94aeed0fd03835921ea29a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 2 Apr 2004 22:11:08 +0000 Subject: Fix reply_ctemp - make compatible with w2k3. Jeremy. (This used to be commit ddb40a6b1cfed9022dadc627b38d3c3938e8e6b4) --- source3/smbd/reply.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'source3/smbd/reply.c') 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))) -- cgit