From 8680c1962decd16c3ac00b1082ac3217aa2ba271 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 24 Jun 1994 23:45:28 +0000 Subject: [PATCH] added hpux C2 shit --- check.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/check.c b/check.c index a42a8bcda..246765f45 100644 --- a/check.c +++ b/check.c @@ -225,12 +225,18 @@ static void check_passwd() #ifdef __svr4__ struct spwd *spw_ent; #endif /* __svr4__ */ +#if defined (hpux) && defined(HAVE_C2_SECURITY) + struct s_passwd *spw_ent; +#endif /* hpux && HAVE_C2_SECURITY */ char *encrypted; /* this comes from /etc/passwd */ char *pass; /* this is what gets entered */ register int counter = TRIES_FOR_PASSWORD; /* some os's need to be root to get at shadow password */ be_root(); +#if defined (hpux) && defined(HAVE_C2_SECURITY) + spw_ent = getspwuid(uid); +#endif /* hpux && HAVE_C2_SECURITY */ pw_ent = getpwuid(uid); be_user(); if (pw_ent == NULL) { @@ -251,14 +257,23 @@ static void check_passwd() } encrypted = spw_ent -> sp_pwdp; #else - encrypted = pw_ent -> pw_passwd; +#if defined (hpux) && defined(HAVE_C2_SECURITY) + if (spw_ent && spw_ent -> pw_passwd) + encrypted = spw_ent -> pw_passwd; + else +#endif /* hpux && HAVE_C2_SECURITY */ + encrypted = pw_ent -> pw_passwd; #endif /* __svr4__ */ /* * you get TRIES_FOR_PASSWORD times to guess your password */ while (counter > 0) { +#ifdef USE_GETPASS + pass = (char *) getpass("Password:"); +#else pass = tgetpass("Password:", PASSWORD_TIMEOUT); +#endif /* USE_GETPASS */ if (!pass || *pass == '\0') exit(0); if (!strcmp(encrypted, (char *) crypt(pass, encrypted))) -- 2.40.0