summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtchang%redhat.com <devnull@localhost>2006-09-23 19:39:16 +0000
committerwtchang%redhat.com <devnull@localhost>2006-09-23 19:39:16 +0000
commit500ab3e3546fd0247a185b78d8c6f900df264ce9 (patch)
tree5544d70392a881edecb36b8961357bf806364e17
parentedf591b63d6c33cb4c61428cbf2349f7cb3f384d (diff)
downloadnss-hg-500ab3e3546fd0247a185b78d8c6f900df264ce9.tar.gz
Bug 352754: Backported the fix for bug 351482 to the MOZILLA_1_8_BRANCH.
a=mtschrep for Mozilla 1.8 RC2.
-rw-r--r--security/nss/lib/softoken/fipstokn.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/security/nss/lib/softoken/fipstokn.c b/security/nss/lib/softoken/fipstokn.c
index 279ffaa12..3c2e54f44 100644
--- a/security/nss/lib/softoken/fipstokn.c
+++ b/security/nss/lib/softoken/fipstokn.c
@@ -84,6 +84,8 @@ static void (*audit_close_func)(int fd);
static int (*audit_log_user_message_func)(int audit_fd, int type,
const char *message, const char *hostname, const char *addr,
const char *tty, int result);
+static int (*audit_send_user_message_func)(int fd, int type,
+ const char *message);
static pthread_once_t libaudit_once_control = PTHREAD_ONCE_INIT;
@@ -96,8 +98,16 @@ libaudit_init(void)
}
audit_open_func = dlsym(libaudit_handle, "audit_open");
audit_close_func = dlsym(libaudit_handle, "audit_close");
+ /*
+ * audit_send_user_message is the older function.
+ * audit_log_user_message, if available, is preferred.
+ */
audit_log_user_message_func = dlsym(libaudit_handle,
"audit_log_user_message");
+ if (!audit_log_user_message_func) {
+ audit_send_user_message_func = dlsym(libaudit_handle,
+ "audit_send_user_message");
+ }
}
#endif /* LINUX */
@@ -353,8 +363,12 @@ sftk_LogAuditMessage(NSSAuditSeverity severity, const char *msg)
PR_smprintf_free(message);
return;
}
- audit_log_user_message_func(audit_fd, AUDIT_USER, message,
- NULL, NULL, NULL, result);
+ if (audit_log_user_message_func) {
+ audit_log_user_message_func(audit_fd, AUDIT_USER, message,
+ NULL, NULL, NULL, result);
+ } else {
+ audit_send_user_message_func(audit_fd, AUDIT_USER, message);
+ }
audit_close_func(audit_fd);
PR_smprintf_free(message);
}