mirror of
https://github.com/samba-team/samba.git
synced 2025-09-17 05:44:20 +03:00
s3:smbd: call apply_new_nt_acl() already in mkdir_internals()
We should have preparation steps as close as possible together. We could move it for files as well, but that's a task for another day... BUG: https://bugzilla.samba.org/show_bug.cgi?id=15693 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
@@ -4604,6 +4604,7 @@ static NTSTATUS mkdir_internal(connection_struct *conn,
|
|||||||
struct smb_filename *parent_dir_fname, /* parent. */
|
struct smb_filename *parent_dir_fname, /* parent. */
|
||||||
struct smb_filename *smb_fname_atname, /* atname relative to parent. */
|
struct smb_filename *smb_fname_atname, /* atname relative to parent. */
|
||||||
struct smb_filename *smb_dname, /* full pathname from root of share. */
|
struct smb_filename *smb_dname, /* full pathname from root of share. */
|
||||||
|
struct security_descriptor *sd,
|
||||||
uint32_t file_attributes,
|
uint32_t file_attributes,
|
||||||
struct files_struct *fsp)
|
struct files_struct *fsp)
|
||||||
{
|
{
|
||||||
@@ -4730,6 +4731,18 @@ static NTSTATUS mkdir_internal(connection_struct *conn,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lp_nt_acl_support(SNUM(conn))) {
|
||||||
|
status = apply_new_nt_acl(parent_dir_fname->fsp,
|
||||||
|
fsp,
|
||||||
|
sd);
|
||||||
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
DBG_WARNING("apply_new_nt_acl() failed for %s with %s\n",
|
||||||
|
fsp_str_dbg(fsp),
|
||||||
|
nt_errstr(status));
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
notify_fname(conn, NOTIFY_ACTION_ADDED, FILE_NOTIFY_CHANGE_DIR_NAME,
|
notify_fname(conn, NOTIFY_ACTION_ADDED, FILE_NOTIFY_CHANGE_DIR_NAME,
|
||||||
smb_dname->base_name);
|
smb_dname->base_name);
|
||||||
|
|
||||||
@@ -4749,6 +4762,7 @@ static NTSTATUS open_directory(connection_struct *conn,
|
|||||||
uint32_t file_attributes,
|
uint32_t file_attributes,
|
||||||
struct smb_filename *parent_dir_fname,
|
struct smb_filename *parent_dir_fname,
|
||||||
struct smb_filename *smb_fname_atname,
|
struct smb_filename *smb_fname_atname,
|
||||||
|
struct security_descriptor *sd,
|
||||||
int *pinfo,
|
int *pinfo,
|
||||||
struct files_struct *fsp)
|
struct files_struct *fsp)
|
||||||
{
|
{
|
||||||
@@ -4838,6 +4852,7 @@ static NTSTATUS open_directory(connection_struct *conn,
|
|||||||
parent_dir_fname,
|
parent_dir_fname,
|
||||||
smb_fname_atname,
|
smb_fname_atname,
|
||||||
smb_dname,
|
smb_dname,
|
||||||
|
sd,
|
||||||
file_attributes,
|
file_attributes,
|
||||||
fsp);
|
fsp);
|
||||||
|
|
||||||
@@ -4869,6 +4884,7 @@ static NTSTATUS open_directory(connection_struct *conn,
|
|||||||
parent_dir_fname,
|
parent_dir_fname,
|
||||||
smb_fname_atname,
|
smb_fname_atname,
|
||||||
smb_dname,
|
smb_dname,
|
||||||
|
sd,
|
||||||
file_attributes,
|
file_attributes,
|
||||||
fsp);
|
fsp);
|
||||||
|
|
||||||
@@ -6375,6 +6391,7 @@ static NTSTATUS create_file_unixpath(connection_struct *conn,
|
|||||||
file_attributes,
|
file_attributes,
|
||||||
dirfsp->fsp_name,
|
dirfsp->fsp_name,
|
||||||
smb_fname_atname,
|
smb_fname_atname,
|
||||||
|
sd,
|
||||||
&info,
|
&info,
|
||||||
fsp);
|
fsp);
|
||||||
} else {
|
} else {
|
||||||
@@ -6431,6 +6448,7 @@ static NTSTATUS create_file_unixpath(connection_struct *conn,
|
|||||||
file_attributes,
|
file_attributes,
|
||||||
dirfsp->fsp_name,
|
dirfsp->fsp_name,
|
||||||
smb_fname_atname,
|
smb_fname_atname,
|
||||||
|
sd,
|
||||||
&info,
|
&info,
|
||||||
fsp);
|
fsp);
|
||||||
}
|
}
|
||||||
@@ -6478,6 +6496,7 @@ static NTSTATUS create_file_unixpath(connection_struct *conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((info == FILE_WAS_CREATED) &&
|
if ((info == FILE_WAS_CREATED) &&
|
||||||
|
!S_ISDIR(fsp->fsp_name->st.st_ex_mode) &&
|
||||||
lp_nt_acl_support(SNUM(conn)) &&
|
lp_nt_acl_support(SNUM(conn)) &&
|
||||||
!fsp_is_alternate_stream(fsp)) {
|
!fsp_is_alternate_stream(fsp)) {
|
||||||
status = apply_new_nt_acl(dirfsp, fsp, sd);
|
status = apply_new_nt_acl(dirfsp, fsp, sd);
|
||||||
|
Reference in New Issue
Block a user