From: "Ludovic Courtès" <ludo@gnu.org>
To: Tomas Volf <wolf@wolfsden.cz>
Cc: 66531-done@debbugs.gnu.org
Subject: bug#66531: [PATCH] ftw: Fix getuid-or-false, getgid-or-false macros.
Date: Mon, 29 Jan 2024 14:28:28 +0100 [thread overview]
Message-ID: <87r0i0p8ub.fsf@gnu.org> (raw)
In-Reply-To: <20231013161811.19233-1-wolf@wolfsden.cz> (Tomas Volf's message of "Fri, 13 Oct 2023 18:18:11 +0200")
Tomas Volf <wolf@wolfsden.cz> 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!
prev parent reply other threads:[~2024-01-29 13:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-13 16:18 bug#66531: [PATCH] ftw: Fix getuid-or-false, getgid-or-false macros Tomas Volf
2023-10-13 17:30 ` Mike Gran via Bug reports for GUILE, GNU's Ubiquitous Extension Language
2023-10-13 18:20 ` Tomas Volf
2023-10-25 14:01 ` Mike Gran via Bug reports for GUILE, GNU's Ubiquitous Extension Language
2023-11-29 16:11 ` Tomas Volf
2024-01-16 12:40 ` bug#66531: [PATCH] ftw: Fix getuid-or-false, getgid-or-false macros., bug#66531: [PATCH] ftw: Fix getuid-or-false, getgid-or-false macros., control message for bug #66531 Tomas Volf
2024-01-29 13:28 ` Ludovic Courtès [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r0i0p8ub.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=66531-done@debbugs.gnu.org \
--cc=wolf@wolfsden.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).