Subject: bug#55344: ftw thinks readable directories are unreadable if "other" don't have read permission

From: angry rectangle <[email-masked]>
Date: Tue, 17 May 2022 12:03:34 -0400

(hmm... resending this because it didnt work. hopefully i'm doing it right this time.)

It looks like guile's compiler and optimizer could be replacing the `getuid' and `setuid' calls with constant, compile-time values.

Here is a test I performed:
1. Make directory with 770 owned by root and the `guixbuild' group. When guile is compiled with guix, I think the process is done under one of the guixbuilder<XX> users who have the `guixbuild' group.
2. Run guile under my regular user.
3. Try to `ftw' that directory. ftw detects it as a readable directory and then ends up throwing a "permission denied" error because it's not actually readable.

If I compile guile manually under my regular user and try ftw on a different user, I observe the results that support my conclusion.

System info:
Guile 3.0.8.13-cc455
guix on amd64