summaryrefslogtreecommitdiff
path: root/modules/pam_filter
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pam_filter')
-rw-r--r--modules/pam_filter/upperLOWER/upperLOWER.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/modules/pam_filter/upperLOWER/upperLOWER.c b/modules/pam_filter/upperLOWER/upperLOWER.c
index 3ff4b547..d1c10114 100644
--- a/modules/pam_filter/upperLOWER/upperLOWER.c
+++ b/modules/pam_filter/upperLOWER/upperLOWER.c
@@ -27,22 +27,6 @@
/* ---------------------------------------------------------------- */
-#include <stdarg.h>
-#ifdef hpux
-# define log_this syslog
-#else
-static void log_this(int err, const char *format, ...)
-{
- va_list args;
-
- va_start(args, format);
- openlog("upperLOWER", LOG_CONS|LOG_PID, LOG_AUTH);
- vsyslog(err, format, args);
- va_end(args);
- closelog();
-}
-#endif
-
#include <ctype.h>
static void do_transpose(char *buffer,int len)
@@ -66,6 +50,8 @@ int main(int argc, char **argv UNUSED)
void (*before_user)(char *,int);
void (*before_app)(char *,int);
+ openlog("upperLOWER", LOG_CONS|LOG_PID, LOG_AUTHPRIV);
+
#ifdef DEBUG
{
int i;
@@ -82,7 +68,7 @@ int main(int argc, char **argv UNUSED)
#ifdef DEBUG
fprintf(stderr,"filter invoked as conventional executable\n");
#else
- log_this(LOG_ERR, "filter invoked as conventional executable");
+ syslog(LOG_ERR, "filter invoked as conventional executable");
#endif
exit(1);
}
@@ -104,7 +90,7 @@ int main(int argc, char **argv UNUSED)
#ifdef DEBUG
fprintf(stderr,"select failed\n");
#else
- log_this(LOG_WARNING,"select failed");
+ syslog(LOG_WARNING,"select failed");
#endif
break;
}
@@ -120,7 +106,7 @@ int main(int argc, char **argv UNUSED)
if (before_user != NULL)
before_user(buffer, got);
if (_pammodutil_write(STDERR_FILENO, buffer, got) != got ) {
- log_this(LOG_WARNING,"couldn't write %d bytes?!",got);
+ syslog(LOG_WARNING,"couldn't write %d bytes?!",got);
break;
}
}
@@ -133,7 +119,7 @@ int main(int argc, char **argv UNUSED)
if (before_user != NULL)
before_user(buffer, got);
if (_pammodutil_write(STDOUT_FILENO, buffer, got) != got ) {
- log_this(LOG_WARNING,"couldn't write %d bytes!?",got);
+ syslog(LOG_WARNING,"couldn't write %d bytes!?",got);
break;
}
}
@@ -142,19 +128,19 @@ int main(int argc, char **argv UNUSED)
if ( FD_ISSET(STDIN_FILENO, &readers) ) { /* user input */
int got = _pammodutil_read(STDIN_FILENO, buffer, BUFSIZ);
if (got < 0) {
- log_this(LOG_WARNING,"user input junked");
+ syslog(LOG_WARNING,"user input junked");
break;
} else if (got) {
/* translate to give to application */
if (before_app != NULL)
before_app(buffer, got);
if (_pammodutil_write(APPIN_FILENO, buffer, got) != got ) {
- log_this(LOG_WARNING,"couldn't pass %d bytes!?",got);
+ syslog(LOG_WARNING,"couldn't pass %d bytes!?",got);
break;
}
} else {
/* nothing received -- an error? */
- log_this(LOG_WARNING,"user input null?");
+ syslog(LOG_WARNING,"user input null?");
break;
}
}