From 790b85f5e21b3dafe5dc3e7835e8f14dfd498462 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 28 Aug 2002 19:47:48 +0000 Subject: Return correct FILE_SUPERSEDED response - IFSTEST strikes again... Jeremy. (This used to be commit df3e467eb7cce059782870bfec222293577c4f69) --- source3/include/smb.h | 1 + source3/smbd/nttrans.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/source3/include/smb.h b/source3/include/smb.h index 958a563642..f2eb37096c 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1190,6 +1190,7 @@ struct bitmap { #define FILE_OPEN_BY_FILE_ID 0x2000 /* Responses when opening a file. */ +#define FILE_WAS_SUPERSEDED 0 #define FILE_WAS_OPENED 1 #define FILE_WAS_CREATED 2 #define FILE_WAS_OVERWRITTEN 3 diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index ff35771644..1f3bbd488e 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -863,7 +863,10 @@ create_options = 0x%x root_dir_fid = 0x%x\n", flags, desired_access, file_attrib p++; SSVAL(p,0,fsp->fnum); p += 2; - SIVAL(p,0,smb_action); + if ((create_disposition == FILE_SUPERSEDE) && (smb_action == FILE_WAS_OVERWRITTEN)) + SIVAL(p,0,FILE_WAS_SUPERSEDED); + else + SIVAL(p,0,smb_action); p += 4; /* Create time. */ @@ -1336,7 +1339,10 @@ static int call_nt_transact_create(connection_struct *conn, p += 2; SSVAL(p,0,fsp->fnum); p += 2; - SIVAL(p,0,smb_action); + if ((create_disposition == FILE_SUPERSEDE) && (smb_action == FILE_WAS_OVERWRITTEN)) + SIVAL(p,0,FILE_WAS_SUPERSEDED); + else + SIVAL(p,0,smb_action); p += 8; /* Create time. */ -- cgit