From 80605f5a6cdcfd1d18d12151b69973b28db8c8eb Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Mon, 27 Feb 2017 10:52:38 -0800 Subject: Remove unnecessary umask change in text_save_begin_inplace POSIX says that The mkstemp() function shall use the resulting pathname to create the file, and obtain a file descriptor for it, as if by a call to: open(pathname, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR) So this umask change didn't do anything in practice, unless the original umask was more restrictive than 0177. --- text.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'text.c') diff --git a/text.c b/text.c index 5a7d907..bc599f5 100644 --- a/text.c +++ b/text.c @@ -937,9 +937,7 @@ static bool text_save_begin_inplace(TextSave *ctx) { */ size_t size = txt->block->size; char tmpname[32] = "/tmp/vis-XXXXXX"; - mode_t mask = umask(S_IXUSR | S_IRWXG | S_IRWXO); newfd = mkstemp(tmpname); - umask(mask); if (newfd == -1) goto err; if (unlink(tmpname) == -1) -- cgit v1.2.3