1 |
/* Verify user passwords |
/* Verify user passwords |
2 |
|
|
3 |
Copyright (C) 1996,97,98,99,2002,2003 Free Software Foundation, Inc. |
Copyright (C) 1996,97,98,99,2002 Free Software Foundation, Inc. |
4 |
Written by Miles Bader <miles@gnu.org> |
Written by Miles Bader <miles@gnu.org> |
5 |
|
|
6 |
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
30 |
|
|
31 |
#define SHADOW_PASSWORD_STRING "x" /* pw_passwd contents for shadow passwd */ |
#define SHADOW_PASSWORD_STRING "x" /* pw_passwd contents for shadow passwd */ |
32 |
|
|
33 |
|
#pragma weak crypt |
34 |
|
|
35 |
static error_t verify_id (); /* FWD */ |
static error_t verify_id (); /* FWD */ |
36 |
|
|
37 |
/* Get a password from the user, returning it in malloced storage. */ |
/* Get a password from the user, returning it in malloced storage. */ |
70 |
if (sys_encrypted[0] == '\0') |
if (sys_encrypted[0] == '\0') |
71 |
return 0; /* No password. */ |
return 0; /* No password. */ |
72 |
|
|
73 |
/* Encrypt the password entered by the user (SYS_ENCRYPTED is the salt). */ |
if (crypt) |
74 |
encrypted = crypt (password, sys_encrypted); |
/* Encrypt the password entered by the user (SYS_ENCRYPTED is the salt). */ |
75 |
|
encrypted = crypt (password, sys_encrypted); |
76 |
|
else |
77 |
|
/* No crypt on this system! Use plain-text passwords. */ |
78 |
|
encrypted = password; |
79 |
|
|
80 |
if (! encrypted) |
if (! encrypted) |
81 |
/* Crypt failed. */ |
/* Crypt failed. */ |
82 |
return errno; |
return errno; |