From 5827f4d98ae9e6f32ed2e20ef647ea0b489ee330 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 19 Dec 2000 19:52:57 +0000 Subject: [PATCH] * environ.cc (struct parse_thing): Add entry for new CYGWIN option `smbntsec'. * path.cc (path_conv::check): Check path for being a remote path. If so and `allow_smbntsec' is set to FALSE, set has_acls to FALSE. * security.cc: Add global definition for `allow_smbntsec'. * security.h: Add extern declaration for `allow_smbntsec'. * fhandler.cc (fhandler_disk_file::open): Eliminate extern declaration of `allow_ntsec'. * syscalls.cc: Ditto. --- winsup/cygwin/ChangeLog | 12 ++++++++++++ winsup/cygwin/environ.cc | 2 ++ winsup/cygwin/fhandler.cc | 1 - winsup/cygwin/path.cc | 7 ++++++- winsup/cygwin/security.cc | 4 ++++ winsup/cygwin/security.h | 1 + winsup/cygwin/syscalls.cc | 2 -- 7 files changed, 25 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index cf2f6a33e..d0dfabf4c 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,15 @@ +Tue Dec 19 16:26:00 2000 Corinna Vinschen + + * environ.cc (struct parse_thing): Add entry for new CYGWIN option + `smbntsec'. + * path.cc (path_conv::check): Check path for being a remote path. + If so and `allow_smbntsec' is set to FALSE, set has_acls to FALSE. + * security.cc: Add global definition for `allow_smbntsec'. + * security.h: Add extern declaration for `allow_smbntsec'. + * fhandler.cc (fhandler_disk_file::open): Eliminate extern declaration + of `allow_ntsec'. + * syscalls.cc: Ditto. + Fri Dec 15 18:54:42 2000 Bradley A. Town * fhandler_console.cc (read): Add support for xterm-style mouse event diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index 615ce1726..09d8195ee 100644 --- a/winsup/cygwin/environ.cc +++ b/winsup/cygwin/environ.cc @@ -29,6 +29,7 @@ details. */ extern BOOL allow_glob; extern BOOL ignore_case_with_glob; extern BOOL allow_ntea; +extern BOOL allow_smbntsec; extern BOOL strip_title_path; extern DWORD chunksize; BOOL reset_com = TRUE; @@ -424,6 +425,7 @@ struct parse_thing {"glob", {func: &glob_init}, isfunc, NULL, {{0}, {s: "normal"}}}, {"ntea", {&allow_ntea}, justset, NULL, {{FALSE}, {TRUE}}}, {"ntsec", {&allow_ntsec}, justset, NULL, {{FALSE}, {TRUE}}}, + {"smbntsec", {&allow_smbntsec}, justset, NULL, {{FALSE}, {TRUE}}}, {"reset_com", {&reset_com}, justset, NULL, {{FALSE}, {TRUE}}}, {"strip_title", {&strip_title_path}, justset, NULL, {{FALSE}, {TRUE}}}, {"title", {&display_title}, justset, NULL, {{FALSE}, {TRUE}}}, diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index d2480df17..f6779614a 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -1254,7 +1254,6 @@ fhandler_disk_file::open (path_conv& real_path, int flags, mode_t mode) } extern BOOL allow_ntea; - extern BOOL allow_ntsec; if (!real_path.isexec () && !allow_ntea && (!allow_ntsec || !real_path.has_acls ()) diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 69f607163..d86f19464 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -405,7 +405,12 @@ out: { debug_printf ("GetVolumeInformation(%s) = OK, full_path(%s), set_has_acls(%d)", tmp_buf, full_path, volflags & FS_PERSISTENT_ACLS); - set_has_acls (volflags & FS_PERSISTENT_ACLS); + if (!allow_smbntsec + && ((tmp_buf[0] == '\\' && tmp_buf[1] == '\\') + || GetDriveType (tmp_buf) == DRIVE_REMOTE)) + set_has_acls (FALSE); + else + set_has_acls (volflags & FS_PERSISTENT_ACLS); /* Known file systems with buggy open calls. Further explanation in fhandler.cc (fhandler_disk_file::open). */ set_has_buggy_open (strcmp (fs_name, "SUNWNFS") == 0); diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 04915781d..67caf689e 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -36,6 +36,10 @@ details. */ extern BOOL allow_ntea; BOOL allow_ntsec = FALSE; +/* allow_smbntsec is handled exclusively in path.cc (path_conv::check). + It's defined here because of it's strong relationship to allow_ntsec. + The default is TRUE to reflect the old behaviour. */ +BOOL allow_smbntsec = TRUE; SID_IDENTIFIER_AUTHORITY sid_auth[] = { {SECURITY_NULL_SID_AUTHORITY}, diff --git a/winsup/cygwin/security.h b/winsup/cygwin/security.h index b6397fe10..bd1b3d891 100644 --- a/winsup/cygwin/security.h +++ b/winsup/cygwin/security.h @@ -15,6 +15,7 @@ int __stdcall get_file_attribute (int, const char *, int *, int __stdcall set_file_attribute (int, const char *, int); int __stdcall set_file_attribute (int, const char *, uid_t, gid_t, int, const char *); extern BOOL allow_ntsec; +extern BOOL allow_smbntsec; /* `lookup_name' should be called instead of LookupAccountName. * logsrv may be NULL, in this case only the local system is used for lookup. diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index d63ab9b8f..103181abf 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -38,8 +38,6 @@ details. */ #include "security.h" #include "cygheap.h" -extern BOOL allow_ntsec; - /* Close all files and process any queued deletions. Lots of unix style applications will open a tmp file, unlink it, but never call close. This function is called by _exit to -- 2.43.5