summaryrefslogtreecommitdiffstats
path: root/crypto
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
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')
-rw-r--r--crypto/openssl/crypto/rsa/rsa_stubs.c22
-rw-r--r--crypto/openssl/rsaref/rsaref_stubs.c20
2 files changed, 31 insertions, 11 deletions
diff --git a/crypto/openssl/crypto/rsa/rsa_stubs.c b/crypto/openssl/crypto/rsa/rsa_stubs.c
index 6189a4c..406d00a 100644
--- a/crypto/openssl/crypto/rsa/rsa_stubs.c
+++ b/crypto/openssl/crypto/rsa/rsa_stubs.c
@@ -29,6 +29,8 @@
#ifndef NO_RSA
#include <stdio.h>
+#include <syslog.h>
+#include <unistd.h>
#include "cryptlib.h"
#include <openssl/rsa.h>
@@ -54,12 +56,20 @@ getsym(const char *sym)
if (rsalib)
ret = dlsym(rsalib, sym);
#ifdef VERBOSE_STUBS
- if (!ret && !whined) {
- fprintf(stderr, "** %s: Unable to find an RSA implementation shared library.\n", sym);
- fprintf(stderr, "** Install either the USA (%s) or International (%s)\n", RSAUSA_SHLIB, RSAINTL_SHLIB);
- fprintf(stderr, "** RSA library on your system and run this program again.\n");
- fprintf(stderr, "** 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 RSA implementation shared library.\n", sym);
+ fprintf(stderr, "** Install either the USA (%s) or International (%s)\n", RSAUSA_SHLIB, RSAINTL_SHLIB);
+ fprintf(stderr, "** RSA library on your system and run this program again.\n");
+ fprintf(stderr, "** 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 RSA implementation shared \
+library. Install either the USA (%s) or International (%s) RSA library on \
+your system 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, RSAUSA_SHLIB, RSAINTL_SHLIB);
+ }
whined = 1;
}
#endif
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