Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jul 2003 09:00:25 -0700 (PDT)
From:      Bruce M Simpson <bms@spc.org>
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/54783: [PATCH] ftp/proftpd: fix for mysql41, MODULES_OVERRIDE
Message-ID:  <200307231600.h6NG0P9j026322@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/54783; it has been noted by GNATS.

From: Bruce M Simpson <bms@spc.org>
To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org
Cc:  
Subject: Re: ports/54783: [PATCH] ftp/proftpd: fix for mysql41, MODULES_OVERRIDE
Date: Wed, 23 Jul 2003 16:49:57 +0100

 --R+My9LyyhiUvIEro
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 That patch was incomplete; my apologies.
 
 Here is the correct patch.
 
 BMS
 
 --R+My9LyyhiUvIEro
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="proftpd.patch"
 
 diff -uNr proftpd.orig/Makefile proftpd/Makefile
 --- proftpd.orig/Makefile	Mon Mar 24 13:33:28 2003
 +++ proftpd/Makefile	Wed Jul 23 16:22:53 2003
 @@ -39,21 +39,36 @@
  .endif
  
  #allow user to override
 -MODULES?=	mod_ratio:mod_readme:mod_wrap
 +MODULES_OVERRIDE?=	mod_ratio:mod_readme:mod_wrap
 +MODULES=	${MODULES_OVERRIDE}
  
  INCLUDEDIRS=
  LIBDIRS=
  
  .if defined(WITH_LDAP)
 -MODULES:=${MODULES}:mod_ldap
 +.if ${WITH_LDAP} == 21
 +BUILD_DEPENDS+=	${LOCALBASE}/lib/libldap.a:${PORTSDIR}/net/openldap21
 +.elif ${WITH_LDAP} == 20
 +BUILD_DEPENDS+=	${LOCALBASE}/lib/libldap.a:${PORTSDIR}/net/openldap20
 +.else
  BUILD_DEPENDS+=	${LOCALBASE}/lib/libldap.a:${PORTSDIR}/net/openldap12
 +.endif
 +MODULES:=${MODULES}:mod_ldap
  INCLUDEDIRS:=${INCLUDEDIRS}:${PREFIX}/include
  LIBDIRS:=${LIBDIRS}:${PREFIX}/lib
  .endif
  
  .if defined(WITH_MYSQL)
 -MODULES:=${MODULES}:mod_sql:mod_sql_mysql
 +.if ${WITH_MYSQL} == 41
 +LIB_DEPENDS+=	mysqlclient.14:${PORTSDIR}/databases/mysql41-client
 +CFLAGS+=-D__MYSQL_VERSION=4
 +.elif ${WITH_MYSQL} == 40
 +LIB_DEPENDS+=	mysqlclient.12:${PORTSDIR}/databases/mysql40-client
 +CFLAGS+=-D__MYSQL_VERSION=4
 +.else
  LIB_DEPENDS+=	mysqlclient.10:${PORTSDIR}/databases/mysql323-client
 +.endif
 +MODULES:=${MODULES}:mod_sql:mod_sql_mysql
  INCLUDEDIRS:=${INCLUDEDIRS}:${PREFIX}/include
  LIBDIRS:=${LIBDIRS}:${PREFIX}/lib/mysql
  .endif
 diff -uNr proftpd.orig/files/patch-contrib::mod_sql_mysql.c proftpd/files/patch-contrib::mod_sql_mysql.c
 --- proftpd.orig/files/patch-contrib::mod_sql_mysql.c	Thu Jan  1 01:00:00 1970
 +++ proftpd/files/patch-contrib::mod_sql_mysql.c	Wed Jul 23 16:19:32 2003
 @@ -0,0 +1,41 @@
 +--- contrib/mod_sql_mysql.c.orig	Thu Jan 16 02:04:46 2003
 ++++ contrib/mod_sql_mysql.c	Wed Jul 23 15:24:29 2003
 +@@ -133,6 +133,7 @@
 + 
 + #define _MYSQL_PORT "3306"
 + 
 ++#include <sys/time.h>
 + #include <mysql/mysql.h>
 + #include "conf.h"
 + #include "../contrib/mod_sql.h"
 +@@ -1259,6 +1260,10 @@
 +   char *c_clear = NULL;
 +   char *c_hash = NULL;
 +   int success = 0;
 ++#if defined(__MYSQL_VERSION) && __MYSQL_VERSION >= 4
 ++  time_t start_time;
 ++  struct rand_struct rand_st;
 ++#endif
 + 
 +   sql_log(DEBUG_FUNC, "%s", "entering \tmysql cmd_checkauth");
 + 
 +@@ -1286,11 +1291,18 @@
 +   c_clear = cmd->argv[1];
 +   c_hash = cmd->argv[2];
 + 
 ++#if defined(__MYSQL_VERSION) && __MYSQL_VERSION >= 4
 ++  start_time = time((time_t *)0);
 ++  randominit(&rand_st, (unsigned long) start_time, (unsigned long) start_time/2);
 ++  make_scrambled_password( scrambled, c_clear, 0, &rand_st );
 ++#else
 +   make_scrambled_password( scrambled, c_clear );
 ++#endif
 + 
 +   success = !strcmp(scrambled, c_hash); 
 + 
 +-  sql_log(DEBUG_FUNC, "%s", "exiting \tmysql cmd_checkauth");
 ++  sql_log(DEBUG_FUNC, "%s", "exiting \tmysql cmd_checkauth (success = %d)",
 ++	success);
 + 
 +   return success ? HANDLED(cmd) : ERROR_INT(cmd, PR_AUTH_BADPWD);
 + }
 
 --R+My9LyyhiUvIEro--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200307231600.h6NG0P9j026322>