From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hall.aurel32.net (hall.aurel32.net [IPv6:2001:bc8:30d7:100::1]) by sourceware.org (Postfix) with ESMTPS id D93D4385803B for ; Sun, 19 Sep 2021 16:49:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D93D4385803B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=aurel32.net Authentication-Results: sourceware.org; spf=none smtp.mailfrom=aurel32.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=aurel32.net ; s=202004.hall; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date: Subject:Cc:To:From:Content-Type:From:Reply-To:Subject:Content-ID: Content-Description:In-Reply-To:References:X-Debbugs-Cc; bh=TkHKvAbu4rOjaapuGgFMQXysWSp1GAOxitULxj6DfRA=; b=a1VS8yJMFYM/p8fZfNXgXTG5Wi ee7x3SgTrFQ11EVAi61HDbGvLOVfvIpeXElkZrpcfZwgCR1BlatUXN+7sXaxZXgdqdbk3KWO+Rj4W Wp/zRZtO0vUfJaN+d/5L3hWa/w1D4v9UM5ZiLdaD2jiTpHE37lMlUE+VDGTU/QzLA8egkP1oS4P3j YgeBg6hZUM2N82V1EMDoxiFWhoDITPF6PHyRIjv8xfgED+RlCl/M4LUF7zZkOw/z8BWdpuN4yDwhw sgy6FzMs9NJdB2J9GFEjmin78Xk+FcrLFFuJ1BIY/4WfEl7u+xeY93LONC0ouKaI9XTUImEoLB68T EbPY9Nqw==; Received: from [2a01:e34:ec5d:a741:8a4c:7c4e:dc4c:1787] (helo=ohm.rr44.fr) by hall.aurel32.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mS00b-0008Dm-0V; Sun, 19 Sep 2021 18:49:41 +0200 Received: from aurel32 by ohm.rr44.fr with local (Exim 4.94.2) (envelope-from ) id 1mS00a-002Ec7-EK; Sun, 19 Sep 2021 18:49:40 +0200 From: Aurelien Jarno To: libc-stable@sourceware.org Cc: Aurelien Jarno Subject: [COMMITTED 2.32] posix: Fix attribute access mode on getcwd [BZ #27476] Date: Sun, 19 Sep 2021 18:49:24 +0200 Message-Id: <20210919164924.532139-1-aurelien@aurel32.net> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-stable@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-stable mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 16:49:43 -0000 There is a GNU extension that allows to call getcwd(NULL, >0). It is described in the documentation, but also directly in the unistd.h header, just above the declaration. Therefore the attribute access mode added in commit 06febd8c6705 is not correct. Drop it. (cherry picked from commit 63a788f48a713f2081f200dd054df3e728b0e7c2) --- posix/bits/unistd.h | 5 ++--- posix/unistd.h | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/posix/bits/unistd.h b/posix/bits/unistd.h index 725a83eb0d..7e5bb6fb1e 100644 --- a/posix/bits/unistd.h +++ b/posix/bits/unistd.h @@ -193,10 +193,9 @@ __NTH (readlinkat (int __fd, const char *__restrict __path, #endif extern char *__getcwd_chk (char *__buf, size_t __size, size_t __buflen) - __THROW __wur __attr_access ((__write_only__, 1, 2)); + __THROW __wur; extern char *__REDIRECT_NTH (__getcwd_alias, - (char *__buf, size_t __size), getcwd) - __wur __attr_access ((__write_only__, 1, 2)); + (char *__buf, size_t __size), getcwd) __wur; extern char *__REDIRECT_NTH (__getcwd_chk_warn, (char *__buf, size_t __size, size_t __buflen), __getcwd_chk) diff --git a/posix/unistd.h b/posix/unistd.h index aac164dc9c..acf9ee7e79 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -517,8 +517,7 @@ extern int fchdir (int __fd) __THROW __wur; an array is allocated with `malloc'; the array is SIZE bytes long, unless SIZE == 0, in which case it is as big as necessary. */ -extern char *getcwd (char *__buf, size_t __size) __THROW __wur - __attr_access ((__write_only__, 1, 2)); +extern char *getcwd (char *__buf, size_t __size) __THROW __wur; #ifdef __USE_GNU /* Return a malloc'd string containing the current directory name. -- 2.30.2