diff options
Diffstat (limited to 'src/lib/libcrypto/conf/conf_api.c')
-rw-r--r-- | src/lib/libcrypto/conf/conf_api.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/libcrypto/conf/conf_api.c b/src/lib/libcrypto/conf/conf_api.c index 21ce4d9fe5..7480dda3d5 100644 --- a/src/lib/libcrypto/conf/conf_api.c +++ b/src/lib/libcrypto/conf/conf_api.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: conf_api.c,v 1.10 2014/06/12 15:49:28 deraadt Exp $ */ | 1 | /* $OpenBSD: conf_api.c,v 1.11 2014/06/23 22:19:02 deraadt Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -66,6 +66,7 @@ | |||
66 | #include <assert.h> | 66 | #include <assert.h> |
67 | #include <stdlib.h> | 67 | #include <stdlib.h> |
68 | #include <string.h> | 68 | #include <string.h> |
69 | #include <unistd.h> | ||
69 | #include <openssl/conf.h> | 70 | #include <openssl/conf.h> |
70 | #include <openssl/conf_api.h> | 71 | #include <openssl/conf_api.h> |
71 | 72 | ||
@@ -142,7 +143,10 @@ _CONF_get_string(const CONF *conf, const char *section, const char *name) | |||
142 | if (v != NULL) | 143 | if (v != NULL) |
143 | return (v->value); | 144 | return (v->value); |
144 | if (strcmp(section, "ENV") == 0) { | 145 | if (strcmp(section, "ENV") == 0) { |
145 | p = getenv(name); | 146 | if (issetugid() == 0) |
147 | p = getenv(name); | ||
148 | else | ||
149 | p = NULL; | ||
146 | if (p != NULL) | 150 | if (p != NULL) |
147 | return (p); | 151 | return (p); |
148 | } | 152 | } |
@@ -154,8 +158,11 @@ _CONF_get_string(const CONF *conf, const char *section, const char *name) | |||
154 | return (v->value); | 158 | return (v->value); |
155 | else | 159 | else |
156 | return (NULL); | 160 | return (NULL); |
157 | } else | 161 | } else { |
162 | if (issetugid()) | ||
163 | return (NULL); | ||
158 | return (getenv(name)); | 164 | return (getenv(name)); |
165 | } | ||
159 | } | 166 | } |
160 | 167 | ||
161 | #if 0 /* There's no way to provide error checking with this function, so | 168 | #if 0 /* There's no way to provide error checking with this function, so |