mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-31 11:30:56 +08:00
* 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.
This commit is contained in:
parent
a49625d566
commit
6e070c257c
@ -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.
|
||||
|
@ -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 \
|
||||
|
@ -541,12 +541,6 @@ set_proc_retry (const char *buf)
|
||||
child_info::retry_count = strtoul (buf, NULL, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
set_ntea (const char *buf)
|
||||
{
|
||||
allow_ntea = (buf && strcasematch (buf, "yes"));
|
||||
}
|
||||
|
||||
static void
|
||||
set_ntsec (const char *buf)
|
||||
{
|
||||
@ -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}}},
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 () == '.')
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user