diff options
author | Philip M. Gollucci <pgollucci@FreeBSD.org> | 2015-07-15 17:51:25 +0000 |
---|---|---|
committer | Philip M. Gollucci <pgollucci@FreeBSD.org> | 2015-07-15 17:51:25 +0000 |
commit | 716b5be35bb8fbf113133da47af9d980969e57e1 (patch) | |
tree | a3e93e430b056d384c56a3d2b17fb0b712999b25 | |
parent | 768e5d4a767fcc9a13c42de7cfe89348facf6bfb (diff) |
Notes
-rw-r--r-- | www/mod_auth_mysql_another/Makefile | 13 | ||||
-rw-r--r-- | www/mod_auth_mysql_another/files/Makefile | 10 | ||||
-rw-r--r-- | www/mod_auth_mysql_another/files/patch-mod__auth__mysql.c | 156 | ||||
-rw-r--r-- | www/mod_auth_mysql_another/files/patch-strcat | 22 |
4 files changed, 160 insertions, 41 deletions
diff --git a/www/mod_auth_mysql_another/Makefile b/www/mod_auth_mysql_another/Makefile index 5122c39d4c23..0976db247d57 100644 --- a/www/mod_auth_mysql_another/Makefile +++ b/www/mod_auth_mysql_another/Makefile @@ -3,7 +3,7 @@ PORTNAME= mod_auth_mysql PORTVERSION= 3.0.0 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= www MASTER_SITES= SF/modauthmysql/modauthmysql/${PORTVERSION} PKGNAMESUFFIX= _another @@ -11,10 +11,10 @@ PKGNAMESUFFIX= _another MAINTAINER= apache@FreeBSD.org COMMENT= Allows users to use MySQL databases for user authentication -#LICENSE= AL10 +LICENSE= APACHE10 USE_MYSQL= yes -USE_APACHE= 22 +USE_APACHE= 22+ SHORTMODNAME= mysql_auth AP_FAST_BUILD= yes @@ -22,16 +22,11 @@ AP_GENPLIST= yes AP_INC= ${LOCALBASE}/include/mysql AP_LIB= ${LOCALBASE}/lib/mysql AP_EXTRAS= -lmysqlclient -lz -lm -AP_EXTRAS+= -DAPACHE2 PORTDOCS= CONFIGURE CHANGES -post-patch: - ${REINPLACE_CMD} -e "s|APR_XtOffsetOf|APR_OFFSETOF|g" \ - -e "s|APR_XtOffset|APR_OFFSET|g" ${WRKSRC}/mod_auth_mysql.c - post-install: @${MKDIR} ${STAGEDIR}${DOCSDIR} - @${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR} .include <bsd.port.mk> diff --git a/www/mod_auth_mysql_another/files/Makefile b/www/mod_auth_mysql_another/files/Makefile deleted file mode 100644 index 1e6b9086cd4e..000000000000 --- a/www/mod_auth_mysql_another/files/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# -# $FreeBSD$ -# -all: build - -build: - %%APXS%% -c -L%%AP_LIB%% -I%%AP_INC%% -lmysqlclient -lm -lz mod_auth_mysql.c - -install: - %%APXS%% -i mod_auth_mysql.so diff --git a/www/mod_auth_mysql_another/files/patch-mod__auth__mysql.c b/www/mod_auth_mysql_another/files/patch-mod__auth__mysql.c new file mode 100644 index 000000000000..7ee50e37870f --- /dev/null +++ b/www/mod_auth_mysql_another/files/patch-mod__auth__mysql.c @@ -0,0 +1,156 @@ +--- mod_auth_mysql.c.orig 2005-06-22 16:17:45 UTC ++++ mod_auth_mysql.c +@@ -206,7 +206,7 @@ + #define SNPRINTF apr_snprintf + #define PSTRDUP apr_pstrdup + #define PSTRNDUP apr_pstrndup +- #define STRCAT ap_pstrcat ++ #define STRCAT apr_pstrcat + #define POOL apr_pool_t + #include "http_request.h" /* for ap_hook_(check_user_id | auth_checker)*/ + #include "ap_compat.h" +@@ -237,7 +237,7 @@ + #define SNPRINTF ap_snprintf + #define PSTRDUP ap_pstrdup + #define PSTRNDUP ap_pstrndup +- #define STRCAT ap_pstrcat ++ #define STRCAT apr_pstrcat + #define POOL pool + #include <stdlib.h> + #include "ap_sha1.h" +@@ -589,87 +589,87 @@ static void * create_mysql_auth_dir_conf + static + command_rec mysql_auth_cmds[] = { + AP_INIT_TAKE1("AuthMySQLHost", ap_set_string_slot, +- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlhost), ++ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlhost), + OR_AUTHCFG, "mysql server host name"), + + AP_INIT_TAKE1("AuthMySQLPort", ap_set_int_slot, +- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlport), ++ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlport), + OR_AUTHCFG, "mysql server port number"), + + AP_INIT_TAKE1("AuthMySQLSocket", ap_set_string_slot, +- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlsocket), ++ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlsocket), + OR_AUTHCFG, "mysql server socket path"), + + AP_INIT_TAKE1("AuthMySQLUser", ap_set_string_slot, +- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqluser), ++ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqluser), + OR_AUTHCFG, "mysql server user name"), + + AP_INIT_TAKE1("AuthMySQLPassword", ap_set_string_slot, +- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlpasswd), ++ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlpasswd), + OR_AUTHCFG, "mysql server user password"), + + AP_INIT_TAKE1("AuthMySQLDB", ap_set_string_slot, +- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlDB), ++ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlDB), + OR_AUTHCFG, "mysql database name"), + + AP_INIT_TAKE1("AuthMySQLUserTable", ap_set_string_slot, +- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlpwtable), ++ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlpwtable), + OR_AUTHCFG, "mysql user table name"), + + AP_INIT_TAKE1("AuthMySQLGroupTable", ap_set_string_slot, +- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlgrptable), ++ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlgrptable), + OR_AUTHCFG, "mysql group table name"), + + AP_INIT_TAKE1("AuthMySQLNameField", ap_set_string_slot, +- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlNameField), ++ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlNameField), + OR_AUTHCFG, "mysql User ID field name within User table"), + + AP_INIT_TAKE1("AuthMySQLGroupField", ap_set_string_slot, +- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlGroupField), ++ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlGroupField), + OR_AUTHCFG, "mysql Group field name within table"), + + AP_INIT_TAKE1("AuthMySQLGroupUserNameField", ap_set_string_slot, +- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlGroupUserNameField), ++ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlGroupUserNameField), + OR_AUTHCFG, "mysql User ID field name within Group table"), + + AP_INIT_TAKE1("AuthMySQLPasswordField", ap_set_string_slot, +- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlPasswordField), ++ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlPasswordField), + OR_AUTHCFG, "mysql Password field name within table"), + + AP_INIT_TAKE1("AuthMySQLPwEncryption", ap_set_string_slot, +- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlEncryptionField), ++ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlEncryptionField), + OR_AUTHCFG, "mysql password encryption method"), + + AP_INIT_TAKE1("AuthMySQLSaltField", ap_set_string_slot, +- (void*) APR_XtOffsetOf(mysql_auth_config_rec, mysqlSaltField), ++ (void*) APR_OFFSETOF(mysql_auth_config_rec, mysqlSaltField), + OR_AUTHCFG, "mysql salfe field name within table"), + + /* AP_INIT_FLAG("AuthMySQLKeepAlive", ap_set_flag_slot, +- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlKeepAlive), ++ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlKeepAlive), + OR_AUTHCFG, "mysql connection kept open across requests if On"), + */ + AP_INIT_FLAG("AuthMySQLAuthoritative", ap_set_flag_slot, +- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlAuthoritative), ++ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlAuthoritative), + OR_AUTHCFG, "mysql lookup is authoritative if On"), + + AP_INIT_FLAG("AuthMySQLNoPasswd", ap_set_flag_slot, +- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlNoPasswd), ++ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlNoPasswd), + OR_AUTHCFG, "If On, only check if user exists; ignore password"), + + AP_INIT_FLAG("AuthMySQLEnable", ap_set_flag_slot, +- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlEnable), ++ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlEnable), + OR_AUTHCFG, "enable mysql authorization"), + + AP_INIT_TAKE1("AuthMySQLUserCondition", ap_set_string_slot, +- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlUserCondition), ++ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlUserCondition), + OR_AUTHCFG, "condition to add to user where-clause"), + + AP_INIT_TAKE1("AuthMySQLGroupCondition", ap_set_string_slot, +- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlGroupCondition), ++ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlGroupCondition), + OR_AUTHCFG, "condition to add to group where-clause"), + + AP_INIT_TAKE1("AuthMySQLCharacterSet", ap_set_string_slot, +- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlCharacterSet), ++ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlCharacterSet), + OR_AUTHCFG, "mysql character set to be used"), + + { NULL } +@@ -905,7 +905,16 @@ static char * format_remote_host(request + } + + static char * format_remote_ip(request_rec * r, char ** parm) { +- return r->connection->remote_ip; ++/* ++ from ap_mmn.h ++ 20111130.0 (2.4.0-dev) c->remote_ip becomes c->peer_ip and r->client_ip, ++ c->remote_addr becomes c->peer_addr and r->client_addr ++*/ ++#if AP_MODULE_MAGIC_AT_LEAST(20111130,0) ++ return r->connection->client_ip; ++#else ++ return r->connection->remote_ip; ++#endif + } + + static char * format_filename(request_rec * r, char ** parm) { +@@ -1270,7 +1279,7 @@ static int mysql_check_auth(request_rec + int method = r->method_number; + + #ifdef APACHE2 +- const apr_array_header_t *reqs_arr = ap_requires(r); ++ const apr_array_header_t *reqs_arr = NULL; + #else + const array_header *reqs_arr = ap_requires(r); + #endif diff --git a/www/mod_auth_mysql_another/files/patch-strcat b/www/mod_auth_mysql_another/files/patch-strcat deleted file mode 100644 index d97cf697b44f..000000000000 --- a/www/mod_auth_mysql_another/files/patch-strcat +++ /dev/null @@ -1,22 +0,0 @@ ---- mod_auth_mysql.c.orig Mon May 15 15:19:50 2006 -+++ mod_auth_mysql.c Mon May 15 15:20:06 2006 -@@ -206,7 +206,7 @@ - #define SNPRINTF apr_snprintf - #define PSTRDUP apr_pstrdup - #define PSTRNDUP apr_pstrndup -- #define STRCAT ap_pstrcat -+ #define STRCAT apr_pstrcat - #define POOL apr_pool_t - #include "http_request.h" /* for ap_hook_(check_user_id | auth_checker)*/ - #include "ap_compat.h" -@@ -255,6 +255,10 @@ - #define NOT_AUTHORIZED AUTH_REQUIRED - #define TABLE_GET ap_table_get - #define ISSPACE ap_isspace -+#endif -+ -+#ifndef APR_XtOffsetOf -+#define APR_XtOffsetOf APR_OFFSETOF - #endif - - #include "util_md5.h" |