From faa476a4ed1750f117d76dd8f99f0fa1849ab539 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 14 Jan 2020 19:09:54 +0000 Subject: 45302: bin_umask(): Queue signals around umask(). Otherwise, a signal handler might create files while the temporary umask is in effect. --- ChangeLog | 5 +++++ Src/builtin.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ca68e2e4b..02825ae36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-01-15 Daniel Shahaf + + * 45302: Src/builtin.c: bin_umask(): Queue signals around + umask(). + 2020-01-14 Daniel Shahaf * users/24656: Doc/Zsh/mod_zutil.yo: docs: Add an example of diff --git a/Src/builtin.c b/Src/builtin.c index 0ecabf854..aa5767cf1 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -7287,8 +7287,11 @@ bin_umask(char *nam, char **args, Options ops, UNUSED(int func)) char *s = *args; /* Get the current umask. */ - um = umask(0); + queue_signals(); + um = umask(0777); umask(um); + unqueue_signals(); + /* No arguments means to display the current setting. */ if (!s) { if (OPT_ISSET(ops,'S')) { -- cgit 1.4.1