1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00
guile/module
Tomas Volf b6866ded2b
ftw: Fix getuid-or-false, getgid-or-false macros.
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.

Fixes <https://bugs.gnu.org/55344>.

* module/ice-9/ftw.scm (getuid-or-false): Quote the (getuid).
(getgid-or-false): Quote the (getgid).
* NEWS: Update.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-01-29 14:31:01 +01:00
..
ice-9 ftw: Fix getuid-or-false, getgid-or-false macros. 2024-01-29 14:31:01 +01:00
language Recognize append as a primcall and optimize it 2023-11-27 14:30:41 +01:00
oop goops: Preserve all slot options in redefinable classes. 2021-03-19 21:45:53 +01:00
rnrs Implement R6RS custom textual ports 2023-06-08 10:21:02 +02:00
scheme Update set of decimal zeroes for Unicode 15.1.0 2023-11-02 11:31:32 +01:00
scripts Bump user-visible copyright years to 2024. 2024-01-24 10:49:27 +01:00
srfi define-inlinable marks residualized procedure as maybe-unused 2023-08-24 11:43:31 +02:00
sxml Remove unnecessary module imports. 2023-02-24 16:49:00 +01:00
system default-frame-width is a parameter 2024-01-29 10:59:54 +01:00
texinfo Remove unnecessary module imports. 2023-02-24 16:49:00 +01:00
web Use custom binary output ports for make-chunked-output-port 2023-06-08 09:03:10 +02:00
Makefile.am Rework bootstrap to be reproducible 2022-02-01 14:50:40 +01:00
rnrs.scm Define top-level bindings for aux syntax: else, =>, _, ... 2019-09-12 21:50:51 +02:00
statprof.scm Statprof reports primitive names 2020-06-04 11:46:34 +02:00
texinfo.scm texinfo: Add basic support for @w{...}. 2020-06-18 00:30:30 +02:00