]> granicus.if.org Git - linux-pam/commitdiff
Relevant BUGIDs: 1606180
authorThorsten Kukuk <kukuk@thkukuk.de>
Wed, 13 Dec 2006 10:35:49 +0000 (10:35 +0000)
committerThorsten Kukuk <kukuk@thkukuk.de>
Wed, 13 Dec 2006 10:35:49 +0000 (10:35 +0000)
Purpose of commit: new feature

Commit summary:
---------------

2006-12-13  Thorsten Kukuk  <kukuk@suse.de>

        * modules/pam_localuser/pam_localuser.c: Add support for session
        and chauthtok [SF#1606180].
        * modules/pam_localuser/pam_localuser.8.xml: Document last change.

        * libpam/pam_audit.c (_pam_audit_writelog): Print error message
        only once.

ChangeLog
libpam/pam_audit.c
modules/pam_localuser/pam_localuser.8
modules/pam_localuser/pam_localuser.8.xml
modules/pam_localuser/pam_localuser.c

index 01f27162e0ba51ad6cde9b4694977e3a8802a889..9dd40636b7cd4f0bd91c8fb5a0b6ddf208880fd4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-12-13  Thorsten Kukuk  <kukuk@suse.de>
+
+       * modules/pam_localuser/pam_localuser.c: Add support for session
+       and chauthtok [SF#1606180].
+       * modules/pam_localuser/pam_localuser.8.xml: Document last change.
+
+       * libpam/pam_audit.c (_pam_audit_writelog): Print error message
+       only once.
+
 2006-12-12  Thorsten Kukuk  <kukuk@thkukuk.de>
 
        * libpam/pam_audit.c (_pam_audit_writelog): Print error
index 05be989cf2872d49471dc692f0a50caff07d6095..ff1486aadc830e5527859a7087d4ce8ced583dee 100644 (file)
@@ -25,6 +25,7 @@ static int
 _pam_audit_writelog(pam_handle_t *pamh, int audit_fd, int type,
        const char *message, int retval)
 {
+  static int old_errno = -1;
   int rc;
   char buf[256];
 
@@ -34,8 +35,11 @@ _pam_audit_writelog(pam_handle_t *pamh, int audit_fd, int type,
   rc = audit_log_user_message( audit_fd, type, buf,
         pamh->rhost, NULL, pamh->tty, retval == PAM_SUCCESS );
 
-  if (rc == -1)
-    pam_syslog(pamh, LOG_CRIT, "audit_log_user_message() failed: %m");
+  if (rc == -1 && errno != old_errno)
+    {
+      old_errno = errno;
+      pam_syslog(pamh, LOG_CRIT, "audit_log_user_message() failed: %m");
+    }
 
   pamh->audit_state |= PAMAUDIT_LOGGED;
   return rc;
index c10cd073fb59c646c604c12889d9d2031d6324a6..e88f0b5797609b38ec763cc26a6e94191514ce31 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: pam_localuser
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
-.\"      Date: 06/09/2006
+.\" Generator: DocBook XSL Stylesheets v1.71.0 <http://docbook.sf.net/>
+.\"      Date: 12/13/2006
 .\"    Manual: Linux\-PAM Manual
 .\"    Source: Linux\-PAM Manual
 .\"
-.TH "PAM_LOCALUSER" "8" "06/09/2006" "Linux\-PAM Manual" "Linux\-PAM Manual"
+.TH "PAM_LOCALUSER" "8" "12/13/2006" "Linux\-PAM Manual" "Linux\-PAM Manual"
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -22,31 +22,41 @@ pam_localuser is a PAM module to help implementing site\-wide login policies, wh
 This could also be implemented using pam_listfile.so and a very short awk script invoked by cron, but it's common enough to have been separated out.
 .SH "OPTIONS"
 .PP
-.TP 3n
+.PP
 \fBdebug\fR
+.RS 3n
 Print debug information.
-.TP 3n
+.RE
+.PP
 \fBfile=\fR\fB\fI/path/passwd\fR\fR
+.RS 3n
 Use a file other than
 \fI/etc/passwd\fR.
+.RE
 .SH "MODULE SERVICES PROVIDED"
 .PP
-The
-\fBauth\fR
+All services (\fBaccount\fR,
+\fBauth\fR,
+\fBpassword\fR
 and
-\fBaccount\fR
-services are supported.
+\fBsession\fR) are supported.
 .SH "RETURN VALUES"
 .PP
-.TP 3n
+.PP
 PAM_SUCCESS
+.RS 3n
 The new localuser was set successfull.
-.TP 3n
+.RE
+.PP
 PAM_SERVICE_ERR
+.RS 3n
 No username was given.
-.TP 3n
+.RE
+.PP
 PAM_USER_UNKNOWN
+.RS 3n
 User not known.
+.RE
 .SH "EXAMPLES"
 .PP
 Add the following line to
@@ -62,9 +72,11 @@ account required pam_wheel.so
 .RE
 .sp
 .SH "FILES"
-.TP 3n
+.PP
 \fI/etc/passwd\fR
+.RS 3n
 Local user account information.
+.RE
 .SH "SEE ALSO"
 .PP
 
index 22ed4434d814bb8df4d657047c8212099034eb59..ac00ce997d9b3ac41a33987f97716ae14f2eb79a 100644 (file)
@@ -83,8 +83,8 @@
   <refsect1 id="pam_localuser-services">
     <title>MODULE SERVICES PROVIDED</title>
     <para>
-      The <emphasis remap='B'>auth</emphasis> and
-      <emphasis remap='B'>account</emphasis> services are supported.
+      All services (<option>account</option>, <option>auth</option>,
+      <option>password</option> and <option>session</option>) are supported.
     </para>
   </refsect1>
 
index f99f442101554e2579af1bf87b9ac7e5022ef03b..aa43bc4cc6ee9ff5c2da4f4465b7e7ab143cac05 100644 (file)
@@ -136,6 +136,27 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int flags, int argc, const char **argv)
        return pam_sm_authenticate(pamh, flags, argc, argv);
 }
 
+PAM_EXTERN int
+pam_sm_open_session (pam_handle_t *pamh, int flags,
+                    int argc, const char **argv)
+{
+       return pam_sm_authenticate(pamh, flags, argc, argv);
+}
+
+PAM_EXTERN int
+pam_sm_close_session (pam_handle_t *pamh, int flags,
+                     int argc, const char **argv)
+{
+       return pam_sm_authenticate(pamh, flags, argc, argv);
+}
+
+PAM_EXTERN int
+pam_sm_chauthtok (pam_handle_t *pamh, int flags,
+                 int argc, const char **argv)
+{
+       return pam_sm_authenticate(pamh, flags, argc, argv);
+}
+
 #ifdef PAM_STATIC
 
 /* static module data */
@@ -145,9 +166,9 @@ struct pam_module _pam_localuser_modstruct = {
      pam_sm_authenticate,
      pam_sm_setcred,
      pam_sm_acct_mgmt,
-     NULL,
-     NULL,
-     NULL,
+     pam_sm_open_session,
+     pam_sm_close_session,
+     pam_sm_chauthtok
 };
 
 #endif