From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Newsgroups: gmane.lisp.guile.bugs Subject: bug#66531: [PATCH] ftw: Fix getuid-or-false, getgid-or-false macros. Date: Mon, 29 Jan 2024 14:28:28 +0100 Message-ID: <87r0i0p8ub.fsf@gnu.org> References: <20231013161811.19233-1-wolf@wolfsden.cz> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3361"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 66531-done@debbugs.gnu.org To: Tomas Volf Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Mon Jan 29 14:30:10 2024 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rURiE-0000ax-Br for guile-bugs@m.gmane-mx.org; Mon, 29 Jan 2024 14:30:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rURhz-0004Ql-Q0; Mon, 29 Jan 2024 08:29:55 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rURhy-0004QJ-09 for bug-guile@gnu.org; Mon, 29 Jan 2024 08:29:54 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rURhx-0006Cr-Nv for bug-guile@gnu.org; Mon, 29 Jan 2024 08:29:53 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rURi5-0003fk-Vh for bug-guile@gnu.org; Mon, 29 Jan 2024 08:30:01 -0500 Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-To: bug-guile@gnu.org Resent-Date: Mon, 29 Jan 2024 13:30:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 66531 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch Mail-Followup-To: 66531@debbugs.gnu.org, ludo@gnu.org, ~@wolfsden.cz Original-Received: via spool by 66531-done@debbugs.gnu.org id=D66531.170653494814002 (code D ref 66531); Mon, 29 Jan 2024 13:30:01 +0000 Original-Received: (at 66531-done) by debbugs.gnu.org; 29 Jan 2024 13:29:08 +0000 Original-Received: from localhost ([127.0.0.1]:59312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rURhE-0003dm-BH for submit@debbugs.gnu.org; Mon, 29 Jan 2024 08:29:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rURhC-0003dE-NI for 66531-done@debbugs.gnu.org; Mon, 29 Jan 2024 08:29:07 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rURgt-0005py-Cx; Mon, 29 Jan 2024 08:28:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=Yrry/7cVioTvhBpnISdD8VcMRv+2z7m/Ugh5xF0p2uA=; b=ehG1OQ7/AtgmI7zuvYeY 65M46TiRKchKMuUJ49WyE7VP6dYONIRH0vz8pmPSyD6eetvvwcERa32t55BcD2pjzwFAdN8k8MX6D 0RQr9Gx1rnzd8+UERLej3wSX0wxl/MLKIH4hzKEvvBht/iYydyUIn7P9Xhieq9iPoEf7pDLVsMMl/ 3omvggNsJR7EwAvqfqqAdurYnlQ77rUfAwqkqTxSeKpZPJ03HuLmmtrSM0r9fQoqXVcdSArdDR7uX Nd9LjdfbWsemEKYqn1dhZqwuO2PhV4ZjbfOLSlQf3L0NXEvw3c9yRbQoAeh4FOOZaOiKIi08LVzxw zTSTGvt57Ayx4A==; In-Reply-To: <20231013161811.19233-1-wolf@wolfsden.cz> (Tomas Volf's message of "Fri, 13 Oct 2023 18:18:11 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:10774 Archived-At: Tomas Volf skribis: > Both macros were missing a quote for the procedure call, causing the > actual return value to be compiled into the ftw.go, instead of the > procedure call. Snippet from disassembly of ftw.go does confirm that: > > 55 (make-immediate 2 3990) ;; 997 at ice-9/ftw.scm:319:46 > 56 (make-long-immediate 1 120002) ;; 30000 at ice-9/ftw.scm:320:46 > > That effectively prevented ftw from entering directories without access > for others. Simple reproduction: > > scheme@(guile-user)> ,use (ice-9 ftw) > scheme@(guile-user)> (mkdir "/tmp/xxxx") > scheme@(guile-user)> (chmod "/tmp/xxxx" #o0700) > scheme@(guile-user)> (ftw "/tmp/xxxx" (lambda (_ __ f) (pk f) #t)) > > ;;; (directory-not-readable) > $1 = #t > scheme@(guile-user)> (system "ls -al /tmp/xxxx") > total 0 > drwx------ 1 wolf wolf 0 Oct 11 22:54 . > drwxrwxrwt 1 root root 888 Oct 11 22:54 .. > $2 = 0 > > The fix is to quote the procedure call, leading to the intended > behavior. > > This fixes bug 55344. > > * module/ice-9/ftw.scm (getuid-or-false): Quote the (getuid). > (getgid-or-false): Quote the (getgid). Applied, thanks!