diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2010-03-15 18:08:48 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2010-03-15 18:08:48 +0000 |
commit | d7d5c4545506879982b32aace87185f02abc71c2 (patch) | |
tree | ec1dfc6a63efecb1fa705c48438cf3dd019c7452 /sys-auth | |
parent | Version bump (diff) | |
download | gentoo-2-d7d5c4545506879982b32aace87185f02abc71c2.tar.gz gentoo-2-d7d5c4545506879982b32aace87185f02abc71c2.tar.bz2 gentoo-2-d7d5c4545506879982b32aace87185f02abc71c2.zip |
Add a patch to fix bug #309311, thanks to Giampaolo Tomassoni for reporting.
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'sys-auth')
-rw-r--r-- | sys-auth/pam-pgsql/ChangeLog | 10 | ||||
-rw-r--r-- | sys-auth/pam-pgsql/files/pam-pgsql-0.7_p20100311-bug309311.patch | 41 | ||||
-rw-r--r-- | sys-auth/pam-pgsql/pam-pgsql-0.7_p20100311-r1.ebuild (renamed from sys-auth/pam-pgsql/pam-pgsql-0.7_p20100311.ebuild) | 13 |
3 files changed, 61 insertions, 3 deletions
diff --git a/sys-auth/pam-pgsql/ChangeLog b/sys-auth/pam-pgsql/ChangeLog index 0c2b525829b5..b3f939109efd 100644 --- a/sys-auth/pam-pgsql/ChangeLog +++ b/sys-auth/pam-pgsql/ChangeLog @@ -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) 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 index 000000000000..07b5f5626414 --- /dev/null +++ b/sys-auth/pam-pgsql/files/pam-pgsql-0.7_p20100311-bug309311.patch @@ -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 + diff --git a/sys-auth/pam-pgsql/pam-pgsql-0.7_p20100311.ebuild b/sys-auth/pam-pgsql/pam-pgsql-0.7_p20100311-r1.ebuild index 1143ff09ae97..c4f65e4d184b 100644 --- a/sys-auth/pam-pgsql/pam-pgsql-0.7_p20100311.ebuild +++ b/sys-auth/pam-pgsql/pam-pgsql-0.7_p20100311-r1.ebuild @@ -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" } |