diff options
author | Andreas Schneider <asn@samba.org> | 2013-02-25 17:34:21 +0100 |
---|---|---|
committer | David Disseldorp <ddiss@samba.org> | 2013-03-06 01:16:34 +0100 |
commit | 90cbfc96d118d6b55c47392d8ae421434dea8225 (patch) | |
tree | 8d0c24d3e5241daaadda579acf13fe90c399b632 /source3/smbd | |
parent | 7a50f089e0ae70ec7652575e11fbf87a9f6a86e7 (diff) | |
download | samba-90cbfc96d118d6b55c47392d8ae421434dea8225.tar.gz samba-90cbfc96d118d6b55c47392d8ae421434dea8225.tar.bz2 samba-90cbfc96d118d6b55c47392d8ae421434dea8225.zip |
Make sure to set umask() before calling mkstemp().
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Wed Mar 6 01:16:34 CET 2013 on sn-devel-104
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/message.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/smbd/message.c b/source3/smbd/message.c index 59949e21ae..5369f3185a 100644 --- a/source3/smbd/message.c +++ b/source3/smbd/message.c @@ -23,6 +23,7 @@ #include "includes.h" +#include "system/filesys.h" #include "smbd/smbd.h" #include "smbd/globals.h" #include "smbprofile.h" @@ -50,6 +51,7 @@ static void msg_deliver(struct msg_state *state) ssize_t sz; fstring alpha_buf; char *s; + mode_t mask; if (! (*lp_msg_command(frame))) { DEBUG(1,("no messaging command specified\n")); @@ -61,7 +63,9 @@ static void msg_deliver(struct msg_state *state) if (!name) { goto done; } + mask = umask(S_IRWXO | S_IRWXG); fd = mkstemp(name); + umask(mask); if (fd == -1) { DEBUG(1, ("can't open message file %s: %s\n", name, |