From 37e7ff05ab9443c0330e68f5c701ffecedf2d738 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Sun, 27 May 2018 13:01:50 +0200 Subject: [PATCH] s3:smbd: add private option NTCREATEX_OPTIONS_PRIVATE_STREAM_BASEOPEN This will be used to mark basefile opens of streams opens. This is needed to later implement a function that can determine if a file has stream opens. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13451 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- source3/include/smb.h | 3 +++ source3/smbd/open.c | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/source3/include/smb.h b/source3/include/smb.h index 3316f09d94f..5e83ee90afe 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -419,6 +419,9 @@ Offset Data length. /* Private options for printer support */ #define NTCREATEX_OPTIONS_PRIVATE_DELETE_ON_CLOSE 0x0008 +/* Private option for streams support */ +#define NTCREATEX_OPTIONS_PRIVATE_STREAM_BASEOPEN 0x0010 + /* Flag for NT transact rename call. */ #define RENAME_REPLACE_IF_EXISTS 1 diff --git a/source3/smbd/open.c b/source3/smbd/open.c index c54d380c7b5..4b28e7ff9a2 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -5144,6 +5144,7 @@ static NTSTATUS create_file_unixpath(connection_struct *conn, && (!(private_flags & NTCREATEX_OPTIONS_PRIVATE_STREAM_DELETE))) { uint32_t base_create_disposition; struct smb_filename *smb_fname_base = NULL; + uint32_t base_privflags; if (create_options & FILE_DIRECTORY_FILE) { status = NT_STATUS_NOT_A_DIRECTORY; @@ -5194,13 +5195,17 @@ static NTSTATUS create_file_unixpath(connection_struct *conn, } } + base_privflags = NTCREATEX_OPTIONS_PRIVATE_STREAM_BASEOPEN; + /* Open the base file. */ status = create_file_unixpath(conn, NULL, smb_fname_base, 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, base_create_disposition, - 0, 0, 0, NULL, 0, 0, NULL, NULL, + 0, 0, 0, NULL, 0, + base_privflags, + NULL, NULL, &base_fsp, NULL); TALLOC_FREE(smb_fname_base); -- 2.34.1