2 * $Id: pam_unix_auth.-c,v 1.4 1996/12/01 03:05:54 morgan Exp $
4 * $Log: pam_unix_auth.-c,v $
5 * Revision 1.4 1996/12/01 03:05:54 morgan
6 * debugging with _pam_macros.h
8 * Revision 1.3 1996/11/10 21:04:29 morgan
11 * Revision 1.2 1996/09/05 06:46:53 morgan
12 * fixed comments. Added check for null passwd.
13 * changed data item name
15 * Revision 1.1 1996/08/29 13:27:51 morgan
18 * See end of file for Copyright information.
21 static const char rcsid_auth[] =
22 "$Id: pam_unix_auth.-c,v 1.4 1996/12/01 03:05:54 morgan Exp $: pam_unix_auth.-c,v 1.2 1996/09/05 06:46:53 morgan Exp morgan $\n"
23 " - PAM_PWDB authentication functions. <morgan@parc.power.net>";
26 * _unix_auth() is a front-end for UNIX/shadow authentication
28 * First, obtain the password from the user. Then use a
29 * routine in 'support.-c' to authenticate the user.
32 #define _UNIX_AUTHTOK "-UN*X-PASS"
34 static int _unix_auth(pam_handle_t *pamh, unsigned int ctrl)
41 /* get the user'name' */
43 retval = _unix_get_user(pamh, ctrl, NULL, &name);
44 if (retval != PAM_SUCCESS ) {
45 if ( on(UNIX_DEBUG,ctrl) ) {
46 _log_err(LOG_DEBUG, "auth could not identify user");
51 /* if this user does not have a password... */
53 if ( _unix_blankpasswd(ctrl, name) ) {
54 D(("user '%s' has blank passwd", name));
59 /* get this user's authentication token */
61 retval = _unix_read_password(pamh, ctrl, NULL, "Password: ", NULL
63 if (retval != PAM_SUCCESS ) {
64 _log_err(LOG_CRIT, "auth could not identify password for [%s]"
70 /* verify the password of this user */
72 retval = _unix_verify_password(pamh, name, p, ctrl);
79 * This function is for setting unix credentials. Sun has indicated
80 * that there are *NO* authentication credentials for unix. The
81 * obvious credentials would be the group membership of the user as
82 * listed in the /etc/group file. However, Sun indicates that it is
83 * the responsibility of the application to set these.
86 static int _unix_set_credentials(pam_handle_t *pamh, unsigned int ctrl)
88 D(("called <empty function> returning."));
93 /********************************************************************
94 * Copyright (c) Alexander O. Yuriev, 1996.
95 * Copyright (c) Andrew G. Morgan <morgan@parc.power.net> 1996
96 * Copyright (c) Cristian Gafton <gafton@redhat.com> 1996, 1997
98 * Redistribution and use in source and binary forms, with or without
99 * modification, are permitted provided that the following conditions
101 * 1. Redistributions of source code must retain the above copyright
102 * notice, and the entire permission notice in its entirety,
103 * including the disclaimer of warranties.
104 * 2. Redistributions in binary form must reproduce the above copyright
105 * notice, this list of conditions and the following disclaimer in the
106 * documentation and/or other materials provided with the distribution.
107 * 3. The name of the author may not be used to endorse or promote
108 * products derived from this software without specific prior
109 * written permission.
111 * ALTERNATIVELY, this product may be distributed under the terms of
112 * the GNU Public License, in which case the provisions of the GPL are
113 * required INSTEAD OF the above restrictions. (This clause is
114 * necessary due to a potential bad interaction between the GPL and
115 * the restrictions contained in a BSD-style copyright.)
117 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
118 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
119 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
120 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
121 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
122 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
123 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
124 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
125 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
126 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
127 * OF THE POSSIBILITY OF SUCH DAMAGE.