diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 4b7f1983c..d3e12470c 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2015-03-03 Corinna Vinschen + + * common.din (issetugid): Export. + * glob.cc (issetugid): Drop macro. + * sec_auth.cc (issetugid): New exported function. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + 2015-03-02 Corinna Vinschen * security.cc (get_attribute_from_acl): Don't spill Everyone permissions diff --git a/winsup/cygwin/common.din b/winsup/cygwin/common.din index 17538ffbe..42098ff30 100644 --- a/winsup/cygwin/common.din +++ b/winsup/cygwin/common.din @@ -639,6 +639,7 @@ isnan NOSIGFE isnanf NOSIGFE isprint NOSIGFE ispunct NOSIGFE +issetugid NOSIGFE isspace NOSIGFE isupper NOSIGFE iswalnum NOSIGFE diff --git a/winsup/cygwin/glob.cc b/winsup/cygwin/glob.cc index be2a6013b..b61436de1 100644 --- a/winsup/cygwin/glob.cc +++ b/winsup/cygwin/glob.cc @@ -103,7 +103,6 @@ __FBSDID("$FreeBSD: src/lib/libc/gen/glob.c,v 1.28 2010/05/12 17:44:00 gordon Ex #define getpwuid(uid) getpwuid32 (uid) #define getuid() getuid32 () -#define issetugid() (cygheap->user.issetuid ()) #define CCHAR(c) (ignore_case_with_glob ? towlower (CHAR (c)) : CHAR (c)) #define Cchar(c) (ignore_case_with_glob ? towlower (c) : (c)) diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index 01c9a761e..6dd690840 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -468,12 +468,13 @@ details. */ 284: Export sockatmark. 285: Export wcstold. 285: Export cabsl, cimagl, creall, finitel, hypotl, sqrtl. + 287: Export issetugid. */ /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ #define CYGWIN_VERSION_API_MAJOR 0 -#define CYGWIN_VERSION_API_MINOR 286 +#define CYGWIN_VERSION_API_MINOR 287 /* There is also a compatibity version number associated with the shared memory regions. It is incremented when incompatible diff --git a/winsup/cygwin/release/1.7.35 b/winsup/cygwin/release/1.7.35 index 500f19b67..51619f273 100644 --- a/winsup/cygwin/release/1.7.35 +++ b/winsup/cygwin/release/1.7.35 @@ -3,6 +3,8 @@ What's new: - New APIs: cabsl, cimagl, creall, finitel, hypotl, sqrtl. +- New API: issetugid. + What changed: ------------- diff --git a/winsup/cygwin/sec_auth.cc b/winsup/cygwin/sec_auth.cc index 78d47cb76..37b53c643 100644 --- a/winsup/cygwin/sec_auth.cc +++ b/winsup/cygwin/sec_auth.cc @@ -31,6 +31,14 @@ details. */ #include "cygserver_setpwd.h" #include +/* OpenBSD 2.0 and later. */ +extern "C" +int +issetugid (void) +{ + return cygheap->user.issetuid () ? 1 : 0; +} + /* Starting with Windows Vista, the token returned by system functions is a restricted token. The full admin token is linked to it and can be fetched with NtQueryInformationToken. This function returns the original