Download | Plain Text | No Line Numbers
- /*
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- Derived from checkpassword-pam by Alexey Mahotkin <alexm@hsys.msk.ru> 2002-2004
- Modified and enhanced by Manuel Mausz 2017
- */
-
- #define _DEFAULT_SOURCE 1
-
- #include <stdio.h>
- #include <stdarg.h>
- #include <syslog.h>
-
- #include "logging.h"
-
- extern int opt_debug;
- extern int opt_use_syslog;
-
- inline void log_init(const char *ident)
- {
- if (opt_use_syslog)
- openlog(ident, LOG_PID, LOG_AUTH);
- }
-
- inline void log_close()
- {
- closelog();
- }
-
- void log_error(const char *format, ...)
- {
- va_list args;
-
- if (opt_use_syslog)
- (void)vsyslog(LOG_ERR, format, args);
- else {
- }
- }
-
- void log_debug(const char *format, ...)
- {
- if (!opt_debug)
- return;
-
- va_list args;
- if (opt_use_syslog)
- (void)vsyslog(LOG_DEBUG, format, args);
- else {
- }
- }
-
-