From: Ralph Boehme Date: Sun, 27 May 2018 11:01:50 +0000 (+0200) Subject: s3:smbd: add private option NTCREATEX_OPTIONS_PRIVATE_STREAM_BASEOPEN X-Git-Tag: ldb-1.3.6~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85571d08b2683ee2c9bf8f2abc76af8bc6055a86;p=thirdparty%2Fsamba.git 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 (cherry picked from commit 37e7ff05ab9443c0330e68f5c701ffecedf2d738) --- 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 3708bdd10fa..8a9288dbdb4 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -5091,6 +5091,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; @@ -5141,13 +5142,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);