From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: master 9d626df: Add 'nofollow' flag to set-file-modes etc. Date: Mon, 24 Feb 2020 16:25:51 -0800 Organization: UCLA Computer Science Department Message-ID: References: <20200224004617.19362.5846@vcs0.savannah.gnu.org> <20200224004619.58020206ED@vcs0.savannah.gnu.org> <87blpow0s6.fsf@detlef.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="44055"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 Cc: emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Feb 25 01:26:51 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j6O3n-000BNP-1X for ged-emacs-devel@m.gmane-mx.org; Tue, 25 Feb 2020 01:26:51 +0100 Original-Received: from localhost ([::1]:46640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6O3m-0005OR-3O for ged-emacs-devel@m.gmane-mx.org; Mon, 24 Feb 2020 19:26:50 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52740) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6O2y-00042c-KK for emacs-devel@gnu.org; Mon, 24 Feb 2020 19:26:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6O2u-0000qP-6t for emacs-devel@gnu.org; Mon, 24 Feb 2020 19:25:59 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:37372) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j6O2u-0000pb-0j for emacs-devel@gnu.org; Mon, 24 Feb 2020 19:25:56 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id C620A160081; Mon, 24 Feb 2020 16:25:52 -0800 (PST) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id FPwbED1sdJ18; Mon, 24 Feb 2020 16:25:51 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id CE36D16008A; Mon, 24 Feb 2020 16:25:51 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id VUZjtodEbhBn; Mon, 24 Feb 2020 16:25:51 -0800 (PST) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id B3148160081; Mon, 24 Feb 2020 16:25:51 -0800 (PST) In-Reply-To: <87blpow0s6.fsf@detlef.i-did-not-set--mail-host-address--so-tickle-me> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:245057 Archived-At: On 2/24/20 5:52 AM, Michael Albinus wrote: > However, for POSIX shells it is different. FreeBSD supports the "chmod > -h" argument, which implements nofollow. See > . I could check for this > argument, and use if possible. > > But what shall I do if the target system runs GNU/Linux? chmod(1) does > not offer any comparable argument. Shall I simply ignore nofollow there? How about something like this? if (chmod -h works); then chmod -h MODE FILE elif (test -h works); then test -h FILE && chmod MODE FILE else chmod MODE FILE fi I'm suggesting 'test -h' rather than 'test -L' here because some ancient platforms support the former but not the latter. > Does anybody know, whether there are plans to extend chmod accordingly, > for example the version in coreutils? Or is there an alternative > possiblity to change the permission of the symbolic link? It should be added to the coreutils TODO list, if it's not there already. On GNU/Linux symlink modes cannot be changed, for what it's worth, so chmod -h would merely be a safety feature.