diff options
author | Christopher Faylor <me@cgf.cx> | 2007-03-01 18:13:47 +0300 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2007-03-01 18:13:47 +0300 |
commit | 6e070c257c9026b433cdae7b0ad7f2ba909558bf (patch) | |
tree | b9b2ced0b412b53afd7ae4068de5c604c7db6c71 /winsup | |
parent | a49625d566c34c895ed2eac3055977bb07c319b7 (diff) |
* Makefile (DLL_OFILES): Remove ntea.o
* environ.cc (set_ntea): Delete.
(parse_thing): Delete "ntea" setting.
* fhandler.cc (fhandler_base::open): Remove allow_ntea considerations.
(check_posix_perm): Ditto.
* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Ditto.
(fhandler_base::open_fs): Ditto.
(fhandler_disk_file::mkdir): Ditto.
* path.cc (symlink_worker): Ditto.
* security.cc (get_file_attribute): Ditto.
(set_file_attribute): Ditto.
* security.h: Remove allow_ntea declaration.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 15 | ||||
-rw-r--r-- | winsup/cygwin/Makefile.in | 2 | ||||
-rw-r--r-- | winsup/cygwin/environ.cc | 7 | ||||
-rw-r--r-- | winsup/cygwin/fhandler.cc | 11 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 17 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 4 | ||||
-rw-r--r-- | winsup/cygwin/security.cc | 26 | ||||
-rw-r--r-- | winsup/cygwin/security.h | 1 |
8 files changed, 24 insertions, 59 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index e99409e9c..00ee93c78 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,18 @@ +2007-03-01 Christopher Faylor <me@cgf.cx> + + * Makefile (DLL_OFILES): Remove ntea.o + * environ.cc (set_ntea): Delete. + (parse_thing): Delete "ntea" setting. + * fhandler.cc (fhandler_base::open): Remove allow_ntea considerations. + (check_posix_perm): Ditto. + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Ditto. + (fhandler_base::open_fs): Ditto. + (fhandler_disk_file::mkdir): Ditto. + * path.cc (symlink_worker): Ditto. + * security.cc (get_file_attribute): Ditto. + (set_file_attribute): Ditto. + * security.h: Remove allow_ntea declaration. + 2007-02-27 Corinna Vinschen <corinna@vinschen.de> * path.cc (close_user_proc_parms_cwd_handle): Remove. diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in index 239a500a4..571aac58a 100644 --- a/winsup/cygwin/Makefile.in +++ b/winsup/cygwin/Makefile.in @@ -136,7 +136,7 @@ DLL_OFILES:=assert.o autoload.o bsdlib.o ctype.o cxx.o cygheap.o cygthread.o \ fhandler_zero.o flock.o fnmatch.o fork.o fts.o ftw.o getopt.o glob.o \ grp.o heap.o hookapi.o inet_addr.o inet_network.o init.o ioctl.o ipc.o \ localtime.o lsearch.o malloc_wrapper.o memmem.o minires-os-if.o \ - minires.o miscfuncs.o mktemp.o mmap.o msg.o net.o netdb.o nftw.o ntea.o \ + minires.o miscfuncs.o mktemp.o mmap.o msg.o net.o netdb.o nftw.o \ passwd.o path.o pinfo.o pipe.o poll.o posix_ipc.o pthread.o regcomp.o \ regerror.o regexec.o regfree.o registry.o resource.o rexec.o rcmd.o \ scandir.o sched.o sec_acl.o sec_helper.o security.o select.o sem.o \ diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index a031a7bda..54063d889 100644 --- a/winsup/cygwin/environ.cc +++ b/winsup/cygwin/environ.cc @@ -542,12 +542,6 @@ set_proc_retry (const char *buf) } static void -set_ntea (const char *buf) -{ - allow_ntea = (buf && strcasematch (buf, "yes")); -} - -static void set_ntsec (const char *buf) { allow_ntsec = (buf && strcasematch (buf, "yes")); @@ -591,7 +585,6 @@ static struct parse_thing {"export", {&export_settings}, justset, NULL, {{false}, {true}}}, {"forkchunk", {func: set_chunksize}, isfunc, NULL, {{0}, {0}}}, {"glob", {func: &glob_init}, isfunc, NULL, {{0}, {s: "normal"}}}, - {"ntea", {func: set_ntea}, isfunc, NULL, {{0}, {s: "yes"}}}, {"ntsec", {func: set_ntsec}, isfunc, NULL, {{0}, {s: "yes"}}}, {"proc_retry", {func: set_proc_retry}, isfunc, NULL, {{0}, {5}}}, {"reset_com", {&reset_com}, justset, NULL, {{false}, {true}}}, diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index f92e844c0..33ef6ae4e 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -495,13 +495,11 @@ fhandler_base::open (int flags, mode_t mode) create_options = FILE_OPEN_FOR_BACKUP_INTENT; break; case query_stat_control: - access = READ_CONTROL | FILE_READ_ATTRIBUTES - | (allow_ntea ? FILE_READ_EA : 0); + access = READ_CONTROL | FILE_READ_ATTRIBUTES; create_options = FILE_OPEN_FOR_BACKUP_INTENT; break; case query_write_control: - access = READ_CONTROL | WRITE_OWNER | WRITE_DAC | FILE_WRITE_ATTRIBUTES - | (allow_ntea ? FILE_WRITE_EA : 0); + access = READ_CONTROL | WRITE_OWNER | WRITE_DAC | FILE_WRITE_ATTRIBUTES; create_options = FILE_OPEN_FOR_BACKUP_INTENT | FILE_OPEN_FOR_RECOVERY; break; case query_write_attributes: @@ -1591,11 +1589,6 @@ fhandler_base::fsync () static int check_posix_perm (const char *fname, int v) { - /* ntea is ok for supporting permission bits but it doesn't support - full POSIX security settings. */ - if (v == _PC_POSIX_PERMISSIONS && allow_ntea) - return 1; - if (!allow_ntsec) return 0; diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 3e2e059f9..f40bcb52d 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -653,15 +653,13 @@ fhandler_disk_file::fchmod (mode_t mode) { /* If the file couldn't be opened, that's really only a problem if ACLs or EAs should get written. */ - if ((allow_ntsec && pc.has_acls ()) || allow_ntea) + if (allow_ntsec && pc.has_acls ()) return -1; } } - if ((allow_ntsec && pc.has_acls ()) || allow_ntea) + if (allow_ntsec && pc.has_acls ()) { - if (!allow_ntsec && allow_ntea) /* Not necessary when manipulating SD. */ - SetFileAttributes (pc, (DWORD) pc & ~FILE_ATTRIBUTE_READONLY); if (pc.isdir ()) mode |= S_IFDIR; if (!set_file_attribute (pc.has_acls (), get_io_handle (), pc, @@ -1209,14 +1207,6 @@ fhandler_base::open_fs (int flags, mode_t mode) return 0; } - /* Attributes may be set only if a file is _really_ created. - This code is now only used for ntea here since the files - security attributes are set in CreateFile () now. */ - if (flags & O_CREAT - && GetLastError () != ERROR_ALREADY_EXISTS - && !allow_ntsec && allow_ntea) - set_file_attribute (false, NULL, get_win32_name (), mode); - set_fs_flags (pc.fs_flags ()); out: @@ -1435,9 +1425,6 @@ fhandler_disk_file::mkdir (mode_t mode) if (CreateDirectoryA (get_win32_name (), &sa)) { - if (!allow_ntsec && allow_ntea) - set_file_attribute (false, NULL, get_win32_name (), - S_IFDIR | ((mode & 07777) & ~cygheap->umask)); #ifdef HIDDEN_DOT_FILES char *c = strrchr (real_dir.get_win32 (), '\\'); if ((c && c[1] == '.') || *get_win32_name () == '.') diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index a29eaa7e6..72d8220ee 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -2976,10 +2976,6 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym, if (success) { CloseHandle (h); - if (!allow_ntsec && allow_ntea) - set_file_attribute (false, NULL, win32_path.get_win32 (), - S_IFLNK | S_IRWXU | S_IRWXG | S_IRWXO); - DWORD attr = use_winsym ? FILE_ATTRIBUTE_READONLY : FILE_ATTRIBUTE_SYSTEM; #ifdef HIDDEN_DOT_FILES diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index cc93ae61a..8a468cb24 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -1542,20 +1542,7 @@ get_file_attribute (int use_ntsec, HANDLE handle, const char *file, if (gidret) *gidret = myself->gid; - if (!attribute) - return 0; - - if (allow_ntea) - { - int oatt = *attribute; - res = read_ea (handle, file, ".UNIXATTR", (char *)attribute, - sizeof (*attribute)); - *attribute |= oatt; - } - else - res = 0; - - return res > 0 ? 0 : -1; + return -1; } bool @@ -1930,16 +1917,11 @@ int set_file_attribute (bool use_ntsec, HANDLE handle, const char *file, __uid32_t uid, __gid32_t gid, int attribute) { - int ret = 0; - + int ret; if (use_ntsec && allow_ntsec) ret = set_nt_attribute (handle, file, uid, gid, attribute); - else if (allow_ntea && !write_ea (handle, file, ".UNIXATTR", - (char *) &attribute, sizeof (attribute))) - { - __seterrno (); - ret = -1; - } + else + ret = 0; syscall_printf ("%d = set_file_attribute (%s, %d, %d, %p)", ret, file, uid, gid, attribute); return ret; diff --git a/winsup/cygwin/security.h b/winsup/cygwin/security.h index a5c9c69ce..1270e105d 100644 --- a/winsup/cygwin/security.h +++ b/winsup/cygwin/security.h @@ -330,7 +330,6 @@ legal_sid_type (SID_NAME_USE type) || type == SidTypeAlias || type == SidTypeWellKnownGroup; } -extern bool allow_ntea; extern bool allow_ntsec; extern bool allow_smbntsec; |