[openssl-commits] [openssl] master update

paul.dale at oracle.com paul.dale at oracle.com
Mon Aug 20 01:12:53 UTC 2018


The branch master has been updated
       via  756510c102885005c2fc31eb01e3a6b95f8ed985 (commit)
      from  723bd004730a773354dcdc579d62e99a7e125cee (commit)


- Log -----------------------------------------------------------------
commit 756510c102885005c2fc31eb01e3a6b95f8ed985
Author: Pauli <paul.dale at oracle.com>
Date:   Fri Aug 17 14:35:37 2018 +1000

    Check getauxval on systems that have it when checking for setuid execution.
    
    Reviewed-by: Kurt Roeckx <kurt at roeckx.be>
    Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
    (Merged from https://github.com/openssl/openssl/pull/6993)

-----------------------------------------------------------------------

Summary of changes:
 crypto/uid.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/crypto/uid.c b/crypto/uid.c
index 4e1890f..b2bfee3 100644
--- a/crypto/uid.c
+++ b/crypto/uid.c
@@ -31,12 +31,18 @@ int OPENSSL_issetugid(void)
 # 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)
 {
-    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


More information about the openssl-commits mailing list