diff options
| author | Daniel Shahaf <danielsh@apache.org> | 2020-01-14 19:09:54 +0000 |
|---|---|---|
| committer | Daniel Shahaf <danielsh@apache.org> | 2020-01-15 19:49:45 +0000 |
| commit | faa476a4ed1750f117d76dd8f99f0fa1849ab539 (patch) | |
| tree | 2203c3a652037ee7eb6742215e27fb00318dc53e | |
| parent | users/24656: docs: Add an example of setting and querying zstyles (diff) | |
| download | zsh-faa476a4ed1750f117d76dd8f99f0fa1849ab539.tar zsh-faa476a4ed1750f117d76dd8f99f0fa1849ab539.tar.gz zsh-faa476a4ed1750f117d76dd8f99f0fa1849ab539.tar.bz2 zsh-faa476a4ed1750f117d76dd8f99f0fa1849ab539.tar.lz zsh-faa476a4ed1750f117d76dd8f99f0fa1849ab539.tar.xz zsh-faa476a4ed1750f117d76dd8f99f0fa1849ab539.tar.zst zsh-faa476a4ed1750f117d76dd8f99f0fa1849ab539.zip | |
45302: bin_umask(): Queue signals around umask().
Otherwise, a signal handler might create files while the temporary umask
is in effect.
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | Src/builtin.c | 5 |
2 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2020-01-15 Daniel Shahaf <danielsh@apache.org> + + * 45302: Src/builtin.c: bin_umask(): Queue signals around + umask(). + 2020-01-14 Daniel Shahaf <d.s@daniel.shahaf.name> * 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')) { |
