diff options
-rw-r--r-- | NEWS | 7 | ||||
-rw-r--r-- | sed/utils.c | 2 |
2 files changed, 8 insertions, 1 deletions
@@ -2,6 +2,13 @@ GNU sed NEWS -*- outline -*- * Noteworthy changes in release ?.? (????-??-??) [?] +** Bug fixes + + "sed -i" now creates temporary files with correct umask (limited to u=rwx). + Previously sed would incorrectly set umask on temporary files, resulting + in problems under certain fuse-like file systems. + [bug introduced in sed 4.2.1] + * Noteworthy changes in release 4.7 (2018-12-20) [stable] diff --git a/sed/utils.c b/sed/utils.c index 4028d98..2e74654 100644 --- a/sed/utils.c +++ b/sed/utils.c @@ -181,7 +181,7 @@ ck_mkstemp (char **p_filename, const char *tmpdir, /* The ownership might change, so omit some permissions at first so unauthorized users cannot nip in before the file is ready. mkstemp forces O_BINARY on cygwin, so use mkostemp instead. */ - mode_t save_umask = umask (0700); + mode_t save_umask = umask (0077); int fd = mkostemp (template, 0); umask (save_umask); if (fd == -1) |