diff options
-rw-r--r-- | winsup/cygwin/ChangeLog | 50 | ||||
-rw-r--r-- | winsup/cygwin/Makefile.in | 8 | ||||
-rw-r--r-- | winsup/cygwin/cygwin.din | 4 | ||||
-rw-r--r-- | winsup/cygwin/exceptions.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 6 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_serial.cc | 4 | ||||
-rw-r--r-- | winsup/cygwin/include/cygwin/version.h | 3 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 14 | ||||
-rw-r--r-- | winsup/cygwin/path.h | 6 | ||||
-rw-r--r-- | winsup/cygwin/security.cc | 10 | ||||
-rw-r--r-- | winsup/cygwin/times.cc | 4 | ||||
-rw-r--r-- | winsup/cygwin/wincap.cc | 11 | ||||
-rw-r--r-- | winsup/cygwin/wincap.h | 2 |
13 files changed, 95 insertions, 29 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 03ab86d2e4e..cf1c64b554b 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,53 @@ +2002-07-25 Christopher Faylor <cgf@redhat.com> + + * security.cc (allow_ntsec): Default to on. + (allow_smbntsec): Default to off. + +2002-07-24 David MacMahon <davidm@smartsc.com> + + * times.cc (to_time_t): Always round time_t down to nearest second. + +2002-07-25 Egor Duda <deo@logos-m.ru> + + * Makefile.in: Check if API version is updated when exports are + changed and stop if not so. + +2002-07-24 Egor Duda <deo@logos-m.ru> + + * include/cygwin/version.h: Bump minor API version. + +2002-07-24 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_serial.cc: Change 'must_init_serial_line capability' + to 'supports_reading_modem_output_lines' throughout (negated meaning). + * wincap.cc: Ditto. + * wincap.h: Ditto. + +2002-07-23 Nicholas Wourms <nwourms@netscape.net> + + * cygwin.din (fcloseall): Add symbol for export. + (fcloseall_r): Ditto. + +2002-07-24 Christopher Faylor <cgf@redhat.com> + + * path.cc (path_conv::check): Always set fileattr when component == 0. + (readlink): Use path_conv method rather than field. + * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Ditto, + throughout. + * path.h (path_conv): Make fileattr private. + * exceptions.cc (try_to_debug): Default to idle priority when looping. + +2002-07-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_serial.cc: Use must_init_serial_line capability throughout. + * wincap.cc: Set flag must_init_serial_line appropriately. + * wincap.h: Add flag must_init_serial_line. + +2002-07-23 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_group_sidlist): Create group list from /etc files + even if DC is available but access fails. + 2002-07-22 Christopher Faylor <cgf@redhat.com> * fhandler_serial.cc: Fix formatting problems introduced by below diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in index 2675f8f4d15..c6fc06491eb 100644 --- a/winsup/cygwin/Makefile.in +++ b/winsup/cygwin/Makefile.in @@ -149,6 +149,8 @@ NEW_FUNCTIONS:=regcomp posix_regcomp \ regexec posix_regexec \ regfree posix_regfree +API_VER:=$(srcdir)/include/cygwin/version.h + PWD:=${shell pwd} SUBLIBS:=libpthread.a $(PWD)/libm.a libc.a EXTRALIBS:=libautomode.a libbinmode.a libtextmode.a @@ -252,7 +254,7 @@ maintainer-clean realclean: clean # Rule to build cygwin.dll -new-$(DLL_NAME): $(LDSCRIPT) $(DLL_OFILES) $(DEF_FILE) $(DLL_IMPORTS) $(LIBC) $(LIBM) Makefile winver_stamp +new-$(DLL_NAME): $(LDSCRIPT) $(DLL_OFILES) $(DEF_FILE) $(DLL_IMPORTS) $(LIBC) $(LIBM) $(API_VER) Makefile winver_stamp $(CXX) $(CXXFLAGS) -nostdlib -Wl,-T$(firstword $^) -Wl,--out-implib,cygdll.a -shared -o $@ \ -e $(DLL_ENTRY) $(DEF_FILE) $(DLL_OFILES) version.o winver.o \ $(DLL_IMPORTS) $(MALLOC_OBJ) $(LIBM) $(LIBC) \ @@ -277,6 +279,10 @@ dll_ofiles: $(DLL_OFILES) $(LIBGMON_A): $(GMON_OFILES) $(GMON_START) $(AR) rcv $(LIBGMON_A) $(GMON_OFILES) +$(API_VER): $(srcdir)/cygwin.din + @echo Error: Version info is older than DLL API! + @false + version.cc winver.o: winver_stamp @ : diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/cygwin.din index b7cd593be56..0c2bc4ba9b4 100644 --- a/winsup/cygwin/cygwin.din +++ b/winsup/cygwin/cygwin.din @@ -213,6 +213,10 @@ _fchown = fchown fchown32 fclose _fclose = fclose +fcloseall +_fcloseall = fcloseall +_fcloseall_r +fcloseall_r = _fcloseall_r _fcntl fcntl = _fcntl fcvt diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 764ae5a8464..f907b21a460 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -391,9 +391,9 @@ try_to_debug (bool waitloop) system_printf ("Failed to start debugger: %E"); else { + SetThreadPriority (hMainThread, THREAD_PRIORITY_IDLE); if (!waitloop) return 1; - SetThreadPriority (hMainThread, THREAD_PRIORITY_IDLE); while (!being_debugged ()) /* spin */; Sleep (4000); diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 95081f06135..738416fbf9d 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -260,7 +260,7 @@ fhandler_disk_file::fstat_helper (struct __stat64 *buf, path_conv *pc, buf->st_mode = 0; /* Using a side effect: get_file_attibutes checks for directory. This is used, to set S_ISVTX, if needed. */ - if (pc->fileattr & FILE_ATTRIBUTE_DIRECTORY) + if (pc->isdir ()) buf->st_mode = S_IFDIR; else if (pc->issymlink ()) buf->st_mode = S_IFLNK; @@ -273,7 +273,7 @@ fhandler_disk_file::fstat_helper (struct __stat64 *buf, path_conv *pc, &uid, &gid) == 0) { /* If read-only attribute is set, modify ntsec return value */ - if ((pc->fileattr & FILE_ATTRIBUTE_READONLY) && !get_symlink_p ()) + if (pc->has_attribute (FILE_ATTRIBUTE_READONLY) && !get_symlink_p ()) buf->st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH); if (!(buf->st_mode & S_IFMT)) @@ -283,7 +283,7 @@ fhandler_disk_file::fstat_helper (struct __stat64 *buf, path_conv *pc, { buf->st_mode |= STD_RBITS; - if (!(pc->fileattr & FILE_ATTRIBUTE_READONLY)) + if (!pc->has_attribute (FILE_ATTRIBUTE_READONLY)) buf->st_mode |= STD_WBITS; /* | S_IWGRP | S_IWOTH; we don't give write to group etc */ diff --git a/winsup/cygwin/fhandler_serial.cc b/winsup/cygwin/fhandler_serial.cc index 0b646417866..748eb4b2833 100644 --- a/winsup/cygwin/fhandler_serial.cc +++ b/winsup/cygwin/fhandler_serial.cc @@ -272,7 +272,7 @@ fhandler_serial::open (path_conv *, int flags, mode_t mode) request TIOCMGET could return correct value of RTS and DTR lines. Important only for Win 9x systems */ - if (!wincap.is_winnt ()) + if (!wincap.supports_reading_modem_output_lines ()) { if (EscapeCommFunction (get_handle (), SETDTR) == 0) system_printf ("couldn't set initial state of DTR for %s, %E", get_name ()); @@ -409,7 +409,7 @@ fhandler_serial::ioctl (unsigned int cmd, void *buffer) modemStatus |= TIOCM_RI; if (modemLines & MS_RLSD_ON) modemStatus |= TIOCM_CD; - if (!wincap.is_winnt ()) + if (!wincap.supports_reading_modem_output_lines ()) modemStatus |= rts | dtr; else { diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index 58bed43219e..eb076c2f3ef 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -152,12 +152,13 @@ details. */ 52: Export strptime 53: Export strlcat, strlcpy. 54: Export __fpclassifyd, __fpclassifyf, __signbitd, __signbitf. + 55: Export fcloseall, fcloseall_r. */ /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ #define CYGWIN_VERSION_API_MAJOR 0 -#define CYGWIN_VERSION_API_MINOR 54 +#define CYGWIN_VERSION_API_MINOR 55 /* There is also a compatibity version number associated with the shared memory regions. It is incremented when incompatible diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index c09b4591f37..f4527afd847 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -447,7 +447,6 @@ path_conv::check (const char *src, unsigned opt, error = 0; else if ((error = check_null_empty_str (src))) return; - /* This loop handles symlink expansion. */ for (;;) { @@ -603,7 +602,10 @@ path_conv::check (const char *src, unsigned opt, if (!(opt & PC_SYM_IGNORE)) { if (!component) - path_flags = sym.pflags; + { + fileattr = sym.fileattr; + path_flags = sym.pflags; + } /* If symlink.check found an existing non-symlink file, then it sets the appropriate flag. It also sets any suffix found @@ -612,10 +614,7 @@ path_conv::check (const char *src, unsigned opt, { error = sym.error; if (component == 0) - { - fileattr = sym.fileattr; - add_ext_from_sym (sym); - } + add_ext_from_sym (sym); if (pcheck_case == PCHECK_RELAXED) goto out; // file found /* Avoid further symlink evaluation. Only case checks are @@ -633,7 +632,6 @@ path_conv::check (const char *src, unsigned opt, if (component == 0 && !need_directory && !(opt & PC_SYM_FOLLOW)) { set_symlink (); // last component of path is a symlink. - fileattr = sym.fileattr; if (opt & PC_SYM_CONTENTS) { strcpy (path, sym.contents); @@ -3072,7 +3070,7 @@ readlink (const char *path, char *buf, int buflen) if (!pathbuf.issymlink ()) { - if (pathbuf.fileattr != INVALID_FILE_ATTRIBUTES) + if (pathbuf.exists ()) set_errno (EINVAL); return -1; } diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h index 3d9b86c150f..f9f55035e78 100644 --- a/winsup/cygwin/path.h +++ b/winsup/cygwin/path.h @@ -70,6 +70,7 @@ struct fs_info class path_conv { char path[MAX_PATH]; + DWORD fileattr; fs_info fs; void add_ext_from_sym (symlink_info&); public: @@ -79,7 +80,6 @@ class path_conv int error; DWORD devn; int unit; - DWORD fileattr; BOOL case_clash; char *normalized_path; @@ -138,8 +138,8 @@ class path_conv check (src, opt | PC_NULLEMPTY, suffixes); } - path_conv (): path_flags (0), known_suffix (NULL), error (0), devn (0), - unit (0), fileattr (INVALID_FILE_ATTRIBUTES), + path_conv (): fileattr (INVALID_FILE_ATTRIBUTES), path_flags (0), + known_suffix (NULL), error (0), devn (0), unit (0), normalized_path (NULL) {path[0] = '\0';} inline char *get_win32 () { return path; } diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 6e79c00db58..a89ff2972cd 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -41,11 +41,11 @@ details. */ #include "lm.h" extern BOOL allow_ntea; -BOOL allow_ntsec; +BOOL allow_ntsec = true; /* 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; +BOOL allow_smbntsec; extern "C" void cygwin_set_impersonation_token (const HANDLE hToken) @@ -525,10 +525,8 @@ get_group_sidlist (cygsidlist &grp_list, auth_pos = grp_list.count - 1; } extract_nt_dom_user (pw, domain, user); - /* Fail silently if DC is not reachable */ - if (get_logon_server (domain, server, wserver) && - !get_user_groups (wserver, grp_list, user, domain)) - return FALSE; + if (get_logon_server (domain, server, wserver)) + get_user_groups (wserver, grp_list, user, domain); get_unix_group_sidlist (pw, grp_list); if (!get_user_local_groups (grp_list, usersid)) return FALSE; diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc index 7a9a3eb3300..a7dec6a9b94 100644 --- a/winsup/cygwin/times.cc +++ b/winsup/cygwin/times.cc @@ -212,7 +212,6 @@ to_time_t (FILETIME *ptr) stuffed into two long words. A time_t is the number of seconds since jan 1 1970. */ - long rem; long long x = ((long long) ptr->dwHighDateTime << 32) + ((unsigned)ptr->dwLowDateTime); /* pass "no time" as epoch */ @@ -220,10 +219,7 @@ to_time_t (FILETIME *ptr) return 0; x -= FACTOR; /* number of 100ns between 1601 and 1970 */ - rem = x % ((long long)NSPERSEC); - rem += (NSPERSEC / 2); x /= (long long) NSPERSEC; /* number of 100ns in a second */ - x += (long long) (rem / NSPERSEC); return x; } diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc index 29e33b62691..a702bfeea5d 100644 --- a/winsup/cygwin/wincap.cc +++ b/winsup/cygwin/wincap.cc @@ -46,6 +46,7 @@ static NO_COPY wincaps wincap_unknown = { has_valid_processorlevel:false, has_64bit_file_access:false, has_process_io_counters:false, + supports_reading_modem_output_lines:false, }; static NO_COPY wincaps wincap_95 = { @@ -83,6 +84,7 @@ static NO_COPY wincaps wincap_95 = { has_valid_processorlevel:false, has_64bit_file_access:false, has_process_io_counters:false, + supports_reading_modem_output_lines:false, }; static NO_COPY wincaps wincap_95osr2 = { @@ -120,6 +122,7 @@ static NO_COPY wincaps wincap_95osr2 = { has_valid_processorlevel:false, has_64bit_file_access:false, has_process_io_counters:false, + supports_reading_modem_output_lines:false, }; static NO_COPY wincaps wincap_98 = { @@ -157,6 +160,7 @@ static NO_COPY wincaps wincap_98 = { has_valid_processorlevel:true, has_64bit_file_access:false, has_process_io_counters:false, + supports_reading_modem_output_lines:false, }; static NO_COPY wincaps wincap_98se = { @@ -194,6 +198,7 @@ static NO_COPY wincaps wincap_98se = { has_valid_processorlevel:true, has_64bit_file_access:false, has_process_io_counters:false, + supports_reading_modem_output_lines:false, }; static NO_COPY wincaps wincap_me = { @@ -231,6 +236,7 @@ static NO_COPY wincaps wincap_me = { has_valid_processorlevel:true, has_64bit_file_access:false, has_process_io_counters:false, + supports_reading_modem_output_lines:false, }; static NO_COPY wincaps wincap_nt3 = { @@ -268,6 +274,7 @@ static NO_COPY wincaps wincap_nt3 = { has_valid_processorlevel:true, has_64bit_file_access:true, has_process_io_counters:false, + supports_reading_modem_output_lines:true, }; static NO_COPY wincaps wincap_nt4 = { @@ -305,6 +312,7 @@ static NO_COPY wincaps wincap_nt4 = { has_valid_processorlevel:true, has_64bit_file_access:true, has_process_io_counters:false, + supports_reading_modem_output_lines:true, }; static NO_COPY wincaps wincap_nt4sp4 = { @@ -342,6 +350,7 @@ static NO_COPY wincaps wincap_nt4sp4 = { has_valid_processorlevel:true, has_64bit_file_access:true, has_process_io_counters:false, + supports_reading_modem_output_lines:true, }; static NO_COPY wincaps wincap_2000 = { @@ -379,6 +388,7 @@ static NO_COPY wincaps wincap_2000 = { has_valid_processorlevel:true, has_64bit_file_access:true, has_process_io_counters:true, + supports_reading_modem_output_lines:true, }; static NO_COPY wincaps wincap_xp = { @@ -416,6 +426,7 @@ static NO_COPY wincaps wincap_xp = { has_valid_processorlevel:true, has_64bit_file_access:true, has_process_io_counters:true, + supports_reading_modem_output_lines:true, }; wincapc wincap; diff --git a/winsup/cygwin/wincap.h b/winsup/cygwin/wincap.h index 5820124b7eb..c24b36ae51f 100644 --- a/winsup/cygwin/wincap.h +++ b/winsup/cygwin/wincap.h @@ -47,6 +47,7 @@ struct wincaps unsigned has_valid_processorlevel : 1; unsigned has_64bit_file_access : 1; unsigned has_process_io_counters : 1; + unsigned supports_reading_modem_output_lines : 1; }; class wincapc @@ -98,6 +99,7 @@ public: bool IMPLEMENT (has_valid_processorlevel) bool IMPLEMENT (has_64bit_file_access) bool IMPLEMENT (has_process_io_counters) + bool IMPLEMENT (supports_reading_modem_output_lines) #undef IMPLEMENT }; |