Skip to content

Commit

Permalink
s3:smbd: add private option NTCREATEX_OPTIONS_PRIVATE_STREAM_BASEOPEN
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
  • Loading branch information
slowfranklin authored and jrasamba committed May 30, 2018
1 parent f166207 commit 37e7ff0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions source3/include/smb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 6 additions & 1 deletion source3/smbd/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 37e7ff0

Please sign in to comment.