summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/conf/conf_mod.c
diff options
context:
space:
mode:
authorderaadt <>2015-04-11 16:03:21 +0000
committerderaadt <>2015-04-11 16:03:21 +0000
commitb6e092d1e41107edc3265fcda97c497aa21950e1 (patch)
tree02ee416418c40719cf48cd968d4b546afbaf642a /src/lib/libcrypto/conf/conf_mod.c
parent3de00996e453d8f15c3be32318c2c06666256670 (diff)
downloadopenbsd-b6e092d1e41107edc3265fcda97c497aa21950e1.tar.gz
openbsd-b6e092d1e41107edc3265fcda97c497aa21950e1.tar.bz2
openbsd-b6e092d1e41107edc3265fcda97c497aa21950e1.zip
Remove all getenv() calls, especially those wrapped by issetugid().
getenv()'s wrapped by issetugid() are safe, but issetugid() is correct difficult to impliment on many operating systems. By accident, a grand experiment was run over the last year, where issetugid() returned 1 (the safe value) on a few operating systems. Noone noticed & complained that certain environment variables were not working....... ok doug beck jsing, discussion with others
Diffstat (limited to 'src/lib/libcrypto/conf/conf_mod.c')
-rw-r--r--src/lib/libcrypto/conf/conf_mod.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/lib/libcrypto/conf/conf_mod.c b/src/lib/libcrypto/conf/conf_mod.c
index 4363f297c7..cb54cc2a87 100644
--- a/src/lib/libcrypto/conf/conf_mod.c
+++ b/src/lib/libcrypto/conf/conf_mod.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: conf_mod.c,v 1.25 2014/07/22 02:21:20 beck Exp $ */ 1/* $OpenBSD: conf_mod.c,v 1.26 2015/04/11 16:03:21 deraadt Exp $ */
2/* Written by Stephen Henson (steve@openssl.org) for the OpenSSL 2/* Written by Stephen Henson (steve@openssl.org) for the OpenSSL
3 * project 2001. 3 * project 2001.
4 */ 4 */
@@ -546,10 +546,6 @@ CONF_get1_default_config_file(void)
546{ 546{
547 char *file = NULL; 547 char *file = NULL;
548 548
549 if (issetugid() == 0)
550 file = getenv("OPENSSL_CONF");
551 if (file)
552 return strdup(file);
553 if (asprintf(&file, "%s/openssl.cnf", 549 if (asprintf(&file, "%s/openssl.cnf",
554 X509_get_default_cert_area()) == -1) 550 X509_get_default_cert_area()) == -1)
555 return (NULL); 551 return (NULL);