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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guile; Reported by: SeerLite <seerlite@HIDDEN>; dated Tue, 10 May 2022 00:26:01 UTC; Maintainer for guile is bug-guile@HIDDEN.

Message received at 55344 <at> debbugs.gnu.org:


Received: (at 55344) by debbugs.gnu.org; 13 Mar 2023 07:32:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 13 03:32:15 2023
Received: from localhost ([127.0.0.1]:33518 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pbcfG-0002Eh-SY
	for submit <at> debbugs.gnu.org; Mon, 13 Mar 2023 03:32:15 -0400
Received: from giant.ash.relay.mailchannels.net ([23.83.222.68]:62815)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <saad@HIDDEN>) id 1pbZ0n-0003p8-VS
 for 55344 <at> debbugs.gnu.org; Sun, 12 Mar 2023 23:38:15 -0400
X-Sender-Id: dreamhost|x-authsender|saad@HIDDEN
Received: from relay.mailchannels.net (localhost [127.0.0.1])
 by relay.mailchannels.net (Postfix) with ESMTP id 936BF26166C
 for <55344 <at> debbugs.gnu.org>; Mon, 13 Mar 2023 03:38:09 +0000 (UTC)
Received: from pdx1-sub0-mail-a304.dreamhost.com (unknown [127.0.0.6])
 (Authenticated sender: dreamhost)
 by relay.mailchannels.net (Postfix) with ESMTPA id 0B29B2617B7
 for <55344 <at> debbugs.gnu.org>; Mon, 13 Mar 2023 03:38:09 +0000 (UTC)
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1678678689; a=rsa-sha256;
 cv=none;
 b=fSsQc+vOi1Er/EGhUWs4h7C3KPwdlsGpknDYMPa+fNw6sfqLY9YpdvYVmBS0tCR14tfsXg
 UkHiiTntfxK4fjiDl7N2pdtTFcBm/rrU5tv/TLT17o2OhgwRcz4qZjSPApdyvNEBQb7UqT
 dU34a4zuwNtdB1JQa9a4UzpbKOX7EsTw15Va6ZsU/9k3Om+QG01dK9bOqlWX9B8Vh4YPLT
 Wy80QZY620H+gIxRH29pL4kvNDq63wf/N1KSwAqd/XrplCGWqga0IhEuNrlbSu20CsHRN0
 viaonLwvKSZguPee8FfWrg9BXCsRdLVktKnlj3WndnHDNyWp9p+g/nJtKrx0vg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
 d=mailchannels.net; s=arc-2022; t=1678678689;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:dkim-signature;
 bh=ZkSvM5grXBth1EzpMhPPcNEYxZBJU1t+iURvLwrrtwc=;
 b=WgssZEhNVRi5GSSizZblrvk5FKpyRh//UyErESuHdPXLgxw2TAFNj4UqLkL9orWt/4mY6T
 rkWZfT/Lc2NUL9zaHlVet1AUPfF3/uCBzgAXqCO+KuoNTiyopFJLoXIC01I+QZbs8wasyo
 0iDkhluGe1q8b+ZcFSWnLmTD6ZZ7L/uSqRdI8Ebq7U1j8CwOanndzKWWAP05V9gsYgafxN
 G+lYtuwQvFNRDlA/q1uMWa8nmPkdvc9Ddi/iHrkaKlAhxM2NaGmcdQjCDEEhK7DqxUIpt0
 gWcFsfhMRJC311+fy3vmZCfnEN8Ga6xW9fFimhw7QZOOMUYUTuMcLVLKEBAFFQ==
ARC-Authentication-Results: i=1; rspamd-7584d5cf47-mllnq;
 auth=pass smtp.auth=dreamhost smtp.mailfrom=saad@HIDDEN
X-Sender-Id: dreamhost|x-authsender|saad@HIDDEN
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|saad@HIDDEN
X-MailChannels-Auth-Id: dreamhost
X-Hysterical-Quick: 6eb041d329854158_1678678689243_3353758329
X-MC-Loop-Signature: 1678678689242:1498816681
X-MC-Ingress-Time: 1678678689242
Received: from pdx1-sub0-mail-a304.dreamhost.com (pop.dreamhost.com
 [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384)
 by 100.109.138.20 (trex/6.7.2); Mon, 13 Mar 2023 03:38:09 +0000
Received: from [192.168.1.55] (d-146-168-6-225.nh.cpe.atlanticbb.net
 [146.168.6.225])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 (Authenticated sender: saad@HIDDEN)
 by pdx1-sub0-mail-a304.dreamhost.com (Postfix) with ESMTPSA id 4PZj6S56yBz4B
 for <55344 <at> debbugs.gnu.org>; Sun, 12 Mar 2023 20:38:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rhoulam.com;
 s=dreamhost; t=1678678688;
 bh=ZkSvM5grXBth1EzpMhPPcNEYxZBJU1t+iURvLwrrtwc=;
 h=Date:To:Subject:From:Content-Type:Content-Transfer-Encoding;
 b=HVa5XMCaeLd1Nk+hn6bQknyNWJA7/R3Rm+ewOxASGjQU0CwAHBLfDxcnmoIwv+aC2
 OjlZBqzuUW7u8le22JjjBa/8GcmdXvyNlE7gdqozJRZPYnKkRAG0wzL3GnqrwT9QNt
 TA+bCf+qaYvtcsIxf7ZdjkjM2H05Vi1lHKxoZjbw=
Message-ID: <ecb3bd88-f78a-18a9-ec98-addabbc46f59@HIDDEN>
Date: Sun, 12 Mar 2023 23:38:07 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.7.1
To: 55344 <at> debbugs.gnu.org
Subject: ftw thinks readable directories are unreadable if "other" don't have
 read permission
Content-Language: en-US
From: Saad Rhoulam <saad@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 55344
X-Mailman-Approved-At: Mon, 13 Mar 2023 03:32:14 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

I am also experiencing this issue on Guile 3.0.9, guix on Ubuntu 22.04, 
amd64 architecture. It won't descend into a directory unless it has o+rx 
permissions set.




Information forwarded to bug-guile@HIDDEN:
bug#55344; Package guile. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 17 May 2022 16:07:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 17 12:07:34 2022
Received: from localhost ([127.0.0.1]:57727 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nqzjR-0000wz-Uz
	for submit <at> debbugs.gnu.org; Tue, 17 May 2022 12:07:34 -0400
Received: from lists.gnu.org ([209.51.188.17]:57830)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <angryrectangle@HIDDEN>) id 1nqzjQ-0000wq-Nm
 for submit <at> debbugs.gnu.org; Tue, 17 May 2022 12:07:32 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:53060)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <angryrectangle@HIDDEN>)
 id 1nqzjP-0007Vb-8t
 for bug-guile@HIDDEN; Tue, 17 May 2022 12:07:31 -0400
Received: from [37.120.193.124] (port=36722 helo=mail.cock.li)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <angryrectangle@HIDDEN>)
 id 1nqzjN-0008Bp-3W
 for bug-guile@HIDDEN; Tue, 17 May 2022 12:07:30 -0400
User-agent: mu4e 1.6.10; emacs 29.0.50
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cock.li; s=mail;
 t=1652803644; bh=c6vyn1Er9Jx2Yex7BnQNXHdslBO4Fpwplm+EOyXPgyc=;
 h=From:To:Subject:In-Reply-To:Date:From;
 b=Q69La8HK/U3CXqnUaRNHhtNg3mnwbd7PUlZt90GDfxnhQnH//lzPnP64HRdNx8ueX
 VJO+CdyCljhu5doDxG7oNBelKRmlEuFwvEHZsYnXu4Hc2jHCi4/VKq22S+8VIDYQ2c
 X+xOGhciMS68SddinluKnePo6LDg3Tasm8ohL1nZCw19qIHhtuBN7X869TC9bF9p/M
 TyRIQhxxqRi0cTaV4dJDxSIvK7xv9M/pKsmw5BmCL081IzHT4O9fJScVBwh4Job/+C
 A73SMqK7XxLjf5yTxnoGJc7b0UenH1FdwQamFSqBP4IyKlBQxMxEKaKzidMjBEySr3
 M73AJ6ftt1Qvw==
From: angry rectangle <angryrectangle@HIDDEN>
To: bug-guile@HIDDEN
Subject: bug#55344: ftw thinks readable directories are unreadable if
 "other" don't have read permission
In-Reply-To: 19f83bff-144b-f25a-db27-d8f48580897c@HIDDEN
Date: Tue, 17 May 2022 12:03:34 -0400
Message-ID: <87czgcxhvs.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Host-Lookup-Failed: Reverse DNS lookup failed for 37.120.193.124 (failed)
Received-SPF: pass client-ip=37.120.193.124;
 envelope-from=angryrectangle@HIDDEN; helo=mail.cock.li
X-Spam_score_int: -12
X-Spam_score: -1.3
X-Spam_bar: -
X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RDNS_NONE=0.793,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

(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




Information forwarded to bug-guile@HIDDEN:
bug#55344; Package guile. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 10 May 2022 00:25:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 09 20:25:30 2022
Received: from localhost ([127.0.0.1]:59765 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1noDgw-0005Fo-3S
	for submit <at> debbugs.gnu.org; Mon, 09 May 2022 20:25:30 -0400
Received: from lists.gnu.org ([209.51.188.17]:40416)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <seerlite@HIDDEN>) id 1noDgu-0005Ff-Ix
 for submit <at> debbugs.gnu.org; Mon, 09 May 2022 20:25:28 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:53570)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <seerlite@HIDDEN>)
 id 1noDgu-0004Bh-DZ
 for bug-guile@HIDDEN; Mon, 09 May 2022 20:25:28 -0400
Received: from mx.nixnet.email ([94.16.121.167]:60510)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <seerlite@HIDDEN>)
 id 1noDgs-00084x-EI
 for bug-guile@HIDDEN; Mon, 09 May 2022 20:25:28 -0400
Received: from [127.0.0.1] (localhost [127.0.0.1])
 by mx.nixnet.email (Postfix) with ESMTPSA id EED0720026C
 for <bug-guile@HIDDEN>; Mon,  9 May 2022 20:25:21 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nixnet.email;
 s=202002021149; t=1652142322; h=from:from:reply-to:subject:subject:to:to:cc;
 bh=JRNMf+IgCZs43tTDUU7jIre2sftgMeYa8jWZaG6WcFI=;
 b=Tt3V2JeysP7fJEnQyiFX+vGHYqiM5mPGFv6X392hKsmst6/chx9pRz8yzQT9PTr1wi4ABX
 Hu2Q72Udt3bazE2VdNHua9inCA8c/e6ptuXWS08Vg+LRNB4K6gDknT8p9mUzeMp/dWVKO4
 zFbZBHT9+rX8q6Oj9X56aDTpM2C5xKU=
Message-ID: <19f83bff-144b-f25a-db27-d8f48580897c@HIDDEN>
Date: Mon, 9 May 2022 20:25:17 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.9.0
Content-Language: en-US
To: bug-guile@HIDDEN
From: SeerLite <seerlite@HIDDEN>
Subject: ftw thinks readable directories are unreadable if "other" don't have
 read permission
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=94.16.121.167; envelope-from=seerlite@HIDDEN;
 helo=mx.nixnet.email
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

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@HIDDEN 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




Acknowledgement sent to SeerLite <seerlite@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guile@HIDDEN. Full text available.
Report forwarded to bug-guile@HIDDEN:
bug#55344; Package guile. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 13 Mar 2023 07:45:02 UTC

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