unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: 17187@debbugs.gnu.org
Subject: bug#17187: 24.3.50.1 open-dribble-file stores pw
Date: Sat, 05 Apr 2014 19:01:40 -0400	[thread overview]
Message-ID: <l01txbv0rv.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <jwveh1bo2wu.fsf-monnier+emacsbugs@gnu.org> (Stefan Monnier's message of "Sat, 05 Apr 2014 18:02:53 -0400")


Lightly tested:

*** src/keyboard.c	2014-04-05 18:33:55 +0000
--- src/keyboard.c	2014-04-05 22:59:00 +0000
***************
*** 20,25 ****
--- 20,26 ----
  #include <config.h>
  
  #include "sysstdio.h"
+ #include <sys/stat.h>
  
  #include "lisp.h"
  #include "termchar.h"
***************
*** 10085,10092 ****
      }
    if (!NILP (file))
      {
        file = Fexpand_file_name (file, Qnil);
!       dribble = emacs_fopen (SSDATA (file), "w");
        if (dribble == 0)
  	report_file_error ("Opening dribble", file);
      }
--- 10086,10100 ----
      }
    if (!NILP (file))
      {
+       int fd;
        file = Fexpand_file_name (file, Qnil);
!       if (! NILP (Ffile_exists_p (file)))
!         {
!           if (chmod (SSDATA (file), 0600) < 0)
!             report_file_error ("Doing chmod", file);
!         }
!       fd = emacs_open (SSDATA (file), O_WRONLY | O_CREAT | O_TRUNC, 0600);
!       dribble = fd < 0 ? 0 : fdopen (fd, "w");
        if (dribble == 0)
  	report_file_error ("Opening dribble", file);
      }






  reply	other threads:[~2014-04-05 23:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-04 17:35 bug#17187: 24.3.50.1 open-dribble-file stores pw Andreas Röhler
2014-04-04 21:42 ` Glenn Morris
2014-04-05  7:54   ` Andreas Röhler
2014-04-05  7:58   ` Andreas Röhler
2014-04-05 15:50   ` Stefan Monnier
2014-04-05 16:37     ` Andreas Röhler
2014-04-05 16:55       ` Andreas Schwab
2014-04-05 18:07         ` Andreas Röhler
2014-04-05 19:24           ` Andreas Schwab
2014-04-05 17:22     ` Glenn Morris
2014-04-05 22:02       ` Stefan Monnier
2014-04-05 23:01         ` Glenn Morris [this message]
2014-04-05 23:14           ` Daniel Colascione
2014-04-06  2:05             ` Glenn Morris
2014-04-11  5:49           ` Glenn Morris

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=l01txbv0rv.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=17187@debbugs.gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).