diff options
author | mbr <mbr@FreeBSD.org> | 2002-04-27 13:53:37 +0000 |
---|---|---|
committer | mbr <mbr@FreeBSD.org> | 2002-04-27 13:53:37 +0000 |
commit | f2a8c52da1cc0aa6c6d3ce4676059664c306a45b (patch) | |
tree | b811f6d95232d44a4e0ac30dd834deb835c50c54 /www | |
parent | 507761921174f395fbbff0e8425522eedc7aa830 (diff) | |
download | FreeBSD-ports-f2a8c52da1cc0aa6c6d3ce4676059664c306a45b.zip FreeBSD-ports-f2a8c52da1cc0aa6c6d3ce4676059664c306a45b.tar.gz |
Another version of mod_auth_mysql which works ok with more than one
Database too.
Diffstat (limited to 'www')
-rw-r--r-- | www/Makefile | 1 | ||||
-rw-r--r-- | www/mod_auth_mysql_another/Makefile | 67 | ||||
-rw-r--r-- | www/mod_auth_mysql_another/distinfo | 1 | ||||
-rw-r--r-- | www/mod_auth_mysql_another/files/USAGE | 126 | ||||
-rw-r--r-- | www/mod_auth_mysql_another/files/patch-Makefile | 20 | ||||
-rw-r--r-- | www/mod_auth_mysql_another/pkg-comment | 1 | ||||
-rw-r--r-- | www/mod_auth_mysql_another/pkg-descr | 11 | ||||
-rw-r--r-- | www/mod_auth_mysql_another/pkg-plist | 7 |
8 files changed, 234 insertions, 0 deletions
diff --git a/www/Makefile b/www/Makefile index dad2946..a50dcb2 100644 --- a/www/Makefile +++ b/www/Makefile @@ -150,6 +150,7 @@ SUBDIR += mod_auth_external SUBDIR += mod_auth_kerb SUBDIR += mod_auth_mysql + SUBDIR += mod_auth_mysql_another SUBDIR += mod_auth_pam SUBDIR += mod_auth_pgsql SUBDIR += mod_auth_pwcheck diff --git a/www/mod_auth_mysql_another/Makefile b/www/mod_auth_mysql_another/Makefile new file mode 100644 index 0000000..40488a0 --- /dev/null +++ b/www/mod_auth_mysql_another/Makefile @@ -0,0 +1,67 @@ +# New ports collection makefile for: apache mod_auth_mysql_another +# Date created: 2002/04/20 +# Whom: mbr@freebsd.org +# +# $FreeBSD$ + +PORTNAME= mod_auth_mysql_another +PORTVERSION= 1.0 +CATEGORIES= www +MASTER_SITES= ftp://ftp.kcilink.com/pub/ +DISTNAME= mod_auth_mysql +EXTRACT_SUFX= .c.gz + +MAINTAINER= mbr@FreeBSD.org + +BUILD_DEPENDS= ${LOCALBASE}/sbin/apxs:${PORTSDIR}/www/${AP_PORT} +LIB_DEPENDS= mysqlclient.10:${PORTSDIR}/databases/mysql323-client +RUN_DEPENDS= ${LOCALBASE}/sbin/${AP_TARGET}:${PORTSDIR}/www/${AP_PORT} + +.include <bsd.port.pre.mk> + +APXS= ${LOCALBASE}/sbin/apxs + +AP_PORT?= apache13 +.if exists(${APXS}) +APXS_WORKS!= ${APXS} -q TARGET 2>/dev/null || echo no +.endif +.if exists(${APXS}) && ${APXS_WORKS} != no +AP_TARGET!= ${APXS} -q TARGET +AP_SYSCONF!= ${APXS} -q SYSCONFDIR +AP_INCLUDE!= ${APXS} -q INCLUDEDIR +AP_LIBEXEC!= ${APXS} -q LIBEXECDIR +.else +AP_TARGET?= httpd +AP_SYSCONF?= ${PREFIX}/etc/apache +AP_INCLUDE?= ${PREFIX}/include/apache +AP_LIBEXEC?= ${PREFIX}/libexec/apache +.endif + +AUTH_MYSQL_DOCS= apache/manual/mod/mod_auth_mysql_another + +PLIST_SUB= AUTH_MYSQL_DOCS="${AUTH_MYSQL_DOCS}" + +PKGMESSAGE= ${WRKSRC}/.install_notes + +do-extract: + @${RM} -rf ${WRKDIR} + @${MKDIR} -p ${WRKDIR}/mod_auth_mysql + @for file in ${EXTRACT_ONLY}; do \ + ${CP} ${_DISTDIR}/$$file ${WRKDIR}/mod_auth_mysql; \ + ${EXTRACT_CMD} -d ${WRKDIR}/mod_auth_mysql/$$file; \ + done +.if !defined(EXTRACT_PRESERVE_OWNERSHIP) + @if [ `id -u` = 0 ]; then \ + ${CHMOD} -R ug-s ${WRKDIR}; \ + ${CHOWN} -R 0:0 ${WRKDIR}; \ + fi +.endif + +post-install: +.if !defined(NOPORTDOCS) + @${MKDIR} ${PREFIX}/share/doc/${AUTH_MYSQL_DOCS} + @${INSTALL_DATA} ${FILESDIR}/USAGE ${PREFIX}/share/doc/${AUTH_MYSQL_DOCS} + @@(cd ${PREFIX}/share/doc && ${LN} -sf ${PREFIX}/share/doc/${AUTH_MYSQL_DOCS} mod_auth_mysql_another) +.endif + +.include <bsd.port.post.mk> diff --git a/www/mod_auth_mysql_another/distinfo b/www/mod_auth_mysql_another/distinfo new file mode 100644 index 0000000..8da2f9d --- /dev/null +++ b/www/mod_auth_mysql_another/distinfo @@ -0,0 +1 @@ +MD5 (mod_auth_mysql.c.gz) = 2b70fbfe0fb8d263c1c3711c435c4df6 diff --git a/www/mod_auth_mysql_another/files/USAGE b/www/mod_auth_mysql_another/files/USAGE new file mode 100644 index 0000000..f94c0cf --- /dev/null +++ b/www/mod_auth_mysql_another/files/USAGE @@ -0,0 +1,126 @@ +/* + * http_auth_msql: authentication + * Rob McCool & Brian Behlendorf. + * Adapted to Shambhala by rst. + * converted to use MySQL by Vivek Khera <khera@kciLink.com> + * FreeBSD port by Martin Blapp, <mb@imp.ch> + */ + + +Module definition information - the part between the -START and -END +lines below is used by Configure. This could be stored in a separate +instead. + +MODULE-DEFINITION-START +Name: mysql_auth_module +ConfigStart + MYSQL_LIB="-L/usr/local/lib/mysql -lmysqlclient -lm" + if [ "X$MYSQL_LIB" != "X" ]; then + LIBS="$LIBS $MYSQL_LIB" + echo " + using $MYSQL_LIB for MySQL support" + fi +ConfigEnd +MODULE-DEFINITION-END + +Tracks user/passwords/group in MySQL database. A suitable table +might be: + +CREATE TABLE user_info ( + user_name CHAR(30) NOT NULL, + user_passwd CHAR(64) NOT NULL, + user_group CHAR(10), + [ any other fields if needed ] + PRIMARY KEY (user) +) + +The password field needs to match to size of the encrypted +password. It depends if you use MD5, DES or BLOWFISH encyrpted +passwords. For DES passwords, CHAR(20) is enough. + +User_name must be a unique, non-empty field. Its length is however +long you want it to be. + +Any other fields in the named table will be ignored. The actual +field names are configurable using the parameters listed below. +The defaults are "user_name" and "user_passwd" respectively, for +the user ID and the password, and "user_group" for the group which +is optional. If you like to store passwords in clear text, set +AuthMySQLCryptedPasswords to Off. I think this is a bad idea, but +people have requested it. + +Usage in per-directory access conf file: + +AuthName MySQL Testing +AuthType Basic +AuthGroupFile /dev/null +AuthMySQLHost localhost +AuthMySQLDB test +AuthMySQLUserTable user_info +require valid-user + +The following parameters are optional in the config file. The defaults +values are shown here. + +AuthMySQLUser <no default -- NULL> +AuthMySQLPassword <no default -- NULL> +AuthMySQLNameField user_name +AuthMySQLPasswordField user_passwd +AuthMySQLCryptedPasswords On +AuthMySQLKeepAlive Off +AuthMySQLAuthoritative On +AuthMySQLNoPasswd Off +AuthMySQLGroupField <no default> +AuthMySQLGroupTable <defaults to value of AuthMySQLUserTable> + +The Host of "localhost" means use the MySQL socket instead of a TCP +connection to the database. DB is the database name on the server, +and UserTable is the actual table name within that database. + +If AuthMySQLAuthoritative is Off, then iff the user is not found in +the database, let other auth modules try to find the user. Default +is On. + +If AuthMySQLKeepAlive is "On", then the server instance will keep +the MySQL server connection open. In this case, the first time the +connection is made, it will use the current set of Host, User, and +Password settings. Subsequent changes to these will not affect +this server, so they should all be the same in every htaccess file. +If you need to access multiple MySQL servers for this authorization +scheme from the same web server, then keep this setting "Off" -- +this will open a new connection to the server every time it needs +one. The values of the DB and various tables and fields are always +used from the current htaccess file settings. + +If AuthMySQLNoPasswd is "On", then any password the user enters will +be accepted as long as the user exists in the database. Setting this +also overrides the setting for AuthMySQLPasswordField to be the same +as AuthMySQLNameField (so that the SQL statements still work when there +is no password at all in the database, and to remain backward-compatible +with the default values for these fields.) + +For groups, we use the same AuthMySQLNameField as above for the +user ID, and AuthMySQLGroupField to specify the group name. There +is no default for this parameter. Leaving it undefined means +groups are not implemented using MySQL tables. AuthMySQLGroupTable +specifies the table to use to get the group info. It defaults to +the value of AuthMySQLUserTable. If you are not using groups, you +do not need a "user_group" field in your database, obviously. + +A user can be a member of multiple groups, but in this case the +user id field *cannot* be PRIMARY KEY. You need to have multiple +rows with the same user ID, one per group to which that ID belongs. +In this case, you MUST put the GroupTable on a separate table from +the user table. This is to help prevent the user table from having +inconsistent passwords in it. If each user is only in one group, +then the group field can be in the same table as the password +field. A group-only table might look like this: + +CREATE TABLE user_group ( + user_name char(50) DEFAULT '' NOT NULL, + user_group char(20) DEFAULT '' NOT NULL, + create_date int, + expire_date int, + PRIMARY KEY (user_name,user_group) +; + +note that you still need a user table which has the passwords in it. diff --git a/www/mod_auth_mysql_another/files/patch-Makefile b/www/mod_auth_mysql_another/files/patch-Makefile new file mode 100644 index 0000000..c1eed73 --- /dev/null +++ b/www/mod_auth_mysql_another/files/patch-Makefile @@ -0,0 +1,20 @@ +--- /dev/null Sat Apr 20 17:11:40 2002 ++++ Makefile Sat Apr 20 17:12:22 2002 +@@ -0,0 +1,17 @@ ++APXS = apxs ++APXSFLAGS = ++DSO = mod_auth_mysql.so ++SRCS = mod_auth_mysql.c ++OPTS = -I/usr/local/include -L/usr/local/lib/mysql -lmysqlclient ++ ++all: $(DSO) ++ ++$(DSO): $(SRCS) ++ $(APXS) $(APXSFLAGS) -o $(DSO) $(OPTS) -c $(SRCS) ++ ++install: $(DSO) ++ $(APXS) $(APXSFLAGS) $(NAME) -i -A $(DSO) ++ ++clean: ++ -rm -f *.o $(DSO) ++ diff --git a/www/mod_auth_mysql_another/pkg-comment b/www/mod_auth_mysql_another/pkg-comment new file mode 100644 index 0000000..1d02fe2 --- /dev/null +++ b/www/mod_auth_mysql_another/pkg-comment @@ -0,0 +1 @@ +Allows users to use MySQL databases for user authentication diff --git a/www/mod_auth_mysql_another/pkg-descr b/www/mod_auth_mysql_another/pkg-descr new file mode 100644 index 0000000..251973d --- /dev/null +++ b/www/mod_auth_mysql_another/pkg-descr @@ -0,0 +1,11 @@ +This add-on module allows the apache web server to use a MySQL database for user and/or group authentication. +For large user lists this can offer a significate speed up over apache's standard flat file format. + +There is a different version of mod_auth_mysql in the ports tree with different configuration. Unfortunatly +this version has a bug if used on a system which has more than one authentification databases. You may have +to look which version fits your requirements. + +WWW: ftp://ftp.kcilink.com/pub + +Martin Blapp +mbr@freebsd.org diff --git a/www/mod_auth_mysql_another/pkg-plist b/www/mod_auth_mysql_another/pkg-plist new file mode 100644 index 0000000..00111ad --- /dev/null +++ b/www/mod_auth_mysql_another/pkg-plist @@ -0,0 +1,7 @@ +libexec/apache/mod_auth_mysql.so +@exec %D/sbin/apxs -e -a -n auth_mysql %f +@unexec %D/sbin/apxs -e -A -n auth_mysql %f +share/doc/%%AUTH_MYSQL_DOCS%%/USAGE +@exec (cd %D/share/doc && ln -sf %%AUTH_MYSQL_DOCS%% mod_auth_mysql_another) +@unexec rm -rf %D/share/doc/mod_auth_mysql_another +@dirrm share/doc/%%AUTH_MYSQL_DOCS%% |