aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Turgeon <ericbsd@FreeBSD.org>2022-01-19 11:56:09 +0000
committerEric Turgeon <ericbsd@FreeBSD.org>2022-01-19 11:58:48 +0000
commit52d8ef3c4f5758c726f17f44b41b8948c9023e05 (patch)
treed8031dd13ceb8a9d3c7a68e1b4e1971b5cdc8556
parent8ea3b916eaf6678ae7ed57cb8706ebc720011da0 (diff)
downloadports-52d8ef3c4f5758c726f17f44b41b8948c9023e05.tar.gz
ports-52d8ef3c4f5758c726f17f44b41b8948c9023e05.zip
x11/mate-screensaver: changed helper
I replaced the pam_helper with the mate-pam-helper.
-rw-r--r--x11/mate-screensaver/Makefile6
-rw-r--r--x11/mate-screensaver/files/patch-src_Makefile.am11
-rw-r--r--x11/mate-screensaver/files/patch-src_gs-auth-helper.c211
3 files changed, 14 insertions, 214 deletions
diff --git a/x11/mate-screensaver/Makefile b/x11/mate-screensaver/Makefile
index 3ca02330cdfd..5c490d3752a8 100644
--- a/x11/mate-screensaver/Makefile
+++ b/x11/mate-screensaver/Makefile
@@ -2,7 +2,7 @@
PORTNAME= mate-screensaver
PORTVERSION= 1.26.1
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= x11 mate
MASTER_SITES= MATE
DIST_SUBDIR= mate
@@ -42,9 +42,9 @@ OPTIONS_DEFINE= PAM
OPTIONS_DEFAULT=PAM
OPTIONS_SUB= yes
-PAM_RUN_DEPENDS= pam_helper:security/pam_helper
+PAM_RUN_DEPENDS= mate_pam_helper:security/mate-pam-helper
PAM_CONFIGURE_ON= --enable-authentication-scheme=helper \
- --with-passwd-helper=${LOCALBASE}/bin/pam_helper
+ --with-passwd-helper=${LOCALBASE}/bin/mate_pam_helper
PAM_CONFIGURE_OFF= --disable-pam
.include <bsd.port.options.mk>
diff --git a/x11/mate-screensaver/files/patch-src_Makefile.am b/x11/mate-screensaver/files/patch-src_Makefile.am
new file mode 100644
index 000000000000..a282de71c749
--- /dev/null
+++ b/x11/mate-screensaver/files/patch-src_Makefile.am
@@ -0,0 +1,11 @@
+--- src/Makefile.am.orig 2022-01-18 23:58:33 UTC
++++ src/Makefile.am
+@@ -172,7 +172,7 @@ if HAVE_PASSWD_HELPER
+ mate_screensaver_dialog_LDADD += \
+ ../helper/libhelper-proto.a
+ ../helper/libhelper-proto.a:
+- $(MAKE) -C ../helper
++ $(MAKE) -C ../helper libhelper-proto.a
+ endif
+
+ BUILT_SOURCES = \
diff --git a/x11/mate-screensaver/files/patch-src_gs-auth-helper.c b/x11/mate-screensaver/files/patch-src_gs-auth-helper.c
deleted file mode 100644
index df40c211e3aa..000000000000
--- a/x11/mate-screensaver/files/patch-src_gs-auth-helper.c
+++ /dev/null
@@ -1,211 +0,0 @@
---- 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