Lines Matching +full:pam +full:- +full:enabled
2 * Logging functions for PAM modules.
4 * Logs errors and debugging messages from PAM modules. The debug versions
5 * only log anything if debugging was enabled; the crit and err versions
8 * The canonical version of this file is maintained in the rra-c-util package,
9 * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
13 * Copyright 2005-2007, 2009-2010, 2012-2013
34 * SPDX-License-Identifier: MIT
41 #include <portable/pam.h>
46 #include <pam-util/args.h>
47 #include <pam-util/logging.h>
57 * Mappings of PAM flags to symbolic names for logging when entering a PAM
64 /* clang-format off */
74 /* clang-format on */
105 if (priority == LOG_DEBUG && (pargs == NULL || !pargs->debug)) in log_vplain()
107 if (pargs != NULL && pargs->user != NULL) { in log_vplain()
111 pam_syslog(pargs->pamh, priority, "(user %s) %s", pargs->user, msg); in log_vplain()
114 pam_vsyslog(pargs->pamh, priority, fmt, args); in log_vplain()
140 * Log wrapper function for reporting a PAM error. Log a message with the
142 * authenticated if known, followed by a colon and the formatted PAM error.
143 * However, do not include the colon and the PAM error if the PAM status is
152 if (priority == LOG_DEBUG && (pargs == NULL || !pargs->debug)) in log_pam()
163 pam_strerror(pargs->pamh, status)); in log_pam()
173 /* clang-format off */
198 /* clang-format on */ in LOG_FUNCTION()
202 * Report entry into a function. Takes the PAM arguments, the function name, in LOG_FUNCTION()
211 if (!pargs->debug) in LOG_FUNCTION()
237 pam_syslog(pargs->pamh, LOG_DEBUG, "%s: entry", func); in LOG_FUNCTION()
239 pam_syslog(pargs->pamh, LOG_DEBUG, "%s: entry (%s)", func, out); in LOG_FUNCTION()
247 * want to include various PAM metadata in the log message and put it in a
249 * authentication failure message from Linux PAM.
261 if (pargs->user != NULL) in putil_log_failure()
262 name = pargs->user; in putil_log_failure()
268 pam_get_item(pargs->pamh, PAM_RUSER, (PAM_CONST void **) &ruser); in putil_log_failure()
269 pam_get_item(pargs->pamh, PAM_RHOST, (PAM_CONST void **) &rhost); in putil_log_failure()
270 pam_get_item(pargs->pamh, PAM_TTY, (PAM_CONST void **) &tty); in putil_log_failure()
272 /* clang-format off */ in putil_log_failure()
273 pam_syslog(pargs->pamh, LOG_NOTICE, "%s; logname=%s uid=%ld euid=%ld" in putil_log_failure()
280 /* clang-format on */ in putil_log_failure()
287 * Below are the additional logging functions enabled if built with Kerberos
306 if (priority == LOG_DEBUG && (pargs == NULL || !pargs->debug)) in log_krb5()
311 if (pargs != NULL && pargs->ctx != NULL) { in log_krb5()
312 k5_msg = krb5_get_error_message(pargs->ctx, status); in log_krb5()
319 krb5_free_error_message(pargs->ctx, k5_msg); in log_krb5()
327 /* clang-format off */
343 /* clang-format on */