diff options
author | Brent Cook <bcook@openbsd.org> | 2015-02-16 22:22:29 -0600 |
---|---|---|
committer | Brent Cook <bcook@openbsd.org> | 2015-02-17 18:15:17 -0600 |
commit | a859b93ff583300349ee0b7fb8231cf6c387e269 (patch) | |
tree | 4ae03e67df0c83b43e645e0743de94b92478cf4c /crypto | |
parent | adc416e922f98b4b52093f26c91216e3b4106f3d (diff) | |
download | portable-a859b93ff583300349ee0b7fb8231cf6c387e269.tar.gz portable-a859b93ff583300349ee0b7fb8231cf6c387e269.tar.bz2 portable-a859b93ff583300349ee0b7fb8231cf6c387e269.zip |
disable system issetugid on OS X since it is not fork-safe
Noticed while testing similar code for AIX.
ok beck@
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/Makefile.am | 3 | ||||
-rw-r--r-- | crypto/compat/issetugid_osx.c | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/crypto/Makefile.am b/crypto/Makefile.am index c7d0639..5861a55 100644 --- a/crypto/Makefile.am +++ b/crypto/Makefile.am | |||
@@ -103,6 +103,9 @@ endif | |||
103 | if HOST_HPUX | 103 | if HOST_HPUX |
104 | libcompat_la_SOURCES += compat/issetugid_hpux.c | 104 | libcompat_la_SOURCES += compat/issetugid_hpux.c |
105 | endif | 105 | endif |
106 | if HOST_DARWIN | ||
107 | libcompat_la_SOURCES += compat/issetugid_osx.c | ||
108 | endif | ||
106 | if HOST_WIN | 109 | if HOST_WIN |
107 | libcompat_la_SOURCES += compat/issetugid_win.c | 110 | libcompat_la_SOURCES += compat/issetugid_win.c |
108 | endif | 111 | endif |
diff --git a/crypto/compat/issetugid_osx.c b/crypto/compat/issetugid_osx.c new file mode 100644 index 0000000..ad6cb58 --- /dev/null +++ b/crypto/compat/issetugid_osx.c | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * issetugid implementation for OS X | ||
3 | * Public domain | ||
4 | */ | ||
5 | |||
6 | #include <unistd.h> | ||
7 | |||
8 | /* | ||
9 | * OS X has issetugid, but it is not fork-safe as of version 10.10. | ||
10 | * See this Solaris report for test code that fails similarly: | ||
11 | * http://mcarpenter.org/blog/2013/01/15/solaris-issetugid%282%29-bug | ||
12 | */ | ||
13 | int issetugid(void) | ||
14 | { | ||
15 | return 1; | ||
16 | } | ||