summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/smb.h1
-rw-r--r--source3/smbd/nttrans.c10
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. */