From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 58EFA1F45E for ; Sun, 16 Feb 2020 18:52:43 +0000 (UTC) Received: from localhost ([::1]:35274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3P22-00075m-3I for normalperson@yhbt.net; Sun, 16 Feb 2020 13:52:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57875) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3P1x-00075e-Ob for bug-gnulib@gnu.org; Sun, 16 Feb 2020 13:52:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j3P1w-0005LE-Nn for bug-gnulib@gnu.org; Sun, 16 Feb 2020 13:52:37 -0500 Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::5]:33201) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j3P1w-0005H1-20 for bug-gnulib@gnu.org; Sun, 16 Feb 2020 13:52:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1581879153; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=mTDx9hmRXn1ZsQIwKlAvA1EbdlQVZgG8B4hyZBqbj8k=; b=e7sSJCurdHRrySVTMMCXRfJVcg7ICSh7Fien4ygElHHBwkVuT1v2z9fVrnPCI+OFko yjAXnU5xTZ912KaPNi8mRJGrlFQb3sRbdU177JECD24eQD8dgA7mzxm0AVV/dtqsHMBt RlHNfJivh1dKOVVdTZWh7peoU9BJJxqinEGEgbcpsky5IA184/R98muzAhzKya+cZdB0 JpAJzUA6Uh7Ybp12nVNXdmFeE+2veVYTmxYgIEM04NDSUoqeky1kNtaadD/vRBuim1IW 38KBnQzZr10VV5xwS9GcQloyXCvdVYg0OXpQbS6GbzZWJzlgYIJM40SZiyuQAneL0G/K kq9g== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOH6fzxfs=" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 46.1.12 DYNA|AUTH) with ESMTPSA id g00701w1GIqMDPX (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Sun, 16 Feb 2020 19:52:22 +0100 (CET) From: Bruno Haible To: bug-gnulib@gnu.org Subject: Re: fchmodat with AT_SYMLINK_NOFOLLOW Date: Sun, 16 Feb 2020 19:52:21 +0100 Message-ID: <5928687.1L8MnaBM2n@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-171-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <2036426.TUBIXgM5Sz@omega> References: <20200122141557.GA8157@brightrain.aerifal.cx> <38d0e03d-4718-8085-4474-981fdef9b4b8@cs.ucla.edu> <2036426.TUBIXgM5Sz@omega> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:238:20a:202:5300::5 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Eggert Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" On 2020-02-08 I wrote: > 1) Improve the cross-compilation guesses. The result of the > "fchmodat+AT_SYMLINK_NOFOLLOW works on non-symlinks" test is: > - yes on kFreeBSD/glibc, Hurd/glibc, FreeBSD 12, AIX 7.2, Solaris 11, Haiku, > - no on Linux/glibc, Cygwin 2.9. A similar improvement can be done for lchmod. The result of the "lchmod works on non-symlinks" test is: - on Linux/glibc it is not executed, because lchmod() does not exist; but if it would, it would surely report "no", - "yes" on Linux with musl libc, GNU/kFreeBSD, GNU/Hurd, Mac OS X 10.5, FreeBSD 12.0, NetBSD 8.0, HP-UX 11.31, - "no" on no platform I know of (probably older musl libc versions). 2020-02-16 Bruno Haible lchmod: Improve cross-compilation guess. * m4/lchmod.m4 (gl_FUNC_LCHMOD): Require AC_CANONICAL_HOST. When cross-compiling, guess depending on the platform. diff --git a/m4/lchmod.m4 b/m4/lchmod.m4 index 68dab7a..1646bd7 100644 --- a/m4/lchmod.m4 +++ b/m4/lchmod.m4 @@ -1,4 +1,4 @@ -#serial 4 +#serial 5 dnl Copyright (C) 2005-2006, 2008-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation @@ -15,6 +15,8 @@ AC_DEFUN([gl_FUNC_LCHMOD], dnl Persuade glibc to declare lchmod(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CHECK_FUNCS_ONCE([fchmodat lchmod lstat]) if test "$ac_cv_func_lchmod" = no; then HAVE_LCHMOD=0 @@ -56,7 +58,12 @@ AC_DEFUN([gl_FUNC_LCHMOD], ]])], [gl_cv_func_lchmod_works=yes], [gl_cv_func_lchmod_works=no], - [gl_cv_func_lchmod_works=$gl_cross_guess_normal]) + [case "$host_os" in + dnl Guess no on Linux with glibc, yes otherwise. + linux-gnu*) gl_cv_func_lchmod_works="guessing no" ;; + *) gl_cv_func_lchmod_works="$gl_cross_guess_normal" ;; + esac + ]) rm -f conftest.lchmod]) case $gl_cv_func_lchmod_works in *yes) ;;