summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /www-apache/mod_auth_mysql
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'www-apache/mod_auth_mysql')
-rw-r--r--www-apache/mod_auth_mysql/Manifest1
-rw-r--r--www-apache/mod_auth_mysql/files/12_mod_auth_mysql.conf132
-rw-r--r--www-apache/mod_auth_mysql/files/mod_auth_mysql-3.0.0-apache-2.2.patch131
-rw-r--r--www-apache/mod_auth_mysql/files/mod_auth_mysql-3.0.0-htpasswd2-auth-style.patch35
-rw-r--r--www-apache/mod_auth_mysql/metadata.xml8
-rw-r--r--www-apache/mod_auth_mysql/mod_auth_mysql-3.0.0-r3.ebuild34
6 files changed, 341 insertions, 0 deletions
diff --git a/www-apache/mod_auth_mysql/Manifest b/www-apache/mod_auth_mysql/Manifest
new file mode 100644
index 000000000000..279999df809e
--- /dev/null
+++ b/www-apache/mod_auth_mysql/Manifest
@@ -0,0 +1 @@
+DIST mod_auth_mysql-3.0.0.tar.gz 19257 SHA256 56da2e386583548f2fd9976101633f028d5d4649b46f428ff1d0dd1639efbad4 SHA512 99e71b0df27966b1540be325c2e124e3f09e40b39afbc6757b539309358b9a52dbeae21f16429348db014f136a19b06859e82af7c5bb5130c6cb923138b79fc9 WHIRLPOOL 60538b9fa9d1e6baea874ad5b1fac0ec12e39dd11e465e197275177b6ea01c974baa1ba8d2ede688cf57ee155e80dfd909292b08b9751b372df1616818eabe89
diff --git a/www-apache/mod_auth_mysql/files/12_mod_auth_mysql.conf b/www-apache/mod_auth_mysql/files/12_mod_auth_mysql.conf
new file mode 100644
index 000000000000..f33ced4bdda0
--- /dev/null
+++ b/www-apache/mod_auth_mysql/files/12_mod_auth_mysql.conf
@@ -0,0 +1,132 @@
+<IfDefine AUTH_MYSQL>
+LoadModule mysql_auth_module modules/mod_auth_mysql.so
+
+# mod_auth_mysql can be used to limit access to documents by checking
+# data in a MySQL database.
+
+# This will enable user-based MySQL authentication of everything
+# within /home/httpd. You'll need to do the following as the MySQL
+# root user beforehand:
+#
+# CREATE DATABASE auth;
+# USE auth;
+# CREATE TABLE users (
+# user_name CHAR(30) NOT NULL,
+# user_passwd CHAR(20) NOT NULL,
+# PRIMARY KEY (user_name)
+# );
+# GRANT SELECT
+# ON auth.users
+# TO authuser@localhost
+# IDENTIFIED BY 'PaSsW0Rd';
+#
+# INSERT INTO users VALUES ('testuser', ENCRYPT('testpass'));
+#
+#<Directory /home/httpd>
+# # If you want tot make mod_auth_mysql work with apache-2.2, please uncomment
+# # the following line:
+# #AuthBasicAuthoritative Off
+# AuthName "MySQL authenticated zone"
+# AuthType Basic
+#
+# AuthMySQLUser authuser
+# AuthMySQLPassword PaSsW0Rd
+# AuthMySQLDB auth
+# AuthMySQLUserTable users
+# AuthMySQLNameField user_name
+# AuthMySQLPasswordField user_passwd
+#
+# require valid-user
+#</Directory>
+
+# This will enable group-based MySQL authentication of everything
+# within /home/httpd. You'll need to do the following as the MySQL
+# root user beforehand:
+#
+# CREATE DATABASE auth;
+# USE auth;
+# CREATE TABLE users (
+# user_name CHAR(30) NOT NULL,
+# user_passwd CHAR(20) NOT NULL,
+# user_group CHAR(20) NOT NULL,
+# PRIMARY KEY (user_name)
+# );
+# GRANT SELECT
+# ON auth.users
+# TO authuser@localhost
+# IDENTIFIED BY 'PaSsW0Rd';
+#
+# INSERT INTO users VALUES ('testuser', ENCRYPT('testpass'), 'user');
+# INSERT INTO users VALUES ('testadmin', ENCRYPT('testpass'), 'admin');
+#
+#<Directory /home/httpd>
+# # If you want tot make mod_auth_mysql work with apache-2.2, please uncomment
+# # the following line:
+# #AuthBasicAuthoritative Off
+# AuthName "MySQL group authenticated zone"
+# AuthType Basic
+#
+# AuthMySQLUser authuser
+# AuthMySQLPassword PaSsW0Rd
+# AuthMySQLDB auth
+# AuthMySQLUserTable users
+# AuthMySQLNameField user_name
+# AuthMySQLPasswordField user_passwd
+# AuthMySQLGroupField user_group
+#
+# require group admin
+#</Directory>
+
+# Like the above this enables group-based MySQL authentication of
+# everything within /home/httpd, but this configuration allows users to
+# belong to more than one group. You'll need to do the following as
+# the MySQL root user beforehand:
+#
+# CREATE DATABASE auth;
+# USE auth;
+# CREATE TABLE users (
+# user_name CHAR(30) NOT NULL,
+# user_passwd CHAR(20) NOT NULL,
+# PRIMARY KEY (user_name)
+# );
+# CREATE TABLE groups (
+# user_name CHAR(30) NOT NULL,
+# user_group CHAR(20) NOT NULL,
+# PRIMARY KEY (user_name, user_group)
+# );
+# GRANT SELECT
+# ON auth.users
+# TO authuser@localhost
+# IDENTIFIED BY 'PaSsW0Rd';
+# GRANT SELECT
+# ON auth.groups
+# TO authuser@localhost
+# IDENTIFIED BY 'PaSsW0Rd';
+#
+# INSERT INTO users VALUES ('testuser', ENCRYPT('testpass'));
+# INSERT INTO groups VALUES ('testuser', 'user');
+# INSERT INTO users VALUES ('testadmin', ENCRYPT('testpass'));
+# INSERT INTO groups VALUES ('testadmin', 'admin');
+# INSERT INTO groups VALUES ('testadmin', 'user');
+#
+#<Directory /home/httpd>
+# # If you want tot make mod_auth_mysql work with apache-2.2, please uncomment
+# # the following line:
+# #AuthBasicAuthoritative Off
+# AuthName "MySQL group authenticated zone"
+# AuthType Basic
+#
+# AuthMySQLUser authuser
+# AuthMySQLPassword PaSsW0Rd
+# AuthMySQLDB auth
+# AuthMySQLUserTable users
+# AuthMySQLNameField user_name
+# AuthMySQLPasswordField user_passwd
+# AuthMySQLGroupTable groups
+# AuthMySQLGroupField user_group
+#
+# require group user
+#</Directory>
+</IfDefine>
+
+# vim: ts=4 filetype=apache
diff --git a/www-apache/mod_auth_mysql/files/mod_auth_mysql-3.0.0-apache-2.2.patch b/www-apache/mod_auth_mysql/files/mod_auth_mysql-3.0.0-apache-2.2.patch
new file mode 100644
index 000000000000..30881f878d23
--- /dev/null
+++ b/www-apache/mod_auth_mysql/files/mod_auth_mysql-3.0.0-apache-2.2.patch
@@ -0,0 +1,131 @@
+Index: mod_auth_mysql-3.0.0/mod_auth_mysql.c
+===================================================================
+--- mod_auth_mysql-3.0.0.orig/mod_auth_mysql.c
++++ mod_auth_mysql-3.0.0/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 }
diff --git a/www-apache/mod_auth_mysql/files/mod_auth_mysql-3.0.0-htpasswd2-auth-style.patch b/www-apache/mod_auth_mysql/files/mod_auth_mysql-3.0.0-htpasswd2-auth-style.patch
new file mode 100644
index 000000000000..e7f6eb31ef3f
--- /dev/null
+++ b/www-apache/mod_auth_mysql/files/mod_auth_mysql-3.0.0-htpasswd2-auth-style.patch
@@ -0,0 +1,35 @@
+Index: mod_auth_mysql-3.0.0/mod_auth_mysql.c
+===================================================================
+--- mod_auth_mysql-3.0.0.orig/mod_auth_mysql.c
++++ mod_auth_mysql-3.0.0/mod_auth_mysql.c
+@@ -288,6 +288,7 @@ static short pw_crypted(POOL * pool, con
+ static short pw_aes(POOL * pool, const char * real_pw, const char * sent_pw, const char * salt);
+ #endif
+ static short pw_sha1(POOL * pool, const char * real_pw, const char * sent_pw, const char * salt);
++static short pw_apr(POOL * pool, const char * real_pw, const char * sent_pw, const char * salt);
+ static short pw_plain(POOL * pool, const char * real_pw, const char * sent_pw, const char * salt);
+
+ static char * format_remote_host(request_rec * r, char ** parm);
+@@ -318,7 +319,8 @@ static encryption encryptions[] = {{"cry
+ #if _AES
+ {"aes", SALT_REQUIRED, pw_aes},
+ #endif
+- {"sha1", NO_SALT, pw_sha1}};
++ {"sha1", NO_SALT, pw_sha1},
++ {"apr", NO_SALT, pw_apr}};
+ typedef struct { /* User formatting patterns */
+ char pattern; /* Pattern to match */
+ char * (*func)(request_rec * r, char ** parm);
+@@ -856,6 +858,12 @@ static short pw_sha1(POOL * pool, const
+ return strcasecmp(bin2hex(pool, scrambled_sent_pw, enc_len), real_pw) == 0;
+ }
+
++/* checks passwords from htpasswd */
++static short pw_apr(POOL * pool, const char * real_pw, const char * sent_pw, const char * salt) {
++ /* apr_password_validate will do the job */
++ return apr_password_validate(sent_pw, real_pw) == APR_SUCCESS;
++}
++
+ /* checks plain text passwords */
+ static short pw_plain(POOL * pool, const char * real_pw, const char * sent_pw, const char * salt) {
+ return strcmp(real_pw, sent_pw) == 0;
diff --git a/www-apache/mod_auth_mysql/metadata.xml b/www-apache/mod_auth_mysql/metadata.xml
new file mode 100644
index 000000000000..eb0a45566bdb
--- /dev/null
+++ b/www-apache/mod_auth_mysql/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>mysql</herd>
+ <upstream>
+ <remote-id type="sourceforge">modauthmysql</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-apache/mod_auth_mysql/mod_auth_mysql-3.0.0-r3.ebuild b/www-apache/mod_auth_mysql/mod_auth_mysql-3.0.0-r3.ebuild
new file mode 100644
index 000000000000..f6772bc9fc68
--- /dev/null
+++ b/www-apache/mod_auth_mysql/mod_auth_mysql-3.0.0-r3.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit apache-module eutils multilib
+
+DESCRIPTION="Basic authentication for Apache using a MySQL database"
+HOMEPAGE="http://modauthmysql.sourceforge.net/"
+SRC_URI="mirror://sourceforge/modauthmysql/${P}.tar.gz"
+
+LICENSE="Apache-1.1"
+KEYWORDS="amd64 x86"
+SLOT="0"
+IUSE=""
+
+DEPEND="virtual/mysql
+ sys-libs/zlib"
+RDEPEND="${DEPEND}
+ !www-apache/mod-auth-mysql"
+
+APXS2_ARGS="-c -I/usr/include/mysql -L/usr/$(get_libdir)/mysql -Wl,-R/usr/$(get_libdir)/mysql -lmysqlclient_r -lm -lz ${PN}.c"
+APACHE2_MOD_CONF="12_${PN}"
+APACHE2_MOD_DEFINE="AUTH_MYSQL"
+
+DOCFILES="README CONFIGURE"
+
+need_apache2_2
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-apache-2.2.patch"
+ epatch "${FILESDIR}/${P}-htpasswd2-auth-style.patch"
+}