From nobody Thu Jun 02 10:23:15 2022 X-Original-To: dev-commits-ports-all@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 92B811B58679; Thu, 2 Jun 2022 10:23:15 +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 4LDMXz3Lzbz3nGf; Thu, 2 Jun 2022 10:23:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654165395; 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=3pTtidYQo27RNidBlN9krr8F1dlQV4AUAzAMJgTfHro=; b=TSGCWvqh0/PKDhZ7PEGDukSrm1XIsMctgjZBaHzNCBzSpkvdCovZXQgls90TxLUNRNzRmF bEWH1xKwjp9kGIttlcSN1J/q6VtgF2iJgM5z8NiyVUNBPTGxW8rlhB2gpP8m3S288eyll6 jiRfw9tdfwOgTMFnxBoXr1LXGFLI/FL7S+W8DfnYIXxQFTgtV4BRhXxlIudZ6UELrJJ/8e 6lO022MD7GwzU9+wDLIYHPPTUGaFdkZ4oKTcDeKDV5BA1dE0Fm9l1domsxaN4EHx6DWhRy CJMeWzY7JClvjMtPixQL9+J8/94S6JpKe6WXaggQd+qOF5J0mCfs/yYabXIqxQ== 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 5298F12661; Thu, 2 Jun 2022 10:23:15 +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 252ANF7Y054035; Thu, 2 Jun 2022 10:23:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 252ANFQx054034; Thu, 2 Jun 2022 10:23:15 GMT (envelope-from git) Date: Thu, 2 Jun 2022 10:23:15 GMT Message-Id: <202206021023.252ANFQx054034@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Ganael LAPLANCHE Subject: git: 3dc1f88bfc2e - main - security/vlock: Fix caca saver module load List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: martymac X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3dc1f88bfc2e3c16e6f223575606f6b551a49588 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654165395; 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=3pTtidYQo27RNidBlN9krr8F1dlQV4AUAzAMJgTfHro=; b=SUPkxCDpVe64KvrH37XEERxC9U4rhGs6lTTL70WDs/rH2sjTHUUjuH7+ZP+13/16ucGrxV wHxqMHUQvCkWn0e7vGaNcbIQRcjFtCNaSE+AU4S8xO2wbYBRz6/xiRvyoVMjVAQt3Z+PDD m8tX8U62sU6wedRzBDOguqVeydi7LzVVBSJwVNsW8wUa27vK3h4uwzMuhEgnKR6au33B0F hJSM6eOnj41fq21k9QPabC6kxmZfxlo8TDfnOu8mUQpHM9VcoKkdhEYSwv045UeVpusB0W tibiHE569o2QM3Bnt5Tzzq3P7kqYe2UnPJlmQVnIP04Gb9i0Zr5mXEkAGqczQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654165395; a=rsa-sha256; cv=none; b=HBMwWIBWXYk0gtNXYo45AVPsXNXIoOxfwFX/VNBlejGMlgHah+dTQ336EVdZT9oQ4GJmXn zS3SLhJ+r2l+avVYKS0WD+T8XYiy05j2J6k2GfDgDXjP5BE7dw/xAMugquDELZo3PNrtMd jWrZCAwoI5443J+k1fPeVco8Aped9FlfdCZque9vpfGSDCqM6SgsgZrd3smm92rze2Vk5L T9NpuBk0AZYtqZamwiKFUgmhLqHRpeS901xc76VyT16fQJ0zQTKxAFJr8TNEhJQ4g7Phf4 ihAYn4PRFNX2HKWrNYJiawsRiEqdyyQkXUwujw1vUxWGtK+Iusc4yHelkTb2Rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by martymac: URL: https://cgit.FreeBSD.org/ports/commit/?id=3dc1f88bfc2e3c16e6f223575606f6b551a49588 commit 3dc1f88bfc2e3c16e6f223575606f6b551a49588 Author: Ganael LAPLANCHE AuthorDate: 2022-06-02 10:22:30 +0000 Commit: Ganael LAPLANCHE CommitDate: 2022-06-02 10:22:30 +0000 security/vlock: Fix caca saver module load While here, fix lib depends for CACASAVER option. --- security/vlock/Makefile | 4 +- security/vlock/files/patch-src-process.c | 71 ++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 2 deletions(-) diff --git a/security/vlock/Makefile b/security/vlock/Makefile index 92c33f25c529..40fb807d494c 100644 --- a/security/vlock/Makefile +++ b/security/vlock/Makefile @@ -2,7 +2,7 @@ PORTNAME= vlock PORTVERSION= 2.2.3 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= security MASTER_SITES= http://cthulhu.c3d2.de/~toidinamai/vlock/archive/ \ LOCAL/martymac @@ -31,7 +31,7 @@ ROOTPWD_DESC= Enable unlock using root password ROOTPWD_CONFIGURE_ENABLE= root-password VLOCKSCRIPTS_DESC= Install sample hook scripts CACASAVER_DESC= Enable libcaca screensaver -CACASAVER_BUILD_DEPENDS= ${LOCALBASE}/lib/libcaca.a:graphics/libcaca +CACASAVER_LIB_DEPENDS= libcaca.so:graphics/libcaca # Default scripts/modules VLOCKSCRIPTS= diff --git a/security/vlock/files/patch-src-process.c b/security/vlock/files/patch-src-process.c new file mode 100644 index 000000000000..8414706fb7ae --- /dev/null +++ b/security/vlock/files/patch-src-process.c @@ -0,0 +1,71 @@ +Work around FD_ISSET() accessing an invalid address + +and preventing modules such as caca.so to load sucessfully: + +# gdb /usr/local/sbin/vlock-main +(gdb) set args caca +(gdb) set environment VLOCK_TIMEOUT=2 +(gdb) set follow-fork-mode child +(gdb) run +Thread 2.1 received signal SIGBUS, Bus error. +Object-specific hardware error. +[Switching to LWP 100235 of process 83087] +0x00000000002075b0 in close_fds (except_fds=0x7fffffffe668) at src/process.c:125 +125 if (!FD_ISSET(fd, except_fds)) +(gdb) p fd +$1 = 52416 + +--- src/process.c.orig 2011-09-18 15:22:35 UTC ++++ src/process.c +@@ -105,27 +105,6 @@ void ensure_death(pid_t pid) + (void) waitpid(pid, &status, 0); + } + +-/* Close all possibly open file descriptors except the ones specified in the +- * given set. */ +-static void close_fds(fd_set *except_fds) +-{ +- struct rlimit r; +- int maxfd; +- +- /* Get the maximum number of file descriptors. */ +- if (getrlimit(RLIMIT_NOFILE, &r) == 0) +- maxfd = r.rlim_cur; +- else +- /* Hopefully safe default. */ +- maxfd = 1024; +- +- /* Close all possibly open file descriptors except STDIN_FILENO, +- * STDOUT_FILENO and STDERR_FILENO. */ +- for (int fd = 0; fd < maxfd; fd++) +- if (!FD_ISSET(fd, except_fds)) +- (void) close(fd); +-} +- + static int open_devnull(void) + { + static int devnull_fd = -1; +@@ -175,8 +154,6 @@ bool create_child(struct child_process *child) + + if (child->pid == 0) { + /* Child. */ +- fd_set except_fds; +- + if (child->stdin_fd == REDIRECT_PIPE) + (void) dup2(stdin_pipe[0], STDIN_FILENO); + else if (child->stdin_fd == REDIRECT_DEV_NULL) +@@ -198,13 +175,7 @@ bool create_child(struct child_process *child) + else if (child->stderr_fd != NO_REDIRECT) + (void) dup2(child->stderr_fd, STDERR_FILENO); + +- FD_ZERO(&except_fds); +- FD_SET(STDIN_FILENO, &except_fds); +- FD_SET(STDOUT_FILENO, &except_fds); +- FD_SET(STDERR_FILENO, &except_fds); +- FD_SET(status_pipe[1], &except_fds); +- +- (void) close_fds(&except_fds); ++ (void) closefrom(status_pipe[1] + 1); + + (void) setgid(getgid()); + (void) setuid(getuid());