summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-07-05 06:39:15 +0000
committerAndrew Tridgell <tridge@samba.org>2001-07-05 06:39:15 +0000
commit8ffcec213e633c4844b470339a5608000fdcf773 (patch)
treef98d45e64c2a1b6f816f7f4080c522ef854b8780
parent6668abac5eac314a3c0d1c2627c68692b4b0f3a2 (diff)
downloadsamba-8ffcec213e633c4844b470339a5608000fdcf773.tar.gz
samba-8ffcec213e633c4844b470339a5608000fdcf773.tar.bz2
samba-8ffcec213e633c4844b470339a5608000fdcf773.zip
fixed a bug in the parameters SMBctemp uses in open_file_shared()
(This used to be commit a1dee993cbf52e7232b65323430c8574843eb168)
-rw-r--r--source3/smbd/reply.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index b7291f5577..3103ed9c8d 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1851,7 +1851,6 @@ int reply_mknew(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
int reply_ctemp(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize)
{
pstring fname;
- pstring fname2;
int outsize = 0;
int createmode;
mode_t unixmode;
@@ -1880,14 +1879,14 @@ int reply_ctemp(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
return(UNIXERROR(ERRDOS,ERRnoaccess));
}
- vfs_stat(conn,fname2,&sbuf);
+ vfs_stat(conn,fname,&sbuf);
/* Open file in dos compatibility share mode. */
/* We should fail if file does not exist. */
fsp = open_file_shared(conn,fname,&sbuf,
- SET_DENY_MODE(DENY_FCB)|SET_OPEN_MODE(DOS_OPEN_FCB),
- FILE_FAIL_IF_NOT_EXIST,
- unixmode, oplock_request, NULL, NULL);
+ SET_DENY_MODE(DENY_FCB)|SET_OPEN_MODE(DOS_OPEN_FCB),
+ FILE_EXISTS_OPEN|FILE_FAIL_IF_NOT_EXIST,
+ unixmode, oplock_request, NULL, NULL);
/* close fd from smb_mkstemp() */
close(tmpfd);
@@ -1907,7 +1906,7 @@ int reply_ctemp(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
SSVAL(outbuf,smb_vwv0,fsp->fnum);
CVAL(smb_buf(outbuf),0) = 4;
p = smb_buf(outbuf) + 1;
- p += srvstr_push(outbuf, p, fname2, -1, STR_TERMINATE);
+ p += srvstr_push(outbuf, p, fname, -1, STR_TERMINATE);
set_message_end(outbuf, p);
if (oplock_request && lp_fake_oplocks(SNUM(conn))) {
@@ -1917,9 +1916,9 @@ int reply_ctemp(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
if(EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type))
CVAL(outbuf,smb_flg) |= CORE_OPLOCK_GRANTED;
- DEBUG( 2, ( "created temp file %s\n", fname2 ) );
+ DEBUG( 2, ( "created temp file %s\n", fname ) );
DEBUG( 3, ( "ctemp %s fd=%d dmode=%d umode=%o\n",
- fname2, fsp->fd, createmode, (int)unixmode ) );
+ fname, fsp->fd, createmode, (int)unixmode ) );
END_PROFILE(SMBctemp);
return(outsize);