[dovecot-cvs] dovecot/src/auth userinfo-passwd-file.c,1.11,1.12 userinfo-passwd.c,1.5,1.6 userinfo-passwd.h,1.3,1.4 userinfo-shadow.c,1.5,1.6 userinfo-vpopmail.c,1.5,1.6

cras at procontrol.fi cras at procontrol.fi
Tue Nov 26 19:56:16 EET 2002


Update of /home/cvs/dovecot/src/auth
In directory danu:/tmp/cvs-serv14235/auth

Modified Files:
	userinfo-passwd-file.c userinfo-passwd.c userinfo-passwd.h 
	userinfo-shadow.c userinfo-vpopmail.c 
Log Message:
Still more crypt() problems. Wrapped it into mycrypt() which should finally
put end to this kludgeing.



Index: userinfo-passwd-file.c
===================================================================
RCS file: /home/cvs/dovecot/src/auth/userinfo-passwd-file.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- userinfo-passwd-file.c	17 Nov 2002 14:52:43 -0000	1.11
+++ userinfo-passwd-file.c	26 Nov 2002 17:56:14 -0000	1.12
@@ -11,6 +11,7 @@
 #include "hash.h"
 #include "hex-binary.h"
 #include "md5.h"
+#include "mycrypt.h"
 
 #include <stdlib.h>
 #include <fcntl.h>
@@ -116,7 +117,7 @@
 	/* verify that password matches */
 	switch (pu->password_type) {
 	case PASSWORD_DES:
-		if (strcmp(crypt(password, pu->password), pu->password) != 0)
+		if (strcmp(mycrypt(password, pu->password), pu->password) != 0)
 			return FALSE;
 		break;
 	case PASSWORD_MD5:

Index: userinfo-passwd.c
===================================================================
RCS file: /home/cvs/dovecot/src/auth/userinfo-passwd.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- userinfo-passwd.c	4 Nov 2002 05:04:04 -0000	1.5
+++ userinfo-passwd.c	26 Nov 2002 17:56:14 -0000	1.6
@@ -11,6 +11,7 @@
 #ifdef USERINFO_PASSWD
 
 #include "userinfo-passwd.h"
+#include "mycrypt.h"
 
 void passwd_fill_cookie_reply(struct passwd *pw, AuthCookieReplyData *reply)
 {
@@ -37,7 +38,7 @@
 
 	/* check if the password is valid */
         passdup = t_strdup_noconst(password);
-	result = strcmp(crypt(passdup, pw->pw_passwd), pw->pw_passwd) == 0;
+	result = strcmp(mycrypt(passdup, pw->pw_passwd), pw->pw_passwd) == 0;
 
 	/* clear the passwords from memory */
 	memset(passdup, 0, strlen(passdup));

Index: userinfo-passwd.h
===================================================================
RCS file: /home/cvs/dovecot/src/auth/userinfo-passwd.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- userinfo-passwd.h	26 Nov 2002 17:45:45 -0000	1.3
+++ userinfo-passwd.h	26 Nov 2002 17:56:14 -0000	1.4
@@ -1,22 +1,6 @@
 #ifndef __USERINFO_PASSWD_H
 #define __USERINFO_PASSWD_H
 
-/* can't remember what these were for. needed in some systems I think :) */
-#ifndef _XOPEN_SOURCE_EXTENDED
-#  define _XOPEN_SOURCE_EXTENDED
-#endif
-#define _XPG4_2
-
-/* Do this first so we're not (hopefully) affected by the temporary
-   _XOPEN_SOURCE define. Required to compile with new NetBSDs (around 1.6K) */
-#include <sys/types.h>
-
-/* _XOPEN_SOURCE is required for crypt(). However with Solaris 8 it breaks
-   a few other header files so keep it defined only for unistd.h */
-#define _XOPEN_SOURCE 4 /* needed for crypt() */
-#include <unistd.h>
-#undef _XOPEN_SOURCE
-
 #include "common.h"
 #include "userinfo.h"
 

Index: userinfo-shadow.c
===================================================================
RCS file: /home/cvs/dovecot/src/auth/userinfo-shadow.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- userinfo-shadow.c	4 Nov 2002 05:04:04 -0000	1.5
+++ userinfo-shadow.c	26 Nov 2002 17:56:14 -0000	1.6
@@ -11,6 +11,7 @@
 #ifdef USERINFO_SHADOW
 
 #include "userinfo-passwd.h"
+#include "mycrypt.h"
 
 #include <shadow.h>
 
@@ -28,7 +29,7 @@
 
 	/* check if the password is valid */
         passdup = t_strdup_noconst(password);
-	result = strcmp(crypt(passdup, spw->sp_pwdp), spw->sp_pwdp) == 0;
+	result = strcmp(mycrypt(passdup, spw->sp_pwdp), spw->sp_pwdp) == 0;
 
 	/* clear the passwords from memory */
 	memset(passdup, 0, strlen(passdup));

Index: userinfo-vpopmail.c
===================================================================
RCS file: /home/cvs/dovecot/src/auth/userinfo-vpopmail.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- userinfo-vpopmail.c	25 Nov 2002 13:40:05 -0000	1.5
+++ userinfo-vpopmail.c	26 Nov 2002 17:56:14 -0000	1.6
@@ -8,6 +8,7 @@
 #ifdef USERINFO_VPOPMAIL
 
 #include "userinfo-passwd.h"
+#include "mycrypt.h"
 
 #include <stdio.h>
 #include <vpopmail.h>




More information about the dovecot-cvs mailing list