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.
+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
_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];
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;
.\" 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)
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
.RE
.sp
.SH "FILES"
-.TP 3n
+.PP
\fI/etc/passwd\fR
+.RS 3n
Local user account information.
+.RE
.SH "SEE ALSO"
.PP
<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>
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 */
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