all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tino Calancha <tino.calancha@gmail.com>
Cc: 28875@debbugs.gnu.org, schwab@suse.de
Subject: bug#28875: 25.3.50; set-default-file-modes ignores execution bits
Date: Fri, 20 Oct 2017 10:15:34 +0300	[thread overview]
Message-ID: <83vajacmsp.fsf@gnu.org> (raw)
In-Reply-To: <878tg6ecpx.fsf@gmail.com> (message from Tino Calancha on Fri, 20 Oct 2017 12:10:18 +0900)

> From: Tino Calancha <tino.calancha@gmail.com>
> Cc: Eli Zaretskii <eliz@gnu.org>, Andreas Schwab <schwab@suse.de>
> Date: Fri, 20 Oct 2017 12:10:18 +0900
> 
> >> make-temp-file already creates the file (with restrictive modes), so
> >> with-file-modes has no effect (write-region does not change the mode of
> >> existing files).  But write-region also never sets the x bits in the
> >> first place, it uses #o666 as the base mode.
> >>
> > I think I was fooled by the docstring of `set-default-file-modes':
> > "Set the file permission bits for newly created files..."
> Besides the behavior is mentioned in the manual, that is relevant
> for the correct use of the function, so IMO it's worth to include it
> the docstring as well.
> 
> --8<-----------------------------cut here---------------start------------->8---
> commit d749ad1ca0375a938c0283155b56e737cc120640
> Author: Tino Calancha <tino.calancha@gmail.com>
> Date:   Fri Oct 20 11:58:17 2017 +0900
> 
>     * src/fileio.c (set-default-file-modes): Doc fix
> 
> diff --git a/src/fileio.c b/src/fileio.c
> index b7df38c857..d707bfc1c6 100644
> --- a/src/fileio.c
> +++ b/src/fileio.c
> @@ -3125,7 +3125,11 @@ symbolic notation, like the `chmod' command from GNU Coreutils.  */)
>  DEFUN ("set-default-file-modes", Fset_default_file_modes, Sset_default_file_modes, 1, 1, 0,
>         doc: /* Set the file permission bits for newly created files.
>  The argument MODE should be an integer; only the low 9 bits are used.
> -This setting is inherited by subprocesses.  */)
> +This setting is inherited by subprocesses.
> +
> +Note that some functions (e.g., `write-region') ignore the execution
> +bits in MODE.  In that case you need first to create the file,
> +and then set the permisions with `set-file-modes'.  */)

Why would someone assume that write-region could/should change the
mode bits of an already existing file?  It's entirely unreasonable for
write-region to do so, as the mode bits are determined when the file
is created, in this case by make-temp-file.

So I'm not sure why should we make this correction to the doc string.
What am I missing?

Thanks.





  reply	other threads:[~2017-10-20  7:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17 13:11 bug#28875: 25.3.50; set-default-file-modes ignores execution bits Tino Calancha
2017-10-17 14:03 ` Andreas Schwab
2017-10-17 14:25   ` Tino Calancha
2017-10-20  3:10     ` Tino Calancha
2017-10-20  7:15       ` Eli Zaretskii [this message]
     [not found]         ` <ef2bbaf3-7c6b-56a8-32ac-c5366d7431e7@gmail.com>
2017-10-20  8:42           ` Eli Zaretskii
     [not found]             ` <0a5e94fd-6c38-b022-5219-449f5e90c261@gmail.com>
     [not found]               ` <83bmks7l1p.fsf@gnu.org>
2017-10-27 14:02                 ` Tino Calancha
2017-10-27 17:22                   ` Eli Zaretskii
2018-07-10  6:45                     ` Tino Calancha
2017-10-20  7:53       ` 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=83vajacmsp.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=28875@debbugs.gnu.org \
    --cc=schwab@suse.de \
    --cc=tino.calancha@gmail.com \
    /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.