summaryrefslogtreecommitdiff
path: root/source3/client
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 /source3/client
parent7a50f089e0ae70ec7652575e11fbf87a9f6a86e7 (diff)
downloadsamba-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/client')
-rw-r--r--source3/client/client.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 8038021d83..e21d867c55 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -1361,6 +1361,7 @@ static int cmd_more(void)
const char *pager;
int fd;
int rc = 0;
+ mode_t mask;
rname = talloc_strdup(ctx, client_get_cur_dir());
if (!rname) {
@@ -1371,7 +1372,9 @@ static int cmd_more(void)
if (!lname) {
return 1;
}
+ mask = umask(S_IRWXO | S_IRWXG);
fd = mkstemp(lname);
+ umask(mask);
if (fd == -1) {
d_printf("failed to create temporary file for more\n");
return 1;