Update to 0.6.0
Submitted to ports@ for test. Without reply. PR: ports/83748 Submitted by: Marcus Grando <marcus@corp.grupos.com.br> Approved by: pav (mentor), anders (maintainer timeout, 58 days)
This commit is contained in:
parent
92b67b5ed4
commit
e158cc495c
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=142967
@ -6,8 +6,7 @@
|
||||
#
|
||||
|
||||
PORTNAME= pam_mysql
|
||||
PORTVERSION= 0.5
|
||||
PORTREVISION= 1
|
||||
PORTVERSION= 0.6.0
|
||||
CATEGORIES= security databases
|
||||
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
||||
MASTER_SITE_SUBDIR= ${PORTNAME:S/_/-/}
|
||||
@ -17,37 +16,26 @@ COMMENT= A pam module for authenticating with MySQL
|
||||
|
||||
USE_REINPLACE= yes
|
||||
USE_MYSQL= yes
|
||||
BROKEN_WITH_MYSQL= 41
|
||||
USE_GMAKE= yes
|
||||
HAS_CONFIGURE= yes
|
||||
CONFIGURE_ARGS= --with-mysql=${LOCALBASE} --with-pam-mods-dir=${PREFIX}/lib --with-pam=/usr
|
||||
|
||||
WRKSRC= ${WRKDIR}/${PORTNAME}
|
||||
PLIST_FILES= lib/pam_mysql.la lib/pam_mysql.so
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
post-patch:
|
||||
${REINPLACE_CMD} -e "s@^#define DEBUG@#undef DEBUG@" ${WRKSRC}/pam_mysql.c
|
||||
|
||||
pre-build:
|
||||
@cd ${WRKSRC} && ${GMAKE} clean
|
||||
|
||||
do-build:
|
||||
${CC} -O -pipe -fpic -DPIC -Wall -I${LOCALBASE}/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${LOCALBASE}/lib/mysql -lmysqlclient
|
||||
|
||||
do-install:
|
||||
@${INSTALL_DATA} ${WRKSRC}/pam_mysql.so ${PREFIX}/lib
|
||||
.if !defined(NOPORTDOCS)
|
||||
@${INSTALL} -d -o root -g wheel -m 0755 ${DOCSDIR}
|
||||
@${INSTALL_DATA} ${WRKSRC}/Changelog ${DOCSDIR}
|
||||
@${INSTALL_DATA} ${WRKSRC}/CREDITS ${DOCSDIR}
|
||||
@${INSTALL_DATA} ${WRKSRC}/Readme ${DOCSDIR}
|
||||
PORTDOCS= *
|
||||
.endif
|
||||
|
||||
post-install:
|
||||
.if !defined(NOPORTDOCS)
|
||||
@${INSTALL} -d -o root -g wheel -m 0755 ${DOCSDIR}
|
||||
@${INSTALL_DATA} ${WRKSRC}/ChangeLog ${DOCSDIR}
|
||||
@${INSTALL_DATA} ${WRKSRC}/NEWS ${DOCSDIR}
|
||||
@${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
|
||||
.endif
|
||||
@${ECHO_MSG} "================================================================================"
|
||||
@${ECHO_MSG} "Copy/move/symlink ${PREFIX}/lib/pam_mysql.so to /usr/lib/pam_mysql.so"
|
||||
@${ECHO_MSG} "to be able to use it. Read files in ${PREFIX}/share/doc/pam_mysql"
|
||||
@${ECHO_MSG} "for info on how to set up."
|
||||
@${ECHO_MSG} "================================================================================"
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
.include <bsd.port.mk>
|
||||
|
@ -1,2 +1,2 @@
|
||||
MD5 (pam_mysql-0.5.tar.gz) = 8cf002392292ae2a5774545324739a94
|
||||
SIZE (pam_mysql-0.5.tar.gz) = 11587
|
||||
MD5 (pam_mysql-0.6.0.tar.gz) = b7f59c5450d89126b7f25fa2645b1b71
|
||||
SIZE (pam_mysql-0.6.0.tar.gz) = 312187
|
||||
|
@ -1,90 +0,0 @@
|
||||
--- pam_mysql.c.orig Sun Sep 15 10:28:58 2002
|
||||
+++ pam_mysql.c Thu Feb 13 14:58:21 2003
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
+#include <time.h>
|
||||
|
||||
|
||||
/* AFAIK, only FreeBSD has MD5Data() defined in md5.h
|
||||
@@ -54,7 +55,53 @@
|
||||
#define DEBUG
|
||||
|
||||
#include <security/pam_modules.h>
|
||||
+#ifdef _OPENPAM
|
||||
+#include <security/pam_appl.h>
|
||||
+#else
|
||||
#include <security/pam_misc.h>
|
||||
+#endif
|
||||
+
|
||||
+#ifdef _OPENPAM
|
||||
+/* some macros not defined in OpenPAM */
|
||||
+
|
||||
+/* Good policy to strike out passwords with some characters not just
|
||||
+ free the memory */
|
||||
+
|
||||
+#define _pam_overwrite(x) \
|
||||
+do { \
|
||||
+ register char *__xx__; \
|
||||
+ if ((__xx__=(x))) \
|
||||
+ while (*__xx__) \
|
||||
+ *__xx__++ = '\0'; \
|
||||
+} while (0)
|
||||
+
|
||||
+/*
|
||||
+ * Don't just free it, forget it too.
|
||||
+ */
|
||||
+
|
||||
+#define _pam_drop(X) \
|
||||
+do { \
|
||||
+ if (X) { \
|
||||
+ free(X); \
|
||||
+ X=NULL; \
|
||||
+ } \
|
||||
+} while (0)
|
||||
+
|
||||
+#define _pam_drop_reply(/* struct pam_response * */ reply, /* int */ replies) \
|
||||
+do { \
|
||||
+ int reply_i; \
|
||||
+ \
|
||||
+ for (reply_i=0; reply_i<replies; ++reply_i) { \
|
||||
+ if (reply[reply_i].resp) { \
|
||||
+ _pam_overwrite(reply[reply_i].resp); \
|
||||
+ free(reply[reply_i].resp); \
|
||||
+ } \
|
||||
+ } \
|
||||
+ if (reply) \
|
||||
+ free(reply); \
|
||||
+} while (0)
|
||||
+
|
||||
+#endif
|
||||
|
||||
struct optionstruct {
|
||||
char host[257];
|
||||
@@ -620,7 +667,11 @@
|
||||
retval = conv->conv(nargs,
|
||||
(const struct pam_message **) message,
|
||||
response, conv->appdata_ptr);
|
||||
- if ((retval != PAM_SUCCESS) && (retval != PAM_CONV_AGAIN))
|
||||
+ if ((retval != PAM_SUCCESS)
|
||||
+#ifndef _OPENPAM
|
||||
+ && (retval != PAM_CONV_AGAIN)
|
||||
+#endif
|
||||
+ )
|
||||
syslog(LOG_DEBUG, "pam_mysql: conversation failure [%s]",
|
||||
pam_strerror(pamh, retval));
|
||||
} else {
|
||||
@@ -827,8 +878,12 @@
|
||||
if (retval != PAM_SUCCESS) {
|
||||
if (resp != NULL)
|
||||
_pam_drop_reply(resp,i);
|
||||
+#ifndef _OPENPAM
|
||||
return ((retval == PAM_CONV_AGAIN)
|
||||
? PAM_INCOMPLETE : PAM_AUTHINFO_UNAVAIL);
|
||||
+#else
|
||||
+ return PAM_AUTHINFO_UNAVAIL;
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* we have a password so set AUTHTOK
|
@ -1,18 +0,0 @@
|
||||
--- Makefile.orig Thu Nov 21 02:13:01 2002
|
||||
+++ Makefile Mon May 19 23:41:43 2003
|
||||
@@ -3,13 +3,9 @@
|
||||
ifndef FULL_LINUX_PAM_SOURCE_TREE
|
||||
export DYNAMIC=-DPAM_DYNAMIC
|
||||
export CC=gcc
|
||||
-export CFLAGS=-O2 -Dlinux -DLINUX_PAM \
|
||||
- -ansi -D_POSIX_SOURCE -Wall -Wwrite-strings \
|
||||
- -Wpointer-arith -Wcast-qual -Wcast-align -Wtraditional \
|
||||
- -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline \
|
||||
- -Wshadow -pedantic -fPIC
|
||||
+export CFLAGS+=-I${LOCALBASE}/include -fPIC
|
||||
export MKDIR=mkdir -p
|
||||
-export LD_D=gcc -shared -Xlinker -x -L/usr/lib/mysql -lz
|
||||
+export LD_D=${CC} -shared -Xlinker -x -L${LOCALBASE}/lib/mysql -lz
|
||||
endif
|
||||
|
||||
#
|
@ -1,3 +1,3 @@
|
||||
This is a PAM module for authenticating with MySQL.
|
||||
|
||||
WWW: http://sourceforge.net/projects/pam-mysql/
|
||||
WWW: http://pam-mysql.sourceforge.net/
|
||||
|
@ -1,5 +0,0 @@
|
||||
lib/pam_mysql.so
|
||||
%%PORTDOCS%%%%DOCSDIR%%/Changelog
|
||||
%%PORTDOCS%%%%DOCSDIR%%/CREDITS
|
||||
%%PORTDOCS%%%%DOCSDIR%%/Readme
|
||||
%%PORTDOCS%%@dirrm %%DOCSDIR%%
|
Loading…
Reference in New Issue
Block a user