Source-Changes-HG archive

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

[src/trunk]: src/bin/ksh Use 0600 as the mode for histfile here too.



details:   https://anonhg.NetBSD.org/src/rev/eb8fbcfd45c8
branches:  trunk
changeset: 358800:eb8fbcfd45c8
user:      maya <maya%NetBSD.org@localhost>
date:      Wed Jan 17 00:29:22 2018 +0000

description:
Use 0600 as the mode for histfile here too.

pointed out by John D. Baker in PR bin/52480

diffstat:

 bin/ksh/history.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r f0431693a8e2 -r eb8fbcfd45c8 bin/ksh/history.c
--- a/bin/ksh/history.c Wed Jan 17 00:23:17 2018 +0000
+++ b/bin/ksh/history.c Wed Jan 17 00:29:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: history.c,v 1.17 2017/06/30 04:41:19 kamil Exp $       */
+/*     $NetBSD: history.c,v 1.18 2018/01/17 00:29:22 maya Exp $        */
 
 /*
  * command history
@@ -19,7 +19,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: history.c,v 1.17 2017/06/30 04:41:19 kamil Exp $");
+__RCSID("$NetBSD: history.c,v 1.18 2018/01/17 00:29:22 maya Exp $");
 #endif
 
 #include <sys/stat.h>
@@ -753,7 +753,7 @@
   else
     hp = histlist;
 
-  if ((fd = open(hname, O_WRONLY | O_CREAT | O_TRUNC | O_EXLOCK, 0777)) != -1) {
+  if ((fd = open(hname, O_WRONLY | O_CREAT | O_TRUNC | O_EXLOCK, 0600)) != -1) {
     /* Remove anything written before we got the lock */
     ftruncate(fd, 0);
     if ((fh = fdopen(fd, "w")) != NULL) {



Home | Main Index | Thread Index | Old Index