bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#28875: 25.3.50; set-default-file-modes ignores execution bits


From: Eli Zaretskii
Subject: bug#28875: 25.3.50; set-default-file-modes ignores execution bits
Date: Fri, 20 Oct 2017 11:42:35 +0300

> From: Tino Calancha <tino.calancha@gmail.com>
> Date: Fri, 20 Oct 2017 16:31:46 +0900
> 
>          (with-file-modes ?\700
>                (if (file-exists-p
>                     (setq pidfile (format "/tmp/Mosaic.%d" pid)))
>                    (delete-file pidfile))
>                ;; https://debbugs.gnu.org/17428.  Use O_EXCL.
>                (write-region nil nil pidfile nil 'silent nil 'excl)))
> 
> Here the file doesn't exist, `write-region' create it.  Beside the
> (with-file-modes ?\700
> 
> the actual file permission for pidfile is: 600
> This was a bit sorprising for me; I need to read the manual to fully
> understand it.
> The docstring of with-file-modes links to set-default-file-modes, so
> maybe enough just t mention about this there.

I think you are missing what Andreas points out: that
set-default-file-modes works via 'umask', which can only remove bits
from the default permissions, it cannot add bits.  I'm okay with
describing this in more details, for those might not be aware of how
'umask' works.  That would be a different text, though, not the one
you suggested.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]