From 3a61f6992583ba81b9be343f51b5767893b81234 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 25 Jul 1994 22:21:55 +0000 Subject: [PATCH] ultrix enhanced security suport --- check.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/check.c b/check.c index 0bff5ed30..ec8b8a319 100644 --- a/check.c +++ b/check.c @@ -63,6 +63,9 @@ static char rcsid[] = "$Id$"; #ifdef __svr4__ #include #endif /* __svr4__ */ +#if defined(ultrix) && defined(HAVE_C2_SECURITY) +#include +#endif /* ultrix && HAVE_C2_SECURITY */ #if defined(__convex__) && defined(HAVE_C2_SECURITY) #include #include @@ -240,6 +243,9 @@ static void check_passwd() #if defined (__hpux) && defined(HAVE_C2_SECURITY) struct s_passwd *spw_ent; #endif /* __hpux && HAVE_C2_SECURITY */ +#if defined (ultrix) && defined(HAVE_C2_SECURITY) + AUTHORIZATION *spw_ent; +#endif /* ultrix && HAVE_C2_SECURITY */ #if defined (__convex__) && defined(HAVE_C2_SECURITY) char salt[2]; /* Need the salt to perform the encryption */ register int i; @@ -260,6 +266,17 @@ static void check_passwd() if (spw_ent && spw_ent -> pw_passwd) encrypted = spw_ent -> pw_passwd; #endif /* __hpux && HAVE_C2_SECURITY */ +#if defined (ultrix) && defined(HAVE_C2_SECURITY) + /* + * grab encrypted password from /etc/auth + * or just use the regular one... + */ + be_root(); + spw_ent = getauthuid(uid); + be_user(); + if (spw_ent && spw_ent -> a_password) + encrypted = spw_ent -> a_password; +#endif /* ultrix && HAVE_C2_SECURITY */ #ifdef __svr4__ /* * SVR4 should always have a shadow password file @@ -309,6 +326,10 @@ static void check_passwd() if (strncmp(encrypted, crypt(pass, salt), i) == 0) return; /* if the passwd is correct return() */ #else +#if defined (ultrix) && defined(HAVE_C2_SECURITY) + if (spw_ent && !strcmp(encrypted, (char *) crypt16(pass, encrypted))) + return; /* if the passwd is correct return() */ +#endif /* ultrix && HAVE_C2_SECURITY */ if (!strcmp(encrypted, (char *) crypt(pass, encrypted))) return; /* if the passwd is correct return() */ #endif /* __convex__ && HAVE_C2_SECURITY */ -- 2.40.0