added osf auth support & removed some extra spaces
This commit is contained in:
35
check.c
35
check.c
@@ -64,6 +64,10 @@ static char rcsid[] = "$Id$";
|
|||||||
#ifdef __svr4__
|
#ifdef __svr4__
|
||||||
#include <shadow.h>
|
#include <shadow.h>
|
||||||
#endif /* __svr4__ */
|
#endif /* __svr4__ */
|
||||||
|
#if defined(__osf__) && defined(HAVE_C2_SECURITY)
|
||||||
|
#include <sys/security.h>
|
||||||
|
#include <prot.h>
|
||||||
|
#endif /* __osf__ && HAVE_C2_SECURITY */
|
||||||
#if defined(ultrix) && defined(HAVE_C2_SECURITY)
|
#if defined(ultrix) && defined(HAVE_C2_SECURITY)
|
||||||
#include <auth.h>
|
#include <auth.h>
|
||||||
#endif /* ultrix && HAVE_C2_SECURITY */
|
#endif /* ultrix && HAVE_C2_SECURITY */
|
||||||
@@ -265,13 +269,16 @@ static void check_passwd()
|
|||||||
#ifdef __svr4__
|
#ifdef __svr4__
|
||||||
struct spwd *spw_ent;
|
struct spwd *spw_ent;
|
||||||
#endif /* __svr4__ */
|
#endif /* __svr4__ */
|
||||||
#if defined (__hpux) && defined(HAVE_C2_SECURITY)
|
#if defined(__hpux) && defined(HAVE_C2_SECURITY)
|
||||||
struct s_passwd *spw_ent;
|
struct s_passwd *spw_ent;
|
||||||
#endif /* __hpux && HAVE_C2_SECURITY */
|
#endif /* __hpux && HAVE_C2_SECURITY */
|
||||||
#if defined (ultrix) && defined(HAVE_C2_SECURITY)
|
#if defined(__osf__) && defined(HAVE_C2_SECURITY)
|
||||||
|
struct pr_passwd *spw_ent;
|
||||||
|
#endif /* __osf__ && HAVE_C2_SECURITY */
|
||||||
|
#if defined(ultrix) && defined(HAVE_C2_SECURITY)
|
||||||
AUTHORIZATION *spw_ent;
|
AUTHORIZATION *spw_ent;
|
||||||
#endif /* ultrix && HAVE_C2_SECURITY */
|
#endif /* ultrix && HAVE_C2_SECURITY */
|
||||||
#if defined (__convex__) && defined(HAVE_C2_SECURITY)
|
#if defined(__convex__) && defined(HAVE_C2_SECURITY)
|
||||||
char salt[2]; /* Need the salt to perform the encryption */
|
char salt[2]; /* Need the salt to perform the encryption */
|
||||||
register int i;
|
register int i;
|
||||||
struct pr_passwd *spw_ent;
|
struct pr_passwd *spw_ent;
|
||||||
@@ -280,7 +287,7 @@ static void check_passwd()
|
|||||||
char *pass; /* this is what gets entered */
|
char *pass; /* this is what gets entered */
|
||||||
register int counter = TRIES_FOR_PASSWORD;
|
register int counter = TRIES_FOR_PASSWORD;
|
||||||
|
|
||||||
#if defined (__hpux) && defined(HAVE_C2_SECURITY)
|
#if defined(__hpux) && defined(HAVE_C2_SECURITY)
|
||||||
/*
|
/*
|
||||||
* grab encrypted password from shadow pw file
|
* grab encrypted password from shadow pw file
|
||||||
* or just use the regular one...
|
* or just use the regular one...
|
||||||
@@ -291,7 +298,19 @@ static void check_passwd()
|
|||||||
if (spw_ent && spw_ent -> pw_passwd)
|
if (spw_ent && spw_ent -> pw_passwd)
|
||||||
encrypted = spw_ent -> pw_passwd;
|
encrypted = spw_ent -> pw_passwd;
|
||||||
#endif /* __hpux && HAVE_C2_SECURITY */
|
#endif /* __hpux && HAVE_C2_SECURITY */
|
||||||
#if defined (ultrix) && defined(HAVE_C2_SECURITY)
|
#if defined(__osf__) && defined(HAVE_C2_SECURITY)
|
||||||
|
/*
|
||||||
|
* grab encrypted password from protected passwd file
|
||||||
|
* or just use the regular one...
|
||||||
|
*/
|
||||||
|
be_root();
|
||||||
|
(void) set_auth_parameters();
|
||||||
|
spw_ent = getprpwuid(uid);
|
||||||
|
be_user();
|
||||||
|
if (spw_ent && spw_ent -> ufld)
|
||||||
|
encrypted = spw_ent -> ufld.fd_encrypt;
|
||||||
|
#endif /* __osf__ && HAVE_C2_SECURITY */
|
||||||
|
#if defined(ultrix) && defined(HAVE_C2_SECURITY)
|
||||||
/*
|
/*
|
||||||
* grab encrypted password from /etc/auth
|
* grab encrypted password from /etc/auth
|
||||||
* or just use the regular one...
|
* or just use the regular one...
|
||||||
@@ -318,7 +337,7 @@ static void check_passwd()
|
|||||||
}
|
}
|
||||||
encrypted = spw_ent -> sp_pwdp;
|
encrypted = spw_ent -> sp_pwdp;
|
||||||
#endif /* __svr4__ */
|
#endif /* __svr4__ */
|
||||||
#if defined (__convex__) && defined(HAVE_C2_SECURITY)
|
#if defined(__convex__) && defined(HAVE_C2_SECURITY)
|
||||||
/*
|
/*
|
||||||
* Convex with C2 security
|
* Convex with C2 security
|
||||||
*/
|
*/
|
||||||
@@ -345,13 +364,13 @@ static void check_passwd()
|
|||||||
#endif /* USE_GETPASS */
|
#endif /* USE_GETPASS */
|
||||||
if (!pass || *pass == '\0')
|
if (!pass || *pass == '\0')
|
||||||
exit(0);
|
exit(0);
|
||||||
#if defined (__convex__) && defined(HAVE_C2_SECURITY)
|
#if defined(__convex__) && defined(HAVE_C2_SECURITY)
|
||||||
strncpy(salt, spw_ent->ufld.fd_encrypt, 2);
|
strncpy(salt, spw_ent->ufld.fd_encrypt, 2);
|
||||||
i = AUTH_SALT_SIZE + AUTH_CIPHERTEXT_SEG_CHARS;
|
i = AUTH_SALT_SIZE + AUTH_CIPHERTEXT_SEG_CHARS;
|
||||||
if (strncmp(encrypted, crypt(pass, salt), i) == 0)
|
if (strncmp(encrypted, crypt(pass, salt), i) == 0)
|
||||||
return; /* if the passwd is correct return() */
|
return; /* if the passwd is correct return() */
|
||||||
#else
|
#else
|
||||||
#if defined (ultrix) && defined(HAVE_C2_SECURITY)
|
#if defined(ultrix) && defined(HAVE_C2_SECURITY)
|
||||||
if (spw_ent && !strcmp(encrypted, (char *) crypt16(pass, encrypted)))
|
if (spw_ent && !strcmp(encrypted, (char *) crypt16(pass, encrypted)))
|
||||||
return; /* if the passwd is correct return() */
|
return; /* if the passwd is correct return() */
|
||||||
#endif /* ultrix && HAVE_C2_SECURITY */
|
#endif /* ultrix && HAVE_C2_SECURITY */
|
||||||
|
Reference in New Issue
Block a user