1 /* pwcheck_getspnam.c -- check passwords using getspnam()
2 $Id: pwcheck_getspnam.c,v 1.1 1999/08/26 16:22:44 leg Exp $
4 Copyright 1998, 1999 Carnegie Mellon University
8 Permission to use, copy, modify, and distribute this software and its
9 documentation for any purpose and without fee is hereby granted,
10 provided that the above copyright notice appear in all copies and that
11 both that copyright notice and this permission notice appear in
12 supporting documentation, and that the name of Carnegie Mellon
13 University not be used in advertising or publicity pertaining to
14 distribution of the software without specific, written prior
17 CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
18 THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
19 FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE FOR
20 ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
21 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
22 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
23 OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24 ******************************************************************/
30 char *pwcheck(userid, password)
36 pwd = getspnam(userid);
38 return "Userid not found";
41 if (strcmp(pwd->sp_pwdp, crypt(password, pwd->sp_pwdp)) != 0) {
42 return "Incorrect password";