GNU bug report logs - #55344
ftw thinks readable directories are unreadable if "other" don't have read permission

Previous Next

Package: guile;

Reported by: SeerLite <seerlite <at> nixnet.email>

Date: Tue, 10 May 2022 00:26:01 UTC

Severity: normal

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: SeerLite <seerlite <at> nixnet.email>
To: 55344 <at> debbugs.gnu.org
Subject: bug#55344: ftw thinks readable directories are unreadable if "other" don't have read permission
Date: Mon, 9 May 2022 20:25:17 -0400
ftw incorrectly thinks that if other users don't have the read 
permission then the owner can't read it either. This also affects ntfw.

Guile version: 3.0.8
Machine type: x86_64-pc-linux-gnu
guile <at> 3.0.8 from Guix

To reproduce: Create 2 directories, one with rwxrwxrwx permissions and 
another with rwxrwx---. Then pass them to ftw and notice it won't 
recurse because it thinks they're directory-not-readable.

scheme@(guile-user)> (passwd:uid (getpw (getlogin)))
$1 = 1001
scheme@(guile-user)> (stat:uid (stat "readable-dir"))
$2 = 1001
scheme@(guile-user)> (stat:uid (stat "also-readable-dir"))
$3 = 1001
scheme@(guile-user)> (format #f "~o" (stat:perms (stat "readable-dir")))
$4 = "777"
scheme@(guile-user)> (format #f "~o" (stat:perms (stat 
"also-readable-dir")))
$5 = "770"
scheme@(guile-user)> (stat "readable-dir")
$6 = #(24 61374845 16895 1 1001 998 0 0 1652140343 1652140343 1652141421 
4096 0 directory 511 216530924 216530924 1652141421)
scheme@(guile-user)> (stat "also-readable-dir")
$7 = #(24 61374847 16888 1 1001 998 0 0 1652140345 1652140345 1652141426 
4096 0 directory 504 20542871 20542871 1652141426)
scheme@(guile-user)> (ftw "readable-dir" (lambda (filename statinfo 
flag) (display flag) (newline) #t))
directory
$8 = #t
scheme@(guile-user)> (ftw "also-readable-dir" (lambda (filename statinfo 
flag) (display flag) (newline) #t))directory-not-readable
$9 = #t




This bug report was last modified 1 year and 115 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.