summaryrefslogtreecommitdiff
path: root/modules/pam_rootok/pam_rootok.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pam_rootok/pam_rootok.c')
-rw-r--r--modules/pam_rootok/pam_rootok.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/modules/pam_rootok/pam_rootok.c b/modules/pam_rootok/pam_rootok.c
index 17baabe4..3a00d545 100644
--- a/modules/pam_rootok/pam_rootok.c
+++ b/modules/pam_rootok/pam_rootok.c
@@ -1,7 +1,5 @@
-/* pam_rootok module */
-
/*
- * $Id$
+ * pam_rootok module
*
* Written by Andrew Morgan <morgan@linux.kernel.org> 1996/3/11
*/
@@ -14,15 +12,6 @@
#include <stdarg.h>
#include <string.h>
-/*
- * here, we make a definition for the externally accessible function
- * in this file (this definition is required for static a module
- * but strongly encouraged generally) it is used to instruct the
- * modules include file to define the function prototypes.
- */
-
-#define PAM_SM_AUTH
-
#include <security/pam_modules.h>
#include <security/pam_ext.h>
@@ -61,7 +50,7 @@ _pam_parse (const pam_handle_t *pamh, int argc, const char **argv)
#ifdef WITH_SELINUX
static int
-log_callback (int type, const char *fmt, ...)
+log_callback (int type UNUSED, const char *fmt, ...)
{
int audit_fd;
va_list ap;
@@ -73,12 +62,15 @@ log_callback (int type, const char *fmt, ...)
if (audit_fd >= 0) {
char *buf;
- if (vasprintf (&buf, fmt, ap) < 0)
+ if (vasprintf (&buf, fmt, ap) < 0) {
+ va_end(ap);
return 0;
+ }
audit_log_user_avc_message(audit_fd, AUDIT_USER_AVC, buf, NULL, NULL,
NULL, 0);
audit_close(audit_fd);
free(buf);
+ va_end(ap);
return 0;
}