From 90cbfc96d118d6b55c47392d8ae421434dea8225 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 25 Feb 2013 17:34:21 +0100 Subject: Make sure to set umask() before calling mkstemp(). Reviewed-by: David Disseldorp Autobuild-User(master): David Disseldorp Autobuild-Date(master): Wed Mar 6 01:16:34 CET 2013 on sn-devel-104 --- libgpo/gpo_ini.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libgpo') diff --git a/libgpo/gpo_ini.c b/libgpo/gpo_ini.c index 494162466d..a2cb106d73 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; -- cgit