summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--openbsd-compat/port-uw.c24
2 files changed, 20 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 9573f8672..fc22408cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
120050908
2 - (tim) [defines.h openbsd-compat/port-uw.c] Add long password support to
3 OpenServer 6 and add osr5bigcrypt support so when someone migrates
4 passwords between UnixWare and OpenServer they will still work. OK dtucker@
5
120050901 620050901
2 - (djm) Update RPM spec file versions 7 - (djm) Update RPM spec file versions
3 8
@@ -2989,4 +2994,4 @@
2989 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 2994 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
2990 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 2995 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
2991 2996
2992$Id: ChangeLog,v 1.3887 2005/09/01 09:10:48 djm Exp $ 2997$Id: ChangeLog,v 1.3888 2005/09/09 04:56:33 tim Exp $
diff --git a/openbsd-compat/port-uw.c b/openbsd-compat/port-uw.c
index d881ff028..c64427121 100644
--- a/openbsd-compat/port-uw.c
+++ b/openbsd-compat/port-uw.c
@@ -25,7 +25,7 @@
25 25
26#include "includes.h" 26#include "includes.h"
27 27
28#if defined(HAVE_LIBIAF) && !defined(BROKEN_LIBIAF) 28#ifdef HAVE_LIBIAF
29#ifdef HAVE_CRYPT_H 29#ifdef HAVE_CRYPT_H
30#include <crypt.h> 30#include <crypt.h>
31#endif 31#endif
@@ -42,7 +42,6 @@ int
42sys_auth_passwd(Authctxt *authctxt, const char *password) 42sys_auth_passwd(Authctxt *authctxt, const char *password)
43{ 43{
44 struct passwd *pw = authctxt->pw; 44 struct passwd *pw = authctxt->pw;
45 char *encrypted_password;
46 char *salt; 45 char *salt;
47 int result; 46 int result;
48 47
@@ -55,21 +54,24 @@ sys_auth_passwd(Authctxt *authctxt, const char *password)
55 54
56 /* Encrypt the candidate password using the proper salt. */ 55 /* Encrypt the candidate password using the proper salt. */
57 salt = (pw_password[0] && pw_password[1]) ? pw_password : "xx"; 56 salt = (pw_password[0] && pw_password[1]) ? pw_password : "xx";
58#ifdef UNIXWARE_LONG_PASSWORDS
59 if (!nischeck(pw->pw_name))
60 encrypted_password = bigcrypt(password, salt);
61 else
62#endif /* UNIXWARE_LONG_PASSWORDS */
63 encrypted_password = xcrypt(password, salt);
64 57
65 /* 58 /*
66 * Authentication is accepted if the encrypted passwords 59 * Authentication is accepted if the encrypted passwords
67 * are identical. 60 * are identical.
68 */ 61 */
69 result = (strcmp(encrypted_password, pw_password) == 0); 62#ifdef UNIXWARE_LONG_PASSWORDS
63 if (!nischeck(pw->pw_name)) {
64 result = ((strcmp(bigcrypt(password, salt), pw_password) == 0)
65 || (strcmp(osr5bigcrypt(password, salt), pw_password) == 0));
66 }
67 else
68#endif /* UNIXWARE_LONG_PASSWORDS */
69 result = (strcmp(xcrypt(password, salt), pw_password) == 0);
70 70
71#if !defined(BROKEN_LIBIAF)
71 if (authctxt->valid) 72 if (authctxt->valid)
72 free(pw_password); 73 free(pw_password);
74#endif
73 return(result); 75 return(result);
74} 76}
75 77
@@ -114,6 +116,7 @@ nischeck(char *namep)
114 functions that call shadow_pw() will need to free 116 functions that call shadow_pw() will need to free
115 */ 117 */
116 118
119#if !defined(BROKEN_LIBIAF)
117char * 120char *
118get_iaf_password(struct passwd *pw) 121get_iaf_password(struct passwd *pw)
119{ 122{
@@ -130,5 +133,6 @@ get_iaf_password(struct passwd *pw)
130 else 133 else
131 fatal("ia_openinfo: Unable to open the shadow passwd file"); 134 fatal("ia_openinfo: Unable to open the shadow passwd file");
132} 135}
133#endif /* HAVE_LIBIAF && !BROKEN_LIBIAF */ 136#endif /* !BROKEN_LIBIAF */
137#endif /* HAVE_LIBIAF */
134 138