[111270] trunk/dports/devel
devans at macports.org
devans at macports.org
Tue Sep 17 19:18:42 PDT 2013
Revision: 111270
https://trac.macports.org/changeset/111270
Author: devans at macports.org
Date: 2013-09-17 19:18:42 -0700 (Tue, 17 Sep 2013)
Log Message:
-----------
libpwquality: new port, a library for password quality checking.
Added Paths:
-----------
trunk/dports/devel/libpwquality/
trunk/dports/devel/libpwquality/Portfile
trunk/dports/devel/libpwquality/files/
trunk/dports/devel/libpwquality/files/patch-src-pam_pwquality.c.diff
Added: trunk/dports/devel/libpwquality/Portfile
===================================================================
--- trunk/dports/devel/libpwquality/Portfile (rev 0)
+++ trunk/dports/devel/libpwquality/Portfile 2013-09-18 02:18:42 UTC (rev 111270)
@@ -0,0 +1,72 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem 1.0
+
+name libpwquality
+version 1.2.3
+license LGPL-2.1+
+categories devel
+maintainers nomaintainer
+description A library for password quality checking and \
+ the generation of random passwords that \
+ pass the checks.
+
+long_description ${description}
+
+platforms darwin
+
+homepage https://fedorahosted.org/${name}/
+master_sites https://fedorahosted.org/releases/l/i/${name}/
+
+use_bzip2 yes
+
+checksums rmd160 e98ace88997f9cd0806acb7492b418835b9cb56f \
+ sha256 b11c79ce7b03cdf878fccb653e67bd430155cc6fd224efbbb3e78842f752516a
+
+depends_build port:pkgconfig
+
+depends_lib port:gettext \
+ port:libiconv \
+ port:cracklib
+
+patchfiles patch-src-pam_pwquality.c.diff
+
+configure.ldflags-append \
+ -lintl
+
+configure.args --with-securedir=/usr/lib/pam \
+ --with-sconfigdir=/etc/security
+
+# installs PAM modules in /usr/lib/pam
+
+destroot.violate_mtree yes
+
+variant python26 conflicts python27 description {Use python 2.6} {
+ set python_ver 2.6
+ depends_lib-append port:python26
+ configure.python ${prefix}/bin/python${python_ver}
+ set python_prefix ${frameworks_dir}/Python.framework/Versions/${python_ver}
+ set python_site_path ${python_prefix}/lib/python${python_ver}/site-packages
+ configure.args-append --with-python-rev=${python_ver} \
+ --with-pythonsitedir=${python_site_path}
+}
+
+variant python27 conflicts python26 description {Use python 2.7} {
+ set python_ver 2.7
+ depends_lib-append port:python27
+ configure.python ${prefix}/bin/python${python_ver}
+ set python_prefix ${frameworks_dir}/Python.framework/Versions/${python_ver}
+ set python_site_path ${python_prefix}/lib/python${python_ver}/site-packages
+ configure.args-append --with-python-rev=${python_ver} \
+ --with-pythonsitedir=${python_site_path}
+}
+
+if {![variant_isset python26]} {
+ default_variants +python27
+}
+
+livecheck.type regex
+livecheck.url ${master_sites}
+livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
+
Property changes on: trunk/dports/devel/libpwquality/Portfile
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/dports/devel/libpwquality/files/patch-src-pam_pwquality.c.diff
===================================================================
--- trunk/dports/devel/libpwquality/files/patch-src-pam_pwquality.c.diff (rev 0)
+++ trunk/dports/devel/libpwquality/files/patch-src-pam_pwquality.c.diff 2013-09-18 02:18:42 UTC (rev 111270)
@@ -0,0 +1,117 @@
+--- src/pam_pwquality.c.orig 2012-12-19 08:39:35.000000000 -0800
++++ src/pam_pwquality.c 2013-09-16 16:05:45.000000000 -0700
+@@ -37,8 +37,16 @@
+ #define PAM_SM_PASSWORD
+
+ #include <security/pam_modules.h>
++#ifdef __APPLE__
++#include <security/pam_constants.h>
++#include <security/pam_appl.h>
++
++#define pam_syslog(pamh, priority, fmt, args...) pam_error(pamh, fmt, ## args)
++
++#else
+ #include <security/_pam_macros.h>
+ #include <security/pam_ext.h>
++#endif
+
+ /* argument parsing */
+ #define PAM_DEBUG_ARG 0x0001
+@@ -81,7 +89,11 @@
+ if (!strcmp(*argv, "debug"))
+ ctrl |= PAM_DEBUG_ARG;
+ else if (!strncmp(*argv, "type=", 5))
++#ifdef __APPLE__
++ pam_set_item (pamh, PAM_AUTHTOK, *argv+5);
++#else
+ pam_set_item (pamh, PAM_AUTHTOK_TYPE, *argv+5);
++#endif
+ else if (!strncmp(*argv, "retry=", 6)) {
+ opt->retry_times = strtol(*argv+6, &ep, 10);
+ if (!ep || (opt->retry_times < 1))
+@@ -123,14 +135,23 @@
+ FILE *fp;
+ int errn;
+
++#ifdef __APPLE__
++ setpwent();
++#else
+ fp = fopen(PATH_PASSWD, "r");
+ if (fp == NULL) {
+ pam_syslog(pamh, LOG_ERR, "unable to open %s: %s",
+ PATH_PASSWD, pam_strerror(pamh, errno));
+ return -1;
+ }
+-
++#endif
+ for (;;) {
++#ifdef __APPLE__
++ errno = 0;
++ pwp = getpwent();
++ if (errno != 0)
++ break;
++#else
+ errn = fgetpwent_r(fp, &pw, buf, sizeof (buf), &pwp);
+ if (errn == ERANGE) {
+ pam_syslog(pamh, LOG_WARNING, "%s contains very long lines; corrupted?",
+@@ -140,15 +161,20 @@
+ }
+ if (errn != 0)
+ break;
++#endif
+ if (strcmp(pwp->pw_name, user) == 0) {
+ found = 1;
+ break;
+ }
+ }
+
++#ifdef __APPLE__
++ if (errno != 0 && errno != ENOENT) {
++#else
+ fclose (fp);
+
+ if (errn != 0 && errn != ENOENT) {
++#endif
+ pam_syslog(pamh, LOG_ERR, "unable to enumerate local accounts: %s",
+ pam_strerror(pamh, errn));
+ return -1;
+@@ -206,6 +232,15 @@
+
+ tries++;
+
++#ifdef __APPLE__
++ /* Planned modus operandi:
++ * Get a passwd.
++ * Verify it against libpwquality.
++ * If okay set PAM_AUTHTOK and return
++ */
++
++ retval = pam_get_authtok(pamh, PAM_AUTHTOK, &newtoken, NULL);
++#else
+ /* Planned modus operandi:
+ * Get a passwd.
+ * Verify it against libpwquality.
+@@ -215,6 +250,7 @@
+ */
+
+ retval = pam_get_authtok_noverify(pamh, &newtoken, NULL);
++#endif
+ if (retval != PAM_SUCCESS) {
+ pam_syslog(pamh, LOG_ERR, "pam_get_authtok_noverify returned error: %s",
+ pam_strerror(pamh, retval));
+@@ -251,6 +287,7 @@
+ pam_syslog(pamh, LOG_DEBUG, "password score: %d", retval);
+ }
+
++#ifndef __APPLE__
+ retval = pam_get_authtok_verify(pamh, &newtoken, NULL);
+ if (retval != PAM_SUCCESS) {
+ pam_syslog(pamh, LOG_ERR, "pam_get_authtok_verify returned error: %s",
+@@ -261,6 +298,7 @@
+ pwquality_free_settings(options.pwq);
+ return PAM_AUTHTOK_ERR;
+ }
++#endif
+
+ pwquality_free_settings(options.pwq);
+ return PAM_SUCCESS;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130917/20697564/attachment-0001.html>
More information about the macports-changes
mailing list