From nobody Sat Jan 01 01:35:03 2022 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 87869192933D; Sat, 1 Jan 2022 01:35:04 +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 4JQl1h1wLNz3Njc; Sat, 1 Jan 2022 01:35:04 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 1EA2216214; Sat, 1 Jan 2022 01:35:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2011Z3Np034284; Sat, 1 Jan 2022 01:35:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2011Z33h034283; Sat, 1 Jan 2022 01:35:03 GMT (envelope-from git) Date: Sat, 1 Jan 2022 01:35:03 GMT Message-Id: <202201010135.2011Z33h034283@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Eric Turgeon Subject: git: 9d56cc6b40e2 - main - x11/mate-screensaver: Fix helper option 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: ericbsd X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d56cc6b40e2694687d6c22c46bcf64cd43b2d81 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641000904; 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=zfVX4zQU2g9yEGLPkgHVAex72qLL10XmO5R7JgXSJGw=; b=lV4mMLPQmJQTH/27wXM1RqiupkGXx5MC3zP69/6Hm0TkMMd+TKw4Ci4kg8rKm0yER0EGzH eWEzG1NphFYsllGbZnWHWAgfX5xv3/wo6OwscpWndEbH2+Xv5ERp1dHHYM8lGLy/kD++T3 Vo7PMKzC+Bk/qiNAcwi5ldtlesRMq1JpxjyHh6ojSWcyex8oZKqAPUOsn2ZFBxl0QbHtEn Sy8FT0yoB0jWO/CpXz+QTehtnaxEFIt3Qyg8+05ottC44YPN+NsXxTfdBMVPMZdV++mptF EA/TYRFFOHeTfD5I4V/SL3Z3nd2MokeiJ3VwugMfhf0dnw00Zsy8sOfijXZB1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641000904; a=rsa-sha256; cv=none; b=Sznd5jJTPggVVqPww/3IfPphKh7yV2dX8S7P/WVg5UQE+8ebFVJE8Y2usAMxJhtbnVLRaF r9WYv9zEXlI1r8D+G4C9cOSQm726bukwvTWr1GLI88VlxD8RC9MFf0TXx67pufBP3ryzDe PBTjryrL79aBfLgikGZwlwcO3Rcb1gnHeuaBLDVBRql3fdiWHmP6k1db2u3UyaWuJEMCZn RKZwZdIdEQXBG5aOtMJDnZh1AcD3QEomf09V81He1sxDAwpPoHYWYob9fPBNuBZ025xEHq M+1TIqTMAJxo9Fa+0zI3cTc4gj7yDDnEPxMTxnnst7ouXxnMxS80YN2VqshoPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ericbsd: URL: https://cgit.FreeBSD.org/ports/commit/?id=9d56cc6b40e2694687d6c22c46bcf64cd43b2d81 commit 9d56cc6b40e2694687d6c22c46bcf64cd43b2d81 Author: Eric Turgeon AuthorDate: 2022-01-01 00:11:27 +0000 Commit: Eric Turgeon CommitDate: 2022-01-01 01:34:53 +0000 x11/mate-screensaver: Fix helper option This patch revert changes that broke --enable-authentication-scheme and --with-passwd-helper PR: 260811 Reported by: Tomoaki AOKI --- x11/mate-screensaver/Makefile | 1 + .../files/patch-src_gs-auth-helper.c | 211 +++++++++++++++++++++ 2 files changed, 212 insertions(+) diff --git a/x11/mate-screensaver/Makefile b/x11/mate-screensaver/Makefile index b798061a496d..3ca02330cdfd 100644 --- a/x11/mate-screensaver/Makefile +++ b/x11/mate-screensaver/Makefile @@ -2,6 +2,7 @@ PORTNAME= mate-screensaver PORTVERSION= 1.26.1 +PORTREVISION= 1 CATEGORIES= x11 mate MASTER_SITES= MATE DIST_SUBDIR= mate diff --git a/x11/mate-screensaver/files/patch-src_gs-auth-helper.c b/x11/mate-screensaver/files/patch-src_gs-auth-helper.c new file mode 100644 index 000000000000..df40c211e3aa --- /dev/null +++ b/x11/mate-screensaver/files/patch-src_gs-auth-helper.c @@ -0,0 +1,211 @@ +--- src/gs-auth-helper.c.orig 2021-12-31 23:57:08 UTC ++++ src/gs-auth-helper.c +@@ -51,9 +51,6 @@ + #include "gs-auth.h" + #include "subprocs.h" + +-#include "../helper/helper_proto.h" +-#define MAXLEN 1024 +- + static gboolean verbose_enabled = FALSE; + + GQuark +@@ -82,105 +79,85 @@ gs_auth_get_verbose (void) + + static gboolean + ext_run (const char *user, +- GSAuthMessageFunc func, +- gpointer data) ++ const char *typed_passwd, ++ gboolean verbose) + { +- int pfd[2], r_pfd[2], status; +- pid_t pid; +- gboolean verbose = gs_auth_get_verbose (); ++ int pfd[2], status; ++ pid_t pid; + +- if (pipe (pfd) < 0 || pipe (r_pfd) < 0) +- { +- return FALSE; +- } ++ if (pipe (pfd) < 0) ++ { ++ return 0; ++ } + +- if (verbose) +- { +- g_message ("ext_run (%s, %s)", +- PASSWD_HELPER_PROGRAM, user); +- } ++ if (verbose) ++ { ++ g_message ("ext_run (%s, %s)", ++ PASSWD_HELPER_PROGRAM, user); ++ } + +- block_sigchld (); ++ block_sigchld (); + +- if ((pid = fork ()) < 0) +- { +- close (pfd [0]); +- close (pfd [1]); +- close (r_pfd [0]); +- close (r_pfd [1]); +- return FALSE; +- } ++ if ((pid = fork ()) < 0) ++ { ++ close (pfd [0]); ++ close (pfd [1]); ++ return FALSE; ++ } + +- if (pid == 0) +- { +- close (pfd [1]); +- close (r_pfd [0]); +- if (pfd [0] != 0) +- { +- dup2 (pfd [0], 0); +- } +- if (r_pfd [1] != 1) +- { +- dup2 (r_pfd [1], 1); +- } ++ if (pid == 0) ++ { ++ close (pfd [1]); ++ if (pfd [0] != 0) ++ { ++ dup2 (pfd [0], 0); ++ } + +- /* Helper is invoked as helper service-name [user] */ +- execlp (PASSWD_HELPER_PROGRAM, PASSWD_HELPER_PROGRAM, "mate-screensaver", user, NULL); +- if (verbose) +- { +- g_message ("%s: %s", PASSWD_HELPER_PROGRAM, g_strerror (errno)); +- } ++ /* Helper is invoked as helper service-name [user] */ ++ execlp (PASSWD_HELPER_PROGRAM, PASSWD_HELPER_PROGRAM, "mate-screensaver", user, NULL); ++ if (verbose) ++ { ++ g_message ("%s: %s", PASSWD_HELPER_PROGRAM, g_strerror (errno)); ++ } + +- exit (1); +- } ++ exit (1); ++ } + +- close (pfd [0]); +- close (r_pfd [1]); ++ close (pfd [0]); + +- gboolean ret = FALSE; +- while (waitpid (pid, &status, WNOHANG) == 0) +- { +- int msg_type; +- char buf[MAXLEN]; +- size_t msg_len = MAXLEN; ++ /* Write out password to helper process */ ++ if (!typed_passwd) ++ { ++ typed_passwd = ""; ++ } ++ write (pfd [1], typed_passwd, strlen (typed_passwd)); ++ close (pfd [1]); + +- msg_type = read_prompt (r_pfd [0], buf, &msg_len); +- if (0 == msg_type) continue; +- if (msg_type < 0) +- { +- g_message ("Error reading prompt (%d)", msg_type); +- ret = FALSE; +- goto exit; +- } ++ while (waitpid (pid, &status, 0) < 0) ++ { ++ if (errno == EINTR) ++ { ++ continue; ++ } + +- char *input = NULL; +- func (msg_type, buf, &input, data); ++ if (verbose) ++ { ++ g_message ("ext_run: waitpid failed: %s\n", ++ g_strerror (errno)); ++ } + +- unsigned int input_len = input ? strlen (input) : 0; +- ssize_t wt; ++ unblock_sigchld (); ++ return FALSE; ++ } + +- wt = write_msg (pfd [1], input, input_len); +- if (wt < 0) +- { +- g_message ("Error writing prompt reply (%li)", wt); +- ret = FALSE; +- goto exit; +- } +- } ++ unblock_sigchld (); + +- close (pfd [1]); +- close (r_pfd [0]); +- unblock_sigchld (); ++ if (! WIFEXITED (status) || WEXITSTATUS (status) != 0) ++ { ++ return FALSE; ++ } + +- if (! WIFEXITED (status) || WEXITSTATUS (status) != 0) +- { +- ret = FALSE; +- } +- else +- ret = TRUE; +- +- exit: +- return ret; ++ return TRUE; + } + + gboolean +@@ -190,7 +167,28 @@ gs_auth_verify_user (const char *username, + gpointer data, + GError **error) + { +- return ext_run (username, func, data); ++ gboolean res = FALSE; ++ char *password; ++ ++ password = NULL; ++ ++ /* ask for the password for user */ ++ if (func != NULL) ++ { ++ func (GS_AUTH_MESSAGE_PROMPT_ECHO_OFF, ++ "Password: ", ++ &password, ++ data); ++ } ++ ++ if (password == NULL) ++ { ++ return FALSE; ++ } ++ ++ res = ext_run (username, password, gs_auth_get_verbose ()); ++ ++ return res; + } + + gboolean