diff options
author | Christopher Faylor <cgf@redhat.com> | 2003-04-04 05:58:29 +0000 |
---|---|---|
committer | Christopher Faylor <cgf@redhat.com> | 2003-04-04 05:58:29 +0000 |
commit | a61b224d3977401fbcc0bf963f8a2ad870ad6ef1 (patch) | |
tree | e2f04a90879378c54ce4bbb8a52517f3e067f9bc | |
parent | 358704cc2081a155ce4b79acb9a3355b16919e95 (diff) | |
download | gdb-a61b224d3977401fbcc0bf963f8a2ad870ad6ef1.tar.gz |
merge from trunk
-rw-r--r-- | winsup/cygwin/ChangeLog | 18 | ||||
-rw-r--r-- | winsup/cygwin/cygthread.cc | 9 | ||||
-rw-r--r-- | winsup/cygwin/external.cc | 14 | ||||
-rw-r--r-- | winsup/cygwin/include/cygwin/version.h | 3 | ||||
-rw-r--r-- | winsup/cygwin/include/sys/cygwin.h | 3 |
5 files changed, 41 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 1191955c1f5..474767ebccb 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,17 @@ +2003-04-04 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (operator new): Be more defensive when messing with + threads that are marked "unavailable". + +2003-04-03 Christopher Faylor <cgf@redhat.com> + + * fhandler_console.cc (CONVERT_LIMIT): Use a size for the 21st century. + +2003-04-03 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (check_ntsec): Return general ntsec state on NULL + filename. Check wincap.is_security() additionally. + 2003-04-02 Christopher Faylor <cgf@redhat.com> * Makefile.in (EXTRA_OFILES): Remove debugging object. @@ -118,8 +132,8 @@ 2003-03-27 Joe Buehler <jhpb@draco.hekimian.com> - * autoload.cc: added RegGetKeySecurity() - * security.cc (get_nt_object_attribute): use RegGetKeySecurity() for + * autoload.cc: Add RegGetKeySecurity(). + * security.cc (get_nt_object_attribute): Use RegGetKeySecurity() for performance. 2003-03-25 Christopher Faylor <cgf@redhat.com> diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc index e11cc6c5e79..fd946e4ad7d 100644 --- a/winsup/cygwin/cygthread.cc +++ b/winsup/cygwin/cygthread.cc @@ -136,7 +136,9 @@ new (size_t) /* Search the threads array for an empty slot to use */ for (info = threads; info < threads + NTHREADS; info++) - if ((id = (DWORD) InterlockedExchange ((LPLONG) &info->avail, 0))) + if ((LONG) (id = (DWORD) InterlockedExchange ((LPLONG) &info->avail, -1)) < 0) + /* being considered */; + else if (id > 0) { #ifdef DEBUGGING if (info->__name) @@ -146,7 +148,9 @@ new (size_t) #endif goto out; } - else if (!info->id) + else if (info->id) + InterlockedExchange ((LPLONG) &info->avail, 0); + else { info->h = CreateThread (&sec_none_nih, 0, cygthread::stub, info, CREATE_SUSPENDED, &info->id); @@ -162,6 +166,7 @@ new (size_t) info = freerange (); /* exhausted thread pool */ out: + InterlockedExchange ((LPLONG) &info->avail, 0); cygthread_protect->release (); return info; } diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc index a019af839db..c1a829adcc3 100644 --- a/winsup/cygwin/external.cc +++ b/winsup/cygwin/external.cc @@ -120,6 +120,15 @@ get_cygdrive_prefixes (char *user, char *system) return res; } +static DWORD +check_ntsec (const char *filename) +{ + if (!filename) + return wincap.has_security () && allow_ntsec; + path_conv pc (filename); + return wincap.has_security () && allow_ntsec && pc.has_acls (); +} + extern "C" unsigned long cygwin_internal (cygwin_getinfo_types t, ...) { @@ -246,6 +255,11 @@ cygwin_internal (cygwin_getinfo_types t, ...) pinfo p (pid); return (DWORD) p->cmdline (n); } + case CW_CHECK_NTSEC: + { + char *filename = va_arg (arg, char *); + return check_ntsec (filename); + } default: return (DWORD) -1; } diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index 6ca91004a3b..dd5af1eab4b 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -197,12 +197,13 @@ details. */ fgetpos64 fopen64 freopen64 fseeko64 fsetpos64 ftello64 _open64 _lseek64 _fstat64 _stat64 mknod32 80: Export pthread_rwlock stuff + 81: CW_CHECK_NTSEC addition to external.cc */ /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ #define CYGWIN_VERSION_API_MAJOR 0 -#define CYGWIN_VERSION_API_MINOR 80 +#define CYGWIN_VERSION_API_MINOR 81 /* There is also a compatibity version number associated with the shared memory regions. It is incremented when incompatible diff --git a/winsup/cygwin/include/sys/cygwin.h b/winsup/cygwin/include/sys/cygwin.h index 5985db68cb2..dccff206862 100644 --- a/winsup/cygwin/include/sys/cygwin.h +++ b/winsup/cygwin/include/sys/cygwin.h @@ -71,7 +71,8 @@ typedef enum CW_STRACE_ACTIVE, CW_CYGWIN_PID_TO_WINPID, CW_EXTRACT_DOMAIN_AND_USER, - CW_CMDLINE + CW_CMDLINE, + CW_CHECK_NTSEC } cygwin_getinfo_types; #define CW_NEXTPID 0x80000000 /* or with pid to get next one */ |