From: Paul Eggert <eggert@cs.ucla.edu>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: emacs-devel@gnu.org
Subject: Re: master 9d626df: Add 'nofollow' flag to set-file-modes etc.
Date: Mon, 24 Feb 2020 16:25:51 -0800 [thread overview]
Message-ID: <f35c0721-4b15-36f0-d53f-5b872b5f5729@cs.ucla.edu> (raw)
In-Reply-To: <87blpow0s6.fsf@detlef.i-did-not-set--mail-host-address--so-tickle-me>
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
> <https://www.freebsd.org/cgi/man.cgi?chmod>. 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.
next prev parent reply other threads:[~2020-02-25 0:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200224004617.19362.5846@vcs0.savannah.gnu.org>
[not found] ` <20200224004619.58020206ED@vcs0.savannah.gnu.org>
2020-02-24 13:52 ` master 9d626df: Add 'nofollow' flag to set-file-modes etc Michael Albinus
2020-02-25 0:25 ` Paul Eggert [this message]
2020-02-25 9:15 ` Michael Albinus
2020-02-25 23:02 ` Paul Eggert
2020-02-26 0:29 ` Michael Albinus
2020-02-25 9:23 ` Andreas Schwab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f35c0721-4b15-36f0-d53f-5b872b5f5729@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=michael.albinus@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.