From unknown Fri Jun 20 07:11:37 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#8570 <8570@debbugs.gnu.org> To: bug#8570 <8570@debbugs.gnu.org> Subject: Status: glibc getcwd does not handle long file names properly? Reply-To: bug#8570 <8570@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:11:37 +0000 retitle 8570 glibc getcwd does not handle long file names properly? reassign 8570 coreutils submitter 8570 Bruno Haible severity 8570 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 27 19:13:05 2011 Received: (at submit) by debbugs.gnu.org; 27 Apr 2011 23:13:05 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QFDun-0004d2-P6 for submit@debbugs.gnu.org; Wed, 27 Apr 2011 19:13:05 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QFDuj-0004cg-Aw for submit@debbugs.gnu.org; Wed, 27 Apr 2011 19:13:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFDua-0008N2-EK for submit@debbugs.gnu.org; Wed, 27 Apr 2011 19:12:52 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:48284) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFDua-0008My-Az for submit@debbugs.gnu.org; Wed, 27 Apr 2011 19:12:48 -0400 Received: from eggs.gnu.org ([140.186.70.92]:34662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFDuW-0007lp-Ib for bug-coreutils@gnu.org; Wed, 27 Apr 2011 19:12:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFDuS-0008MN-SV for bug-coreutils@gnu.org; Wed, 27 Apr 2011 19:12:44 -0400 Received: from mo-p00-ob.rzone.de ([81.169.146.162]:47004) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFDuS-0008MC-9n for bug-coreutils@gnu.org; Wed, 27 Apr 2011 19:12:40 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1303945958; l=950; s=domk; d=haible.de; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date:Subject:To: From:X-RZG-CLASS-ID:X-RZG-AUTH; bh=WqzD6Ad1fPJFhp/rQo31ErTdGBs=; b=eOJgiGp2u/uIchSOq/yz+QauaX81EVg1Folg1+bySZ+gg3AwBq1gOuP2pCMvfzyczsv 7qhkkEbPFcH7xjQJQxotqvCiJFGm1Ghu4raWKPDOOH6KpINqe7EFWEhjinPJsD5MbmvZG v6C69ABO0xxOegKGotmM6EBqa1mUbacmudk= X-RZG-AUTH: :Ln4Re0+Ic/6oZXR1YgKryK8brksyK8dozXDwHXjf9hj/zDNRbvU45h26 X-RZG-CLASS-ID: mo00 Received: from linuix.haible.de (dslb-088-068-073-041.pools.arcor-ip.net [88.68.73.41]) by post.strato.de (klopstock mo39) (RZmta 25.17) with ESMTPA id q0611cn3RKq5Az ; Thu, 28 Apr 2011 01:12:38 +0200 (MEST) From: Bruno Haible To: bruno@haible.de, bug-coreutils@gnu.org Subject: glibc getcwd does not handle long file names properly? Date: Thu, 28 Apr 2011 01:12:37 +0200 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201104280112.37728.bruno@clisp.org> X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.6 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.6 (-----) Hi, building coreutils 8.12 on a Linux 2.6.25.20, glibc 2.8 machine, "make check" shows these lines: ./misc/pwd-unreadable-parent: skipping test: can't use buggy system getcwd SKIP: misc/pwd-unreadable-parent REPLACE_GETCWD is indeed 1, because the test from m4/getcwd-path-max.m4 failed: configure:26992: checking whether getcwd handles long file names properly configure:27154: gcc -m32 -march=i586 -std=gnu99 -o conftest -g -O2 -Wall -I/arch/x86-linux/gnu/include -m32 conftest.c >&5 configure:27154: $? = 0 configure:27154: ./conftest configure:27154: $? = 12 configure: program exited with status 12 But is that known and expected that glibc 2.8 getcwd() does not handle long file names??? And yes, I do have /proc mounted and readable by everyone. Bruno -- In memoriam Marian Batko From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 28 08:22:01 2011 Received: (at 8570) by debbugs.gnu.org; 28 Apr 2011 12:22:01 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QFQEK-0007zE-5l for submit@debbugs.gnu.org; Thu, 28 Apr 2011 08:22:00 -0400 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QFQEH-0007yy-9o for 8570@debbugs.gnu.org; Thu, 28 Apr 2011 08:21:58 -0400 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 5E0A0602A0; Thu, 28 Apr 2011 14:21:50 +0200 (CEST) From: Jim Meyering To: Bruno Haible Subject: Re: bug#8570: glibc getcwd does not handle long file names properly? In-Reply-To: <201104280112.37728.bruno@clisp.org> (Bruno Haible's message of "Thu, 28 Apr 2011 01:12:37 +0200") References: <201104280112.37728.bruno@clisp.org> Date: Thu, 28 Apr 2011 14:21:50 +0200 Message-ID: <87hb9izhup.fsf@rho.meyering.net> Lines: 112 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: 8570 Cc: 8570@debbugs.gnu.org, bruno@haible.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) Bruno Haible wrote: > Hi, > > building coreutils 8.12 on a Linux 2.6.25.20, glibc 2.8 machine, "make check" > shows these lines: > > ./misc/pwd-unreadable-parent: skipping test: can't use buggy system getcwd > SKIP: misc/pwd-unreadable-parent > > REPLACE_GETCWD is indeed 1, because the test from m4/getcwd-path-max.m4 failed: > > configure:26992: checking whether getcwd handles long file names properly > configure:27154: gcc -m32 -march=i586 -std=gnu99 -o conftest -g -O2 > -Wall -I/arch/x86-linux/gnu/include -m32 conftest.c >&5 > configure:27154: $? = 0 > configure:27154: ./conftest > configure:27154: $? = 12 > configure: program exited with status 12 > > But is that known and expected that glibc 2.8 getcwd() does not handle > long file names??? And yes, I do have /proc mounted and readable by everyone. Yes, the /proc based trick is limited by the length of symlink values. Hence, glibc's getcwd does indeed fail, but only in the pathological case in which the name is too long *and* a parent directory is unreadable. However, we cannot use the above reasoning as justification for skipping this test, since the directory name used here is most probably not very long, so I am inclined to remove this test, since it is testing for behavior that user-space tools cannot work around. Either the system-provided getcwd works in spite of an unreadable parent (in which pwd does, too), or it doesn't, and neither does pwd. >From 9a377856d02e3f7c2f8ab17d6ceb98edc4468eb9 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 28 Apr 2011 14:18:50 +0200 Subject: [PATCH] tests: remove useless test: misc/pwd-unreadable-parent * tests/Makefile.am (TESTS): Remove misc/pwd-unreadable-parent. This test was misleading and useless (was always skipped). Inspired by a report from Bruno Haible: http://debbugs.gnu.org/8570 * tests/misc/pwd-unreadable-parent: Remove file. --- tests/Makefile.am | 1 - tests/misc/pwd-unreadable-parent | 41 -------------------------------------- 2 files changed, 0 insertions(+), 42 deletions(-) delete mode 100755 tests/misc/pwd-unreadable-parent diff --git a/tests/Makefile.am b/tests/Makefile.am index 2f4a561..1a80f84 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -160,7 +160,6 @@ TESTS = \ pr/pr-tests \ misc/df-P \ misc/pwd-option \ - misc/pwd-unreadable-parent \ misc/chcon-fail \ misc/cut \ misc/wc \ diff --git a/tests/misc/pwd-unreadable-parent b/tests/misc/pwd-unreadable-parent deleted file mode 100755 index 725d41c..0000000 --- a/tests/misc/pwd-unreadable-parent +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -# Ensure that pwd and "readlink -e ." work even when a parent directory -# is unreadable. Perform this test only on systems with a usable getcwd -# function that has this capability. - -# Copyright (C) 2007-2011 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -. "${srcdir=.}/init.sh"; path_prepend_ ../src -print_ver_ pwd readlink - -test $host_os != linux-gnu && - skip_test_ 'vendor getcwd may be inadequate' - -# Linux ia64 has the gl_FUNC_GETCWD_ABORT_BUG, so we can't use -# the system getcwd. -test $REPLACE_GETCWD = 1 && - skip_test_ "can't use buggy system getcwd" - -mkdir -p a/b || framework_failure -cd a/b || framework_failure -chmod a=x .. || framework_failure - -env -- pwd > exp || fail=1 -readlink -ev . > out || fail=1 - -compare out exp || fail=1 - -Exit $fail -- 1.7.5.421.g9d34e From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 28 16:54:09 2011 Received: (at 8570-done) by debbugs.gnu.org; 28 Apr 2011 20:54:09 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QFYDx-0002qo-By for submit@debbugs.gnu.org; Thu, 28 Apr 2011 16:54:09 -0400 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QFYDu-0002qK-DI for 8570-done@debbugs.gnu.org; Thu, 28 Apr 2011 16:54:07 -0400 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id B5BC160243; Thu, 28 Apr 2011 22:54:00 +0200 (CEST) From: Jim Meyering To: Bruno Haible Subject: Re: bug#8570: glibc getcwd does not handle long file names properly? In-Reply-To: <87hb9izhup.fsf@rho.meyering.net> (Jim Meyering's message of "Thu, 28 Apr 2011 14:21:50 +0200") References: <201104280112.37728.bruno@clisp.org> <87hb9izhup.fsf@rho.meyering.net> Date: Thu, 28 Apr 2011 22:54:00 +0200 Message-ID: <877haexfkn.fsf@rho.meyering.net> Lines: 11 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: 8570-done Cc: 8570-done@debbugs.gnu.org, bruno@haible.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) Jim Meyering wrote: ... > Subject: [PATCH] tests: remove useless test: misc/pwd-unreadable-parent > > * tests/Makefile.am (TESTS): Remove misc/pwd-unreadable-parent. > This test was misleading and useless (was always skipped). > Inspired by a report from Bruno Haible: http://debbugs.gnu.org/8570 > * tests/misc/pwd-unreadable-parent: Remove file. I've pushed that, so am closing the ticket. Thanks again. From unknown Fri Jun 20 07:11:37 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 27 May 2011 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator