From e2406d71aa6a1b632e67f7cd1e53c7d38533cec6 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 14 Jul 2008 20:22:03 +0000 Subject: Throughout drop allow_ntsec and allow_smbntsec handling. * environ.cc (set_ntsec): Remove. (set_smbntsec): Remove. (known): Remove ntsec and smbntsec options. * external.cc (check_ntsec): Return true if no filename is given. * mount.cc (oopts): Add "acl" and "noacl" options. Set MOUNT_NOACL flag accordingly. (fillout_mntent): Handle MOUNT_NOACL flag. * path.h (enum path_types): Add PATH_NOACL. * security.cc (allow_ntsec): Remove. (allow_smbntsec): Remove. * security.h (allow_ntsec): Drop declaration. (allow_smbntsec): Drop declaration. * include/sys/mount.h (MOUNT_NOACL): Define. --- winsup/cygwin/fhandler_disk_file.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'winsup/cygwin/fhandler_disk_file.cc') diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 66f1fcc3c..d0e86e481 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -761,7 +761,7 @@ fhandler_disk_file::fchmod (mode_t mode) if (!(oret = open (O_BINARY, 0))) { /* Need WRITE_DAC|WRITE_OWNER to write ACLs. */ - if (allow_ntsec && pc.has_acls ()) + if (pc.has_acls ()) return -1; /* Otherwise FILE_WRITE_ATTRIBUTES is sufficient. */ query_open (query_write_attributes); @@ -798,13 +798,12 @@ fhandler_disk_file::fchmod (mode_t mode) goto out; } - if (allow_ntsec && pc.has_acls ()) + if (pc.has_acls ()) { if (pc.isdir ()) mode |= S_IFDIR; if (!set_file_attribute (get_handle (), pc, - ILLEGAL_UID, ILLEGAL_GID, mode) - && allow_ntsec) + ILLEGAL_UID, ILLEGAL_GID, mode)) res = 0; } @@ -823,7 +822,7 @@ fhandler_disk_file::fchmod (mode_t mode) status = NtSetInformationFile (get_handle (), &io, &fbi, sizeof fbi, FileBasicInformation); /* Correct NTFS security attributes have higher priority */ - if (!allow_ntsec || !pc.has_acls ()) + if (!pc.has_acls ()) { if (!NT_SUCCESS (status)) __seterrno_from_nt_status (status); @@ -843,7 +842,7 @@ fhandler_disk_file::fchown (__uid32_t uid, __gid32_t gid) { int oret = 0; - if (!pc.has_acls () || !allow_ntsec) + if (!pc.has_acls ()) { /* fake - if not supported, pretend we're like win95 where it just works */ @@ -887,7 +886,7 @@ fhandler_disk_file::facl (int cmd, int nentries, __aclent32_t *aclbufp) int res = -1; int oret = 0; - if (!pc.has_acls () || !allow_ntsec) + if (!pc.has_acls ()) { cant_access_acl: switch (cmd) @@ -1388,7 +1387,7 @@ fhandler_disk_file::mkdir (mode_t mode) SECURITY_ATTRIBUTES sa = sec_none_nih; security_descriptor sd; - if (allow_ntsec && has_acls ()) + if (has_acls ()) set_security_attribute (S_IFDIR | ((mode & 07777) & ~cygheap->umask), &sa, sd); -- cgit v1.2.3