View | Details | Raw Unified | Return to bug 83748
Collapse All | Expand All

(-)pam-mysql/Makefile (-24 / +13 lines)
Lines 6-13 Link Here
6
#
6
#
7
7
8
PORTNAME=	pam_mysql
8
PORTNAME=	pam_mysql
9
PORTVERSION=	0.5
9
PORTVERSION=	0.6.0
10
PORTREVISION=	1
10
PORTREVISION=	0
11
CATEGORIES=	security databases
11
CATEGORIES=	security databases
12
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
12
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
13
MASTER_SITE_SUBDIR=	${PORTNAME:S/_/-/}
13
MASTER_SITE_SUBDIR=	${PORTNAME:S/_/-/}
Lines 17-53 Link Here
17
17
18
USE_REINPLACE=	yes
18
USE_REINPLACE=	yes
19
USE_MYSQL=	yes
19
USE_MYSQL=	yes
20
BROKEN_WITH_MYSQL=	41
20
HAS_CONFIGURE=	yes
21
USE_GMAKE=	yes
21
CONFIGURE_ARGS=	--with-mysql=${LOCALBASE} --with-pam-mods-dir=${PREFIX}/lib --with-pam=/usr
22
22
23
WRKSRC=		${WRKDIR}/${PORTNAME}
23
PLIST_FILES=	lib/pam_mysql.la lib/pam_mysql.so
24
24
25
.include <bsd.port.pre.mk>
26
27
post-patch:
28
	${REINPLACE_CMD} -e "s@^#define DEBUG@#undef DEBUG@" ${WRKSRC}/pam_mysql.c
29
30
pre-build:
31
	@cd ${WRKSRC} && ${GMAKE} clean
32
33
do-build:
34
	${CC} -O -pipe -fpic -DPIC -Wall -I${LOCALBASE}/include -c ${WRKSRC}/pam_mysql.c -o ${WRKSRC}/pam_mysql.o
35
	${LD} -x --shared -o ${WRKSRC}/pam_mysql.so ${WRKSRC}/pam_mysql.o -lpam -lcrypt -L${LOCALBASE}/lib/mysql -lmysqlclient
36
37
do-install:
38
	@${INSTALL_DATA} ${WRKSRC}/pam_mysql.so ${PREFIX}/lib
39
.if !defined(NOPORTDOCS)
25
.if !defined(NOPORTDOCS)
40
	@${INSTALL} -d -o root -g wheel -m 0755 ${DOCSDIR}
26
PORTDOCS=	*
41
	@${INSTALL_DATA} ${WRKSRC}/Changelog ${DOCSDIR}
42
	@${INSTALL_DATA} ${WRKSRC}/CREDITS ${DOCSDIR}
43
	@${INSTALL_DATA} ${WRKSRC}/Readme ${DOCSDIR}
44
.endif
27
.endif
45
28
46
post-install:
29
post-install:
30
.if !defined(NOPORTDOCS)
31
	@${INSTALL} -d -o root -g wheel -m 0755 ${DOCSDIR}
32
	@${INSTALL_DATA} ${WRKSRC}/ChangeLog ${DOCSDIR}
33
	@${INSTALL_DATA} ${WRKSRC}/NEWS ${DOCSDIR}
34
	@${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
35
.endif
47
	@${ECHO_MSG} "================================================================================"
36
	@${ECHO_MSG} "================================================================================"
48
	@${ECHO_MSG} "Copy/move/symlink ${PREFIX}/lib/pam_mysql.so to /usr/lib/pam_mysql.so"
37
	@${ECHO_MSG} "Copy/move/symlink ${PREFIX}/lib/pam_mysql.so to /usr/lib/pam_mysql.so"
49
	@${ECHO_MSG} "to be able to use it. Read files in ${PREFIX}/share/doc/pam_mysql"
38
	@${ECHO_MSG} "to be able to use it. Read files in ${PREFIX}/share/doc/pam_mysql"
50
	@${ECHO_MSG} "for info on how to set up."
39
	@${ECHO_MSG} "for info on how to set up."
51
	@${ECHO_MSG} "================================================================================"
40
	@${ECHO_MSG} "================================================================================"
52
41
53
.include <bsd.port.post.mk>
42
.include <bsd.port.mk>
(-)pam-mysql/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
MD5 (pam_mysql-0.5.tar.gz) = 8cf002392292ae2a5774545324739a94
1
MD5 (pam_mysql-0.6.0.tar.gz) = b7f59c5450d89126b7f25fa2645b1b71
2
SIZE (pam_mysql-0.5.tar.gz) = 11587
2
SIZE (pam_mysql-0.6.0.tar.gz) = 312187
(-)pam-mysql/files/patch-aa (-90 lines)
Lines 1-90 Link Here
1
--- pam_mysql.c.orig	Sun Sep 15 10:28:58 2002
2
+++ pam_mysql.c	Thu Feb 13 14:58:21 2003
3
@@ -23,6 +23,7 @@
4
 #include <sys/socket.h>
5
 #include <netinet/in.h>
6
 #include <arpa/inet.h>
7
+#include <time.h>
8
 
9
 
10
 /* AFAIK, only FreeBSD has MD5Data() defined in md5.h
11
@@ -54,7 +55,53 @@
12
 #define DEBUG 
13
 
14
 #include <security/pam_modules.h>
15
+#ifdef _OPENPAM
16
+#include <security/pam_appl.h>
17
+#else
18
 #include <security/pam_misc.h>
19
+#endif
20
+
21
+#ifdef _OPENPAM
22
+/* some macros not defined in OpenPAM */
23
+
24
+/* Good policy to strike out passwords with some characters not just
25
+   free the memory */
26
+
27
+#define _pam_overwrite(x)        \
28
+do {                             \
29
+     register char *__xx__;      \
30
+     if ((__xx__=(x)))           \
31
+          while (*__xx__)        \
32
+               *__xx__++ = '\0'; \
33
+} while (0)
34
+
35
+/*
36
+ * Don't just free it, forget it too.
37
+ */
38
+
39
+#define _pam_drop(X) \
40
+do {                 \
41
+    if (X) {         \
42
+        free(X);     \
43
+        X=NULL;      \
44
+    }                \
45
+} while (0)
46
+
47
+#define _pam_drop_reply(/* struct pam_response * */ reply, /* int */ replies) \
48
+do {                                              \
49
+    int reply_i;                                  \
50
+                                                  \
51
+    for (reply_i=0; reply_i<replies; ++reply_i) { \
52
+	if (reply[reply_i].resp) {                \
53
+	    _pam_overwrite(reply[reply_i].resp);  \
54
+	    free(reply[reply_i].resp);            \
55
+	}                                         \
56
+    }                                             \
57
+    if (reply)                                    \
58
+	free(reply);                              \
59
+} while (0)
60
+
61
+#endif
62
 
63
 struct optionstruct {
64
 	char host[257];
65
@@ -620,7 +667,11 @@
66
 		retval = conv->conv(nargs,
67
 		                    (const struct pam_message **) message,
68
 		                    response, conv->appdata_ptr);
69
-		if ((retval != PAM_SUCCESS) && (retval != PAM_CONV_AGAIN))
70
+		if ((retval != PAM_SUCCESS)
71
+#ifndef _OPENPAM
72
+			&& (retval != PAM_CONV_AGAIN)
73
+#endif
74
+		   )
75
 			syslog(LOG_DEBUG, "pam_mysql: conversation failure [%s]",
76
 			       pam_strerror(pamh, retval));
77
 	} else {
78
@@ -827,8 +878,12 @@
79
 	if (retval != PAM_SUCCESS) {
80
 		if (resp != NULL)
81
 			_pam_drop_reply(resp,i);
82
+#ifndef _OPENPAM
83
 		return ((retval == PAM_CONV_AGAIN)
84
 		        ? PAM_INCOMPLETE : PAM_AUTHINFO_UNAVAIL);
85
+#else
86
+		return PAM_AUTHINFO_UNAVAIL;
87
+#endif
88
 	}
89
 
90
 	/* we have a password so set AUTHTOK
(-)pam-mysql/files/patch-ab (-18 lines)
Lines 1-18 Link Here
1
--- Makefile.orig	Thu Nov 21 02:13:01 2002
2
+++ Makefile	Mon May 19 23:41:43 2003
3
@@ -3,13 +3,9 @@
4
 ifndef FULL_LINUX_PAM_SOURCE_TREE
5
 export DYNAMIC=-DPAM_DYNAMIC
6
 export CC=gcc
7
-export CFLAGS=-O2 -Dlinux -DLINUX_PAM \
8
-       -ansi -D_POSIX_SOURCE -Wall -Wwrite-strings \
9
-       -Wpointer-arith -Wcast-qual -Wcast-align -Wtraditional \
10
-       -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline \
11
-       -Wshadow -pedantic -fPIC
12
+export CFLAGS+=-I${LOCALBASE}/include -fPIC
13
 export MKDIR=mkdir -p
14
-export LD_D=gcc -shared -Xlinker -x -L/usr/lib/mysql -lz
15
+export LD_D=${CC} -shared -Xlinker -x -L${LOCALBASE}/lib/mysql -lz
16
 endif
17
 
18
 #
(-)pam-mysql/pkg-descr (-1 / +1 lines)
Lines 1-3 Link Here
1
This is a PAM module for authenticating with MySQL.
1
This is a PAM module for authenticating with MySQL.
2
2
3
WWW: http://sourceforge.net/projects/pam-mysql/
3
WWW: http://pam-mysql.sourceforge.net/
(-)pam-mysql/pkg-plist (-5 lines)
Lines 1-5 Link Here
1
lib/pam_mysql.so
2
%%PORTDOCS%%%%DOCSDIR%%/Changelog
3
%%PORTDOCS%%%%DOCSDIR%%/CREDITS
4
%%PORTDOCS%%%%DOCSDIR%%/Readme
5
%%PORTDOCS%%@dirrm %%DOCSDIR%%

Return to bug 83748