Add a patch to fix bug #309311, thanks to Giampaolo Tomassoni for reporting.
authorDiego Elio Pettenò <flameeyes@gentoo.org>
Mon, 15 Mar 2010 18:08:48 +0000 (18:08 +0000)
committerDiego Elio Pettenò <flameeyes@gentoo.org>
Mon, 15 Mar 2010 18:08:48 +0000 (18:08 +0000)
Package-Manager: portage-2.2_rc67/cvs/Linux x86_64

sys-auth/pam-pgsql/ChangeLog
sys-auth/pam-pgsql/Manifest
sys-auth/pam-pgsql/files/pam-pgsql-0.7_p20100311-bug309311.patch [new file with mode: 0644]
sys-auth/pam-pgsql/pam-pgsql-0.7_p20100311-r1.ebuild [moved from sys-auth/pam-pgsql/pam-pgsql-0.7_p20100311.ebuild with 88% similarity]

index 0c2b525829b54885d61ea75bba3cc82e08722aeb..b3f939109efd84a9657835c2e3b0c338292bad72 100644 (file)
@@ -1,6 +1,14 @@
 # ChangeLog for sys-auth/pam-pgsql
 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-auth/pam-pgsql/ChangeLog,v 1.1 2010/03/11 13:53:10 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-auth/pam-pgsql/ChangeLog,v 1.2 2010/03/15 18:08:47 flameeyes Exp $
+
+*pam-pgsql-0.7_p20100311-r1 (15 Mar 2010)
+
+  15 Mar 2010; Diego E. Pettenò <flameeyes@gentoo.org>
+  -pam-pgsql-0.7_p20100311.ebuild, +pam-pgsql-0.7_p20100311-r1.ebuild,
+  +files/pam-pgsql-0.7_p20100311-bug309311.patch:
+  Add a patch to fix bug #309311, thanks to Giampaolo Tomassoni for
+  reporting.
 
 *pam-pgsql-0.7_p20100311 (11 Mar 2010)
 
index 340cc8dc0001bd7eafab0353d66bfe880f590124..6b1c52ac85858d458f969257713a78555c31a438 100644 (file)
@@ -1,14 +1,15 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
+AUX pam-pgsql-0.7_p20100311-bug309311.patch 1661 RMD160 0abea63024293233f7e765c2e37228b1710c061a SHA1 c78d70ff863507f21e12de30d3de9262b1fe68e4 SHA256 25e2b42aae4ba9acb5f06f5eab7f3cb94337750a3cccc87c724f3b55b28a5fe8
 DIST pam-pgsql-0.7_p20100311.tar.gz 304786 RMD160 4b3af2ffc11e9e54790aecfce0726c43b9c750a1 SHA1 6d642277ec0c512e8c1fd3f2ddbcf208816e7c37 SHA256 71594c1af07c8e37f65c15410c5ad8b97a96ae672828ef44b95c7b607401af1d
-EBUILD pam-pgsql-0.7_p20100311.ebuild 1326 RMD160 7da100bdaa82e3f79b56bcfff92110ea8f980442 SHA1 bd7e8a04b36a7367cde5e8fb656077b5ac0608ac SHA256 bff832c690dec713e3602010cca7f55882631928ac574b731931db52a6f697e1
-MISC ChangeLog 523 RMD160 9d15bf8b7314530aa62ec87f7834bc8893f29b7a SHA1 eb09bbfdcd7dcf2393f979fb7eea86c730d1a9c3 SHA256 3b05661d918efd5fdc6157f87e2fa8ac932a10c589ac870e1b956daf3b543d46
+EBUILD pam-pgsql-0.7_p20100311-r1.ebuild 1420 RMD160 3e704b4c0a48e19f42eaf0428b76d9f80d6cec01 SHA1 4e53f957ab6bb738736483f41ac80327a9d4318c SHA256 1f48eeb6bafd7fa3e242a2008238681e687258faf67893650561681af050d504
+MISC ChangeLog 825 RMD160 d76d582041233edd5339d32ab5921e180f4c6e1f SHA1 e186f84eb15b82db1e5cca7832a31be536e87810 SHA256 f7b324445892b8aa8d2e76c9d82e0b520a92b9ac3509bfbf84d4666b93a6a4ee
 MISC metadata.xml 218 RMD160 1955c7446d4ceb77506ba7b58ee35913c576a72c SHA1 02dacc356a39905402083cb54ae4f6dd0ac59fad SHA256 e0bb49cab71cc84d8bdad26876197164073722b378d27a5bf55bbfd2afdbd19c
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.14 (GNU/Linux)
 
-iEYEARECAAYFAkuY9cYACgkQAiZjviIA2XjACwCfeG0PQGuOBedhiPfLAvPEJrLr
-XlcAn3WCtgJdf4PBWzbgCe9vyTXxjSoo
-=hXmB
+iEYEARECAAYFAkued6YACgkQAiZjviIA2XiyEwCgkXrIcge3b02LJmYfcHuvG+he
+RUAAn3/TPXJZ3b99ramPKZc2UCRvEFvB
+=DkPD
 -----END PGP SIGNATURE-----
diff --git a/sys-auth/pam-pgsql/files/pam-pgsql-0.7_p20100311-bug309311.patch b/sys-auth/pam-pgsql/files/pam-pgsql-0.7_p20100311-bug309311.patch
new file mode 100644 (file)
index 0000000..07b5f56
--- /dev/null
@@ -0,0 +1,41 @@
+From 0ced2f84ec8fcf961a1d89df1194634d5f83d4fd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Diego=20Elio=20'Flameeyes'=20Petten=C3=B2?= <flameeyes@gmail.com>
+Date: Mon, 15 Mar 2010 18:51:50 +0100
+Subject: [PATCH] Correct the check for expected values returned by the acct query.
+
+The current code checked for at least two rows and at most three columns,
+while the correct check was to be one row, and between two and three
+columns.
+
+This was reported by Gianpaolo Tomassoni in Gentoo bug #309311
+http://bugs.gentoo.org/show_bug.cgi?id=309311
+---
+ src/pam_pgsql.c |    5 +++--
+ 1 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/pam_pgsql.c b/src/pam_pgsql.c
+index 5a31ac1..8126b79 100644
+--- a/src/pam_pgsql.c
++++ b/src/pam_pgsql.c
+@@ -129,7 +129,8 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int flags, int argc,
+                                       DBGLOG("query: %s", options->query_acct);
+                                       rc = PAM_AUTH_ERR;
+                                       if(pg_execParam(conn, &res, options->query_acct, pam_get_service(pamh), user, NULL, rhost) == PAM_SUCCESS) {
+-                                              if (PQntuples(res) >= 2 && PQnfields(res) <= 3) {
++                                              if (PQntuples(res) == 1 &&
++                                                  PQnfields(res) >= 2 && PQnfields(res) <= 3) {
+                                                       char *expired_db = PQgetvalue(res, 0, 0);
+                                                       char *newtok_db = PQgetvalue(res, 0, 1);
+                                                       rc = PAM_SUCCESS;
+@@ -143,7 +144,7 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int flags, int argc,
+                                                       if (!strcmp(expired_db, "t"))
+                                                               rc = PAM_ACCT_EXPIRED;
+                                               } else {
+-                                                      DBGLOG("query_acct should return two or three columns");
++                                                      DBGLOG("query_acct should return one row and two or three columns");
+                                                       rc = PAM_PERM_DENIED;
+                                               }
+                                               PQclear(res);
+-- 
+1.7.0.2
+
similarity index 88%
rename from sys-auth/pam-pgsql/pam-pgsql-0.7_p20100311.ebuild
rename to sys-auth/pam-pgsql/pam-pgsql-0.7_p20100311-r1.ebuild
index 1143ff09ae972ee01532ecdbc40cd206875b2ed9..c4f65e4d184b6b3b1666a79acdd7fab207561f2e 100644 (file)
@@ -1,6 +1,8 @@
 # Copyright 1999-2010 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-auth/pam-pgsql/pam-pgsql-0.7_p20100311.ebuild,v 1.1 2010/03/11 13:53:10 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-auth/pam-pgsql/pam-pgsql-0.7_p20100311-r1.ebuild,v 1.1 2010/03/15 18:08:47 flameeyes Exp $
+
+EAPI=2
 
 inherit eutils pam
 
@@ -23,11 +25,18 @@ IUSE=""
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
 
-src_compile() {
+src_prepare() {
+       epatch "${FILESDIR}"/${P}-bug309311.patch
+}
+
+src_configure() {
        econf \
                --sysconfdir=/etc/security \
                --libdir=/$(get_libdir) \
                --docdir=/usr/share/doc/${PF} || die "econf failed"
+}
+
+src_compile() {
        emake pammoddir="$(getpam_mod_dir)" || die "emake failed"
 }