mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
Wed Feb 3 23:55:54 1999 Norbert Warmuth <nwarmuth@privat.circular.de>
* widget.c (history_put): set the access rights correctly when the history file is created initially. Don't save the history if we can't set the access rights.
This commit is contained in:
parent
7fe4887f79
commit
30352f64c3
@ -1,3 +1,9 @@
|
||||
Wed Feb 3 23:55:54 1999 Norbert Warmuth <nwarmuth@privat.circular.de>
|
||||
|
||||
* widget.c (history_put): set the access rights correctly when
|
||||
the history file is created initially. Don't save the history
|
||||
if we can't set the access rights.
|
||||
|
||||
1999-02-01 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* setup.c: save we_can_afford_the_speed
|
||||
|
11
src/widget.c
11
src/widget.c
@ -28,6 +28,10 @@
|
||||
#include <config.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include "tty.h"
|
||||
#include <ctype.h>
|
||||
#include "global.h"
|
||||
@ -40,7 +44,6 @@
|
||||
#include "key.h" /* XCTRL and ALT macros */
|
||||
#include "x.h"
|
||||
#include "profile.h" /* for history loading and saving */
|
||||
#include "../vfs/vfs.h"
|
||||
|
||||
#ifndef HAVE_X
|
||||
# define x_create_button(a,b,c) 1
|
||||
@ -944,8 +947,12 @@ void history_put (char *input_name, Hist *h)
|
||||
|
||||
profile = concat_dir_and_file (home_dir, HISTORY_FILE_NAME);
|
||||
|
||||
if ((i = open (profile, O_CREAT | O_EXCL, S_IRUSR | S_IWUSR)) != -1)
|
||||
close (i);
|
||||
/* Just in case I forgot to strip passwords somewhere -- Norbert */
|
||||
mc_chmod (profile, S_IRUSR | S_IWUSR);
|
||||
if (chmod (profile, S_IRUSR | S_IWUSR) == -1 && errno != ENOENT)
|
||||
return;
|
||||
|
||||
while (h->next) /* go to end of list */
|
||||
h = h->next;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user