- (tim) [defines.h openbsd-compat/port-uw.c] Add long password support to

OpenServer 6 and add osr5bigcrypt support so when someone migrates
   passwords between UnixWare and OpenServer they will still work. OK dtucker@
This commit is contained in:
Tim Rice 2005-09-08 21:56:33 -07:00
parent c8ab8ceacb
commit 64ead485ac
2 changed files with 20 additions and 11 deletions

View File

@ -1,3 +1,8 @@
20050908
- (tim) [defines.h openbsd-compat/port-uw.c] Add long password support to
OpenServer 6 and add osr5bigcrypt support so when someone migrates
passwords between UnixWare and OpenServer they will still work. OK dtucker@
20050901 20050901
- (djm) Update RPM spec file versions - (djm) Update RPM spec file versions
@ -2989,4 +2994,4 @@
- (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Trim deprecated options from INSTALL. Mention UsePAM
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
$Id: ChangeLog,v 1.3887 2005/09/01 09:10:48 djm Exp $ $Id: ChangeLog,v 1.3888 2005/09/09 04:56:33 tim Exp $

View File

@ -25,7 +25,7 @@
#include "includes.h" #include "includes.h"
#if defined(HAVE_LIBIAF) && !defined(BROKEN_LIBIAF) #ifdef HAVE_LIBIAF
#ifdef HAVE_CRYPT_H #ifdef HAVE_CRYPT_H
#include <crypt.h> #include <crypt.h>
#endif #endif
@ -42,7 +42,6 @@ int
sys_auth_passwd(Authctxt *authctxt, const char *password) sys_auth_passwd(Authctxt *authctxt, const char *password)
{ {
struct passwd *pw = authctxt->pw; struct passwd *pw = authctxt->pw;
char *encrypted_password;
char *salt; char *salt;
int result; int result;
@ -55,21 +54,24 @@ sys_auth_passwd(Authctxt *authctxt, const char *password)
/* Encrypt the candidate password using the proper salt. */ /* Encrypt the candidate password using the proper salt. */
salt = (pw_password[0] && pw_password[1]) ? pw_password : "xx"; salt = (pw_password[0] && pw_password[1]) ? pw_password : "xx";
#ifdef UNIXWARE_LONG_PASSWORDS
if (!nischeck(pw->pw_name))
encrypted_password = bigcrypt(password, salt);
else
#endif /* UNIXWARE_LONG_PASSWORDS */
encrypted_password = xcrypt(password, salt);
/* /*
* Authentication is accepted if the encrypted passwords * Authentication is accepted if the encrypted passwords
* are identical. * are identical.
*/ */
result = (strcmp(encrypted_password, pw_password) == 0); #ifdef UNIXWARE_LONG_PASSWORDS
if (!nischeck(pw->pw_name)) {
result = ((strcmp(bigcrypt(password, salt), pw_password) == 0)
|| (strcmp(osr5bigcrypt(password, salt), pw_password) == 0));
}
else
#endif /* UNIXWARE_LONG_PASSWORDS */
result = (strcmp(xcrypt(password, salt), pw_password) == 0);
#if !defined(BROKEN_LIBIAF)
if (authctxt->valid) if (authctxt->valid)
free(pw_password); free(pw_password);
#endif
return(result); return(result);
} }
@ -114,6 +116,7 @@ nischeck(char *namep)
functions that call shadow_pw() will need to free functions that call shadow_pw() will need to free
*/ */
#if !defined(BROKEN_LIBIAF)
char * char *
get_iaf_password(struct passwd *pw) get_iaf_password(struct passwd *pw)
{ {
@ -130,5 +133,6 @@ get_iaf_password(struct passwd *pw)
else else
fatal("ia_openinfo: Unable to open the shadow passwd file"); fatal("ia_openinfo: Unable to open the shadow passwd file");
} }
#endif /* HAVE_LIBIAF && !BROKEN_LIBIAF */ #endif /* !BROKEN_LIBIAF */
#endif /* HAVE_LIBIAF */