summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/rsaref/rsaref_stubs.c
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2000-04-18 06:25:24 +0000
committerkris <kris@FreeBSD.org>2000-04-18 06:25:24 +0000
commita0eba154d3e138792cbfc004135e7ab7310e0e6a (patch)
tree5c2cfbe7b9d41a1d607a42a8eccd916a3aaef143 /crypto/openssl/rsaref/rsaref_stubs.c
parentae43e7bba1e6570a8839232388a9f18cdbde6e7b (diff)
downloadFreeBSD-src-a0eba154d3e138792cbfc004135e7ab7310e0e6a.zip
FreeBSD-src-a0eba154d3e138792cbfc004135e7ab7310e0e6a.tar.gz
If stderr is closed, report the error message about missing libraries
via syslog instead. Reviewed by: jkh
Diffstat (limited to 'crypto/openssl/rsaref/rsaref_stubs.c')
-rw-r--r--crypto/openssl/rsaref/rsaref_stubs.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/crypto/openssl/rsaref/rsaref_stubs.c b/crypto/openssl/rsaref/rsaref_stubs.c
index d79fcb0..d2a032c 100644
--- a/crypto/openssl/rsaref/rsaref_stubs.c
+++ b/crypto/openssl/rsaref/rsaref_stubs.c
@@ -40,6 +40,8 @@
#ifndef NO_RSA
#include <stdio.h>
+#include <syslog.h>
+#include <unistd.h>
#include <openssl/rsa.h>
#define VERBOSE_STUBS /* undef if you don't want missing rsaref reported */
@@ -61,11 +63,19 @@ getsym(const char *sym)
if (rsalib)
ret = dlsym(rsalib, sym);
#ifdef VERBOSE_STUBS
- if (!ret && !whined) {
- fprintf(stderr, "** %s: Unable to find an RSAREF shared library (%s).\n", sym, RSA_SHLIB);
- fprintf(stderr, "** Install the /usr/ports/security/rsaref port or package and run this\n");
- fprintf(stderr, "** program again. See the OpenSSL chapter in the FreeBSD Handbook, located at\n");
- fprintf(stderr, "** http://www.freebsd.org/handbook/openssl.html, for more information.\n");
+ if (!ret && !whined) {
+ if (isatty(STDERR_FILENO)) {
+ fprintf(stderr, "** %s: Unable to find an RSAREF shared library (%s).\n", sym, RSA_SHLIB);
+ fprintf(stderr, "** Install the /usr/ports/security/rsaref port or package and run this\n");
+ fprintf(stderr, "** program again. See the OpenSSL chapter in the FreeBSD Handbook, located at\n");
+ fprintf(stderr, "** http://www.freebsd.org/handbook/openssl.html, for more information.\n");
+ } else {
+ syslog(LOG_ERR, "** %s: Unable to find an RSAREF shared library \
+(%s). Install the /usr/ports/security/rsaref port or package and run this \
+program again. See the OpenSSL chapter in the FreeBSD Handbook, located at \
+http://www.freebsd.org/handbook/openssl.html, for more information.", \
+sym, RSA_SHLIB);
+ }
whined = 1;
}
#endif
OpenPOWER on IntegriCloud