public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in sys-auth/pam-pgsql/files: pam-pgsql-0.7_p20100311-bug309311.patch
@ 2010-03-15 18:08 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 2+ messages in thread
From: Diego Petteno (flameeyes) @ 2010-03-15 18:08 UTC (permalink / raw
  To: gentoo-commits

flameeyes    10/03/15 18:08:48

  Added:                pam-pgsql-0.7_p20100311-bug309311.patch
  Log:
  Add a patch to fix bug #309311, thanks to Giampaolo Tomassoni for reporting.
  (Portage version: 2.2_rc67/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  sys-auth/pam-pgsql/files/pam-pgsql-0.7_p20100311-bug309311.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-auth/pam-pgsql/files/pam-pgsql-0.7_p20100311-bug309311.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-auth/pam-pgsql/files/pam-pgsql-0.7_p20100311-bug309311.patch?rev=1.1&content-type=text/plain

Index: pam-pgsql-0.7_p20100311-bug309311.patch
===================================================================
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







^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] gentoo-x86 commit in sys-auth/pam-pgsql/files: pam-pgsql-0.7_p20100311-bug309311.patch
@ 2010-03-16 11:56 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 2+ messages in thread
From: Diego Petteno (flameeyes) @ 2010-03-16 11:56 UTC (permalink / raw
  To: gentoo-commits

flameeyes    10/03/16 11:56:17

  Removed:              pam-pgsql-0.7_p20100311-bug309311.patch
  Log:
  Bump to upstream released version.
  (Portage version: 2.2_rc67/cvs/Linux x86_64)



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-16 11:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-15 18:08 [gentoo-commits] gentoo-x86 commit in sys-auth/pam-pgsql/files: pam-pgsql-0.7_p20100311-bug309311.patch Diego Petteno (flameeyes)
  -- strict thread matches above, loose matches on Subject: below --
2010-03-16 11:56 Diego Petteno (flameeyes)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox