From nobody Wed Aug 02 18:53:51 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RGLjn67l4zZgJD; Wed, 2 Aug 2023 18:53:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RGLjX5Hxjz4Xxw; Wed, 2 Aug 2023 18:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691002432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tX1nqb767wAkc+mCA11bvFcSNQY1KORxgHshhxNinCo=; b=TPRab0lAjhUT1I2hEbU6qB8bpdpAQSFEM6Lv9PKrkzfY0sEzsUApfPYfOIFsAnaCgun4uP PdSyw+bHJb0uwiHtcKP8XjIlKHPBUPZ1iGTSYC+BqkSPQ40ZVgSxAXuz1CPH7RdTF4BNbD 2DlqHXZ9adJNDfzFe1Gh20I3TjlldfQXWr6kJViAmUHk4J4E0yFlVScD00epJ9ZR/1OVq7 dClNjFs/ABNmbrF7TJ8zhit4Or3esPX/DSawl0itfo42cYT2AkKlRxun4/v0N0OLER2NJO 3DnCm2LAmO0HjThG6F5GK4jrcPbsNWyOkdXCWvick+vWqXDavt8AUGFlcWXXWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1691002432; a=rsa-sha256; cv=none; b=wIH0jqlklXRomt6V1aWVMA2BkFO6JTv+laIyl2Bo2zOzIak0joJ9vw4SIap1kfKwNQI1vZ Xjp//ehvfeWkYWJmZZwuDq226XZ8/J6nyBl0es44oOhwPRHJSEWeMtbB3gx0hmglpu9EOn /4g9FKvgrk6gaXd2mGJURGc0YeoINvYb2Usng9gsdOWeTxlgvVxJxdK2R3EdfiPmwEUtlI J+ZWr3aIEjRrfWzHsYRRMpg0jDGxyfQPH5/6wYEx9B/EU/iUmrK6ltsGhq5S/Qrd8Q0QP0 zYwMZUxH6x1NGDIaniDBS42L4srGJIOHy1VJ668T/RUFVOAXd/39BgeroGZ5HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691002432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tX1nqb767wAkc+mCA11bvFcSNQY1KORxgHshhxNinCo=; b=BBZQtFgwJ6O9RZQg2Tq6724D9tz5QeINBhSZfE9NmticiaUEoIgEFhbkR4/iTK1MEvMJEd Xaks+SrM1rdKDFRr5WPCS0Kqdta6YseNdaavP8EzXfRBU1S6JJDRuiG8pfC9T+6v1vTD6N rQs3+WNzkTPATgRJ6A5HRXQkw3uzl7AodXd/9wzGu+8cdxmrZDq61mLIYKZq/Lc6qUsBpM Nr4ViNP3KsIhuJbtVfgLygBYIFb8ahYUnhk4zrHLXuEmxxXrrr6xep9IrXZT4K1M4VCGp7 zZDLkSz73UEXnFkQB56Z7u6bjZd5i38HzNyAQqHm2xyLBrUbANgtr9nomfhwmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RGLjX2TcVzVY0; Wed, 2 Aug 2023 18:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 372IrpIe084463; Wed, 2 Aug 2023 18:53:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 372Irpa7084462; Wed, 2 Aug 2023 18:53:51 GMT (envelope-from git) Date: Wed, 2 Aug 2023 18:53:51 GMT Message-Id: <202308021853.372Irpa7084462@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Muhammad Moinur Rahman Subject: git: d9b3e6b67a27 - main - security/pam-pgsql: Fix build List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bofh X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d9b3e6b67a27c5d13cd73b33717dda48b10ce5e9 Auto-Submitted: auto-generated The branch main has been updated by bofh: URL: https://cgit.FreeBSD.org/ports/commit/?id=d9b3e6b67a27c5d13cd73b33717dda48b10ce5e9 commit d9b3e6b67a27c5d13cd73b33717dda48b10ce5e9 Author: Muhammad Moinur Rahman AuthorDate: 2023-08-02 16:53:44 +0000 Commit: Muhammad Moinur Rahman CommitDate: 2023-08-02 18:53:43 +0000 security/pam-pgsql: Fix build Approved by: portmgr (blanket) Sponsored by: The FreeBSD Foundation --- .../pam-pgsql/files/patch-src_backend__pgsql.c | 107 +++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/security/pam-pgsql/files/patch-src_backend__pgsql.c b/security/pam-pgsql/files/patch-src_backend__pgsql.c new file mode 100644 index 000000000000..24cdc4e63fbc --- /dev/null +++ b/security/pam-pgsql/files/patch-src_backend__pgsql.c @@ -0,0 +1,107 @@ +--- src/backend_pgsql.c.orig 2023-08-02 16:34:32 UTC ++++ src/backend_pgsql.c +@@ -1,6 +1,6 @@ + /* + * PAM authentication module for PostgreSQL +- * ++ * + * Based in part on pam_unix.c of FreeBSD. See COPYRIGHT + * for licensing details. + * +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + #include + +@@ -57,7 +58,7 @@ build_conninfo(modopt_t *options) + if(options->port) { + strncat(str, " port=", strlen(" port=")); + strncat(str, options->port, strlen(options->port)); +- } ++ } + if(options->timeout) { + strncat(str, " connect_timeout=", strlen(" connect_timeout=")); + strncat(str, options->timeout, strlen(options->timeout)); +@@ -102,7 +103,7 @@ expand_query (char **command, const char** values, con + char *p, *q, *res; + unsigned int len; + unsigned int nparm=0; +- ++ + if (!query) { + *command = NULL; + return 0; +@@ -121,7 +122,7 @@ expand_query (char **command, const char** values, con + } + } + len++; +- p++; ++ p++; + } + res = malloc (len + 1); + if (!res) { +@@ -181,15 +182,15 @@ expand_query (char **command, const char** values, con + } else *q++ = *p++; + } + *q = 0; +- ++ + *command = res; +- values[nparm] = NULL; ++ values[nparm] = NULL; + return nparm; + } + + /* private: execute query */ + int +-pg_execParam(PGconn *conn, PGresult **res, ++pg_execParam(PGconn *conn, PGresult **res, + const char *query, const char *service, const char *user, const char *passwd, const char *rhost) + { + int nparm = 0; +@@ -197,26 +198,26 @@ pg_execParam(PGconn *conn, PGresult **res, + char *command, *raddr; + struct hostent *hentry; + +- if (!conn) ++ if (!conn) + return PAM_AUTHINFO_UNAVAIL; + bzero(values, sizeof(*values)); +- ++ + raddr = NULL; +- ++ + if(rhost != NULL && (hentry = gethostbyname(rhost)) != NULL) { + /* Make IP string */ + raddr = malloc(INET_ADDRSTRLEN); + inet_ntop(AF_INET, hentry->h_addr_list[0], raddr, INET_ADDRSTRLEN); + } +- ++ + nparm = expand_query(&command, values, query, service, user, passwd, rhost, raddr); +- if (command == NULL) ++ if (command == NULL) + return PAM_AUTH_ERR; +- ++ + *res = PQexecParams(conn, command, nparm, 0, values, 0, 0, 0); + free (command); + free (raddr); +- ++ + if(PQresultStatus(*res) != PGRES_COMMAND_OK && PQresultStatus(*res) != PGRES_TUPLES_OK) { + SYSLOG("PostgreSQL query failed: '%s'", PQresultErrorMessage(*res)); + return PAM_AUTHINFO_UNAVAIL; +@@ -254,7 +255,7 @@ backend_authenticate(const char *service, const char * + return PAM_AUTH_ERR; + + DBGLOG("query: %s", options->query_auth); +- rc = PAM_AUTH_ERR; ++ rc = PAM_AUTH_ERR; + if(pg_execParam(conn, &res, options->query_auth, service, user, passwd, rhost) == PAM_SUCCESS) { + if(PQntuples(res) == 0) { + rc = PAM_USER_UNKNOWN;