From: Jeremy Allison Date: Wed, 29 Apr 2020 22:11:33 +0000 (-0700) Subject: s3: smbd: Reformat uses of directory_has_default_acl(). X-Git-Tag: ldb-2.2.0~799 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=98c8785c5810b1dc5820212b98ffa6279ea80cea;p=thirdparty%2Fsamba.git s3: smbd: Reformat uses of directory_has_default_acl(). Makes it easier to add a dirfsp parameter. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index 166fdc9feee..d7ddb9e0365 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -365,7 +365,9 @@ static int cephwrap_mkdirat(struct vfs_handle_struct *handle, if (lp_inherit_acls(SNUM(handle->conn))) { ok = parent_smb_fname(talloc_tos(), smb_fname, &parent, NULL); - if (ok && directory_has_default_acl(handle->conn, parent)) { + if (ok && directory_has_default_acl(handle->conn, + parent)) + { mode = 0777; } } diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index a739b17963a..7cde6384b61 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -637,7 +637,9 @@ static int vfswrap_mkdirat(vfs_handle_struct *handle, if (lp_inherit_acls(SNUM(handle->conn))) { ok = parent_smb_fname(talloc_tos(), smb_fname, &parent, NULL); - if (ok && directory_has_default_acl(handle->conn, parent)) { + if (ok && directory_has_default_acl(handle->conn, + parent)) + { mode = (0777 & lp_directory_mask(SNUM(handle->conn))); } } diff --git a/source3/smbd/file_access.c b/source3/smbd/file_access.c index 4884301fd4b..2e114e96590 100644 --- a/source3/smbd/file_access.c +++ b/source3/smbd/file_access.c @@ -141,7 +141,7 @@ bool can_write_to_file(connection_struct *conn, ****************************************************************************/ bool directory_has_default_acl(connection_struct *conn, - struct smb_filename *smb_fname) + struct smb_filename *smb_fname) { struct security_descriptor *secdesc = NULL; unsigned int i; diff --git a/source3/smbd/open.c b/source3/smbd/open.c index ef20b44ea15..4e35a84e1ab 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -3592,7 +3592,9 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, */ if ((flags2 & O_CREAT) && lp_inherit_acls(SNUM(conn)) && - (def_acl = directory_has_default_acl(conn, parent_dir_fname))) { + (def_acl = directory_has_default_acl(conn, + parent_dir_fname))) + { unx_mode = (0777 & lp_create_mask(SNUM(conn))); } diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index ec4134407a6..bc365206f27 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -335,7 +335,7 @@ bool can_delete_file_in_directory(connection_struct *conn, bool can_write_to_file(connection_struct *conn, const struct smb_filename *smb_fname); bool directory_has_default_acl(connection_struct *conn, - struct smb_filename *smb_fname); + struct smb_filename *smb_fname); NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32_t dosmode); /* The following definitions come from smbd/fileio.c */