Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/openpam/dist/lib make sure we have a log messag...



details:   https://anonhg.NetBSD.org/src/rev/7f42b32ef135
branches:  trunk
changeset: 796765:7f42b32ef135
user:      spz <spz%NetBSD.org@localhost>
date:      Tue Jun 17 07:08:47 2014 +0000

description:
make sure we have a log message at the appropriate level (error) on
why pam is failing in the case of an included pam config file missing.

example: instead of logging with the default log settings:
Jun 17 08:49:37 tucana su: pam_start failed: system error
it will log:
Jun 17 08:55:49 tucana su: in openpam_parse_chain(): failed loading include for service gibbetnich in /etc/pam.d/su(15): No such file or directory
Jun 17 08:55:49 tucana su: pam_start failed: system error

diffstat:

 external/bsd/openpam/dist/lib/openpam_configure.c |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r fcd08e2df2e5 -r 7f42b32ef135 external/bsd/openpam/dist/lib/openpam_configure.c
--- a/external/bsd/openpam/dist/lib/openpam_configure.c Tue Jun 17 06:43:21 2014 +0000
+++ b/external/bsd/openpam/dist/lib/openpam_configure.c Tue Jun 17 07:08:47 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: openpam_configure.c,v 1.9 2014/06/03 20:22:54 christos Exp $   */
+/*     $NetBSD: openpam_configure.c,v 1.10 2014/06/17 07:08:47 spz Exp $       */
 
 /*-
  * Copyright (c) 2001-2003 Networks Associates Technology, Inc.
@@ -229,8 +229,19 @@
                                 * outer loop does not just ignore the
                                 * error and keep searching.
                                 */
-                               if (errno == ENOENT)
+                               if (errno == ENOENT) {
+                                       /*
+                                        * we're failing load, make sure
+                                        * there's a log message of severity
+                                        * higher than debug
+                                        */
+                                       openpam_log(PAM_LOG_ERROR,
+                                       "failed loading include for service "
+                                       "%s in %s(%d): %s",
+                                       servicename, filename, lineno,
+                                       strerror(errno));
                                        errno = EINVAL;
+                               }
                                goto fail;
                        }
                        continue;



Home | Main Index | Thread Index | Old Index