home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright 1989, 1990, John F. Haugh II
- * All rights reserved.
- *
- * Use, duplication, and disclosure prohibited without
- * the express written permission of the author.
- */
-
- #include <stdio.h>
- #include "config.h"
- #include "dialup.h"
-
- #ifndef lint
- static char _sccsid[] = "@(#)dialchk.c 2.2 19:23:36 7/29/90";
- #endif
-
- /*
- * 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
-