projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
key zeroisation fix for p12
[openssl.git]
/
crypto
/
uid.c
diff --git
a/crypto/uid.c
b/crypto/uid.c
index 4e1890f2d285172aef45102f574c435c5fa23517..b2bfee32b562ec5ef5942356dd43a15d095f0c23 100644
(file)
--- a/
crypto/uid.c
+++ b/
crypto/uid.c
@@
-31,12
+31,18
@@
int OPENSSL_issetugid(void)
# include OPENSSL_UNISTD
# include <sys/types.h>
# include OPENSSL_UNISTD
# include <sys/types.h>
+# if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+# if __GLIBC_PREREQ(2, 16)
+# include <sys/auxv.h>
+# endif
+# endif
+
int OPENSSL_issetugid(void)
{
int OPENSSL_issetugid(void)
{
- if (getuid() != geteuid())
-
return 1
;
- if (getgid() != getegid())
-
return 1
;
- return 0;
+# ifdef AT_SECURE
+
return getauxval(AT_SECURE) != 0
;
+# else
+
return getuid() != geteuid() || getgid() != getegid()
;
+# endif
}
#endif
}
#endif