1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3: smbd: Reformat uses of directory_has_default_acl().

Makes it easier to add a dirfsp parameter.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Jeremy Allison 2020-04-29 15:11:33 -07:00 committed by Ralph Boehme
parent 2243ba78d9
commit 98c8785c58
5 changed files with 11 additions and 5 deletions

View File

@ -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;
}
}

View File

@ -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)));
}
}

View File

@ -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;

View File

@ -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)));
}

View File

@ -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 */