home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume6
/
shadow-2.pt3
/
dialchk.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-02-03
|
744b
|
42 lines
#include <stdio.h>
#include "config.h"
#include "dialup.h"
/*
* Check for dialup password
*
* dialcheck tests to see if tty is listed as being a dialup
* line. If so, a dialup password may be required if the shell
* is listed as one which requires a second password.
*/
#ifdef DIALUP
int dialcheck (tty, shell)
char *tty;
char *shell;
{
char *crypt ();
char *getpass ();
struct dialup *dialup;
char *pass;
char *cp;
if (! isadialup (tty))
return (1);
if (! (dialup = getdushell (shell)))
return (1);
endduent ();
if (dialup->du_passwd[0] == '\0')
return (1);
if (! (pass = getpass ("Dialup Password:")))
return (0);
cp = crypt (pass, dialup->du_passwd);
return (strcmp (cp, dialup->du_passwd) == 0);
}
#endif