aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--security/Makefile1
-rw-r--r--security/pam-mysql/Makefile43
-rw-r--r--security/pam-mysql/distinfo1
-rw-r--r--security/pam-mysql/files/patch-aa113
-rw-r--r--security/pam-mysql/pkg-comment1
-rw-r--r--security/pam-mysql/pkg-descr3
-rw-r--r--security/pam-mysql/pkg-plist5
7 files changed, 167 insertions, 0 deletions
diff --git a/security/Makefile b/security/Makefile
index d54352cbb61a..3a835bd35d62 100644
--- a/security/Makefile
+++ b/security/Makefile
@@ -71,6 +71,7 @@
SUBDIR += p5-PGP
SUBDIR += p5-PGP-Sign
SUBDIR += pad
+ SUBDIR += pam-mysql
SUBDIR += pgp
SUBDIR += pgp5
SUBDIR += pgp6
diff --git a/security/pam-mysql/Makefile b/security/pam-mysql/Makefile
new file mode 100644
index 000000000000..d51d4d948fbc
--- /dev/null
+++ b/security/pam-mysql/Makefile
@@ -0,0 +1,43 @@
+# New ports collection makefile for: pam_mysql
+# Date created: 29 August 2000
+# Whom: Anders Nordby <anders@fix.no>
+#
+# $FreeBSD$
+#
+
+PORTNAME= pam_mysql
+PORTVERSION= 0.4
+CATEGORIES= security databases
+MASTER_SITES= http://download.sourceforge.net/pam-mysql/ \
+ http://www.freenix.no/~anders/
+
+MAINTAINER= anders@fix.no
+
+LIB_DEPENDS= mysqlclient.6:${PORTSDIR}/databases/mysql322-client
+
+USE_GMAKE= yes
+
+WRKSRC= ${WRKDIR}/${PORTNAME}
+
+post-patch:
+ @cd ${WRKSRC} && ${GMAKE} clean
+
+do-build:
+ ${CC} -O -pipe -fpic -DPIC -Wall -I${PREFIX}/include -c ${WRKSRC}/pam_mysql.c -o ${WRKSRC}/pam_mysql.o
+ ${LD} -x --shared -o ${WRKSRC}/pam_mysql.so ${WRKSRC}/pam_mysql.o -lpam -lcrypt -L${PREFIX}/lib/mysql -lmysqlclient
+
+do-install:
+ @${INSTALL_DATA} ${WRKSRC}/pam_mysql.so ${PREFIX}/lib
+ @${INSTALL} -d -o root -g wheel -m 0755 ${PREFIX}/share/doc/pam_mysql
+ @${INSTALL_DATA} ${WRKSRC}/Changelog ${PREFIX}/share/doc/pam_mysql/
+ @${INSTALL_DATA} ${WRKSRC}/CREDITS ${PREFIX}/share/doc/pam_mysql/
+ @${INSTALL_DATA} ${WRKSRC}/Readme ${PREFIX}/share/doc/pam_mysql/
+
+post-install:
+ @${ECHO} "================================================================================"
+ @${ECHO} "Copy/move/symlink ${PREFIX}/lib/pam_mysql.so to /usr/lib/pam_mysql.so"
+ @${ECHO} "to be able to use it. Read files in ${PREFIX}/share/doc/pam_mysql"
+ @${ECHO} "for info on how to set up."
+ @${ECHO} "================================================================================"
+
+.include <bsd.port.mk>
diff --git a/security/pam-mysql/distinfo b/security/pam-mysql/distinfo
new file mode 100644
index 000000000000..0e71567ccb42
--- /dev/null
+++ b/security/pam-mysql/distinfo
@@ -0,0 +1 @@
+MD5 (pam_mysql-0.4.tar.gz) = ae30788ac9c5d02fa1045d3403d48f2f
diff --git a/security/pam-mysql/files/patch-aa b/security/pam-mysql/files/patch-aa
new file mode 100644
index 000000000000..404eb8cbda02
--- /dev/null
+++ b/security/pam-mysql/files/patch-aa
@@ -0,0 +1,113 @@
+--- pam_mysql.c.old Tue Aug 29 03:31:46 2000
++++ pam_mysql.c Tue Aug 29 03:31:37 2000
+@@ -14,7 +14,6 @@
+ #include <unistd.h>
+ #include <syslog.h>
+ #include <stdarg.h>
+-#include <alloca.h>
+ #include <string.h>
+
+ #include <mysql/mysql.h>
+@@ -79,7 +78,6 @@
+
+ int db_connect (MYSQL * auth_sql_server);
+ void db_close( void );
+-static void _pam_log (int err, const char *format,...);
+ int askForPassword(pam_handle_t *pamh);
+
+ void db_close ( void )
+@@ -114,7 +112,7 @@
+ }
+ if ( retvalue != PAM_SUCCESS )
+ {
+- _pam_log(LOG_INFO, "MySQL err %s\n", mysql_error(auth_sql_server));
++ syslog(LOG_INFO, "MySQL err %s", mysql_error(auth_sql_server));
+ }
+
+ D (("returning."));
+@@ -149,13 +147,13 @@
+ {
+ sprintf(sql, "%s and %s", sql, options.where);
+ }
+- _pam_log(LOG_ERR,sql);
++ syslog(LOG_ERR,sql);
+ D ((sql));
+ mysql_query (auth_sql_server, sql);
+ free (sql);
+ result = mysql_store_result (auth_sql_server);
+ if (!result) {
+- _pam_log(LOG_ERR, mysql_error (auth_sql_server));
++ syslog(LOG_ERR, mysql_error(auth_sql_server));
+ D (("returning."));
+ return PAM_AUTH_ERR;
+ }
+@@ -191,17 +189,6 @@
+
+ /* Global PAM functions stolen from other modules */
+
+-static void _pam_log (int err, const char *format,...)
+-{
+- va_list args;
+-
+- va_start (args, format);
+- openlog (PAM_MODULE_NAME, LOG_PID, LOG_AUTH);
+- vsyslog (err, format, args);
+- va_end (args);
+- closelog ();
+-}
+-
+ int converse(pam_handle_t *pamh, int nargs
+ , struct pam_message **message
+ , struct pam_response **response)
+@@ -216,14 +203,12 @@
+ , response, conv->appdata_ptr);
+ if ((retval != PAM_SUCCESS) && (retval != PAM_CONV_AGAIN))
+ {
+- _pam_log(LOG_DEBUG, "conversation failure [%s]"
+- , pam_strerror(pamh, retval));
++ syslog(LOG_DEBUG, "conversation failure [%s]", pam_strerror(pamh, retval));
+ }
+ }
+ else
+ {
+- _pam_log(LOG_ERR, "couldn't obtain coversation function [%s]"
+- , pam_strerror(pamh, retval));
++ syslog(LOG_ERR, "couldn't obtain coversation function [%s]", pam_strerror(pamh, retval));
+ }
+ return retval; /* propagate error status */
+ }
+@@ -239,7 +224,7 @@
+ prompt = malloc(strlen(PLEASE_ENTER_PASSWORD));
+ if (prompt == NULL)
+ {
+- _pam_log(LOG_ERR,"pam_mysql: askForPassword(), out of memory!?");
++ syslog(LOG_ERR,"pam_mysql: askForPassword(), out of memory!?");
+ return PAM_BUF_ERR;
+ }
+ else
+@@ -251,7 +236,6 @@
+ mesg[i] = &msg[i];
+
+ retval = converse(pamh, ++i, mesg, &resp);
+-/* _pam_log(LOG_ERR, "retval == %d\n", retval); */
+ if (prompt)
+ {
+ _pam_overwrite(prompt);
+@@ -361,7 +345,7 @@
+
+ retval = pam_get_user (pamh, &user, NULL);
+ if (retval != PAM_SUCCESS || user == NULL) {
+- _pam_log (LOG_ERR, "no user specified");
++ syslog(LOG_ERR, "no user specified");
+ D (("returning."));
+ return PAM_USER_UNKNOWN;
+ }
+@@ -398,7 +382,7 @@
+ ,const char **argv)
+ {
+
+- _pam_log (LOG_INFO, "acct_mgmt \n");
++ syslog(LOG_INFO, "acct_mgmt \n");
+ return PAM_SUCCESS;
+ }
+
diff --git a/security/pam-mysql/pkg-comment b/security/pam-mysql/pkg-comment
new file mode 100644
index 000000000000..da728ddad337
--- /dev/null
+++ b/security/pam-mysql/pkg-comment
@@ -0,0 +1 @@
+A pam module for authenticating with MySQL
diff --git a/security/pam-mysql/pkg-descr b/security/pam-mysql/pkg-descr
new file mode 100644
index 000000000000..5b3260634622
--- /dev/null
+++ b/security/pam-mysql/pkg-descr
@@ -0,0 +1,3 @@
+This is a PAM module for authenticating with MySQL.
+
+WWW: http://sourceforge.net/projects/pam-mysql/
diff --git a/security/pam-mysql/pkg-plist b/security/pam-mysql/pkg-plist
new file mode 100644
index 000000000000..c6db9c211cfa
--- /dev/null
+++ b/security/pam-mysql/pkg-plist
@@ -0,0 +1,5 @@
+lib/pam_mysql.so
+share/doc/pam_mysql/Changelog
+share/doc/pam_mysql/CREDITS
+share/doc/pam_mysql/Readme
+@dirrm share/doc/pam_mysql