From b99926ca5e3791f578a833de5ca3ed7bd4bab443 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 28 Oct 2008 17:13:21 +0100 Subject: s4: ntvfs/posix: to set a DACL at open time SEC_DESC_DACL_PRESENT must be set metze --- source4/ntvfs/posix/pvfs_open.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4/ntvfs/posix') diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c index 8a32f01223..fe3c915576 100644 --- a/source4/ntvfs/posix/pvfs_open.c +++ b/source4/ntvfs/posix/pvfs_open.c @@ -106,6 +106,7 @@ static NTSTATUS pvfs_open_setup_eas_acl(struct pvfs_state *pvfs, union smb_open *io) { NTSTATUS status; + struct security_descriptor *sd; /* setup any EAs that were asked for */ if (io->ntcreatex.in.ea_list) { @@ -117,8 +118,9 @@ static NTSTATUS pvfs_open_setup_eas_acl(struct pvfs_state *pvfs, } } + sd = io->ntcreatex.in.sec_desc; /* setup an initial sec_desc if requested */ - if (io->ntcreatex.in.sec_desc) { + if (sd && (sd->type & SEC_DESC_DACL_PRESENT)) { union smb_setfileinfo set; /* * TODO: set the full ACL! @@ -129,7 +131,7 @@ static NTSTATUS pvfs_open_setup_eas_acl(struct pvfs_state *pvfs, */ set.set_secdesc.in.file.ntvfs = f->ntvfs; set.set_secdesc.in.secinfo_flags = SECINFO_DACL; - set.set_secdesc.in.sd = io->ntcreatex.in.sec_desc; + set.set_secdesc.in.sd = sd; status = pvfs_acl_set(pvfs, req, name, fd, SEC_STD_WRITE_DAC, &set); } else { -- cgit