summaryrefslogtreecommitdiffstats
path: root/libgpo
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2013-02-25 17:34:21 +0100
committerDavid Disseldorp <ddiss@samba.org>2013-03-06 01:16:34 +0100
commit90cbfc96d118d6b55c47392d8ae421434dea8225 (patch)
tree8d0c24d3e5241daaadda579acf13fe90c399b632 /libgpo
parent7a50f089e0ae70ec7652575e11fbf87a9f6a86e7 (diff)
downloadsamba-90cbfc96d118d6b55c47392d8ae421434dea8225.tar.gz
samba-90cbfc96d118d6b55c47392d8ae421434dea8225.tar.xz
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 'libgpo')
-rw-r--r--libgpo/gpo_ini.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libgpo/gpo_ini.c b/libgpo/gpo_ini.c
index 494162466d0..a2cb106d73c 100644
--- a/libgpo/gpo_ini.c
+++ b/libgpo/gpo_ini.c
@@ -63,6 +63,7 @@ static NTSTATUS convert_file_from_ucs2(TALLOC_CTX *mem_ctx,
NTSTATUS status;
size_t n = 0;
size_t converted_size;
+ mode_t mask;
if (!filename_out) {
return NT_STATUS_INVALID_PARAMETER;
@@ -81,7 +82,9 @@ static NTSTATUS convert_file_from_ucs2(TALLOC_CTX *mem_ctx,
goto out;
}
+ mask = umask(S_IRWXO | S_IRWXG);
tmp_fd = mkstemp(tmp_name);
+ umask(mask);
if (tmp_fd == -1) {
status = NT_STATUS_ACCESS_DENIED;
goto out;