From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#28875: 25.3.50; set-default-file-modes ignores execution bits Date: Fri, 20 Oct 2017 11:42:35 +0300 Message-ID: <83tvyuciro.fsf@gnu.org> References: <87vajd2a1v.fsf@gmail.com> <878tg6ecpx.fsf@gmail.com> <83vajacmsp.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1508489001 12861 195.159.176.226 (20 Oct 2017 08:43:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 20 Oct 2017 08:43:21 +0000 (UTC) Cc: 28875@debbugs.gnu.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 20 10:43:17 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5StY-0001p2-Q4 for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Oct 2017 10:43:08 +0200 Original-Received: from localhost ([::1]:52660 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Stg-0001cg-7H for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Oct 2017 04:43:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5StV-0001bP-UO for bug-gnu-emacs@gnu.org; Fri, 20 Oct 2017 04:43:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5StS-00013C-0J for bug-gnu-emacs@gnu.org; Fri, 20 Oct 2017 04:43:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42398) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e5StR-000138-T4 for bug-gnu-emacs@gnu.org; Fri, 20 Oct 2017 04:43:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e5StR-0002th-MO for bug-gnu-emacs@gnu.org; Fri, 20 Oct 2017 04:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Oct 2017 08:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28875 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28875-submit@debbugs.gnu.org id=B28875.150848897611125 (code B ref 28875); Fri, 20 Oct 2017 08:43:01 +0000 Original-Received: (at 28875) by debbugs.gnu.org; 20 Oct 2017 08:42:56 +0000 Original-Received: from localhost ([127.0.0.1]:51079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5StL-0002tN-Tb for submit@debbugs.gnu.org; Fri, 20 Oct 2017 04:42:56 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5StK-0002tB-EZ for 28875@debbugs.gnu.org; Fri, 20 Oct 2017 04:42:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5StB-0000mo-E2 for 28875@debbugs.gnu.org; Fri, 20 Oct 2017 04:42:49 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5StB-0000ma-9d; Fri, 20 Oct 2017 04:42:45 -0400 Original-Received: from [176.228.60.248] (port=2174 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e5StA-0002rH-M7; Fri, 20 Oct 2017 04:42:45 -0400 In-reply-to: (message from Tino Calancha on Fri, 20 Oct 2017 16:31:46 +0900) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:138751 Archived-At: > From: Tino Calancha > 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.