X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=util.cpp;fp=util.cpp;h=45bf5b52453309b1ff178d63ed1d64603e76b9de;hp=b8862ed48c79719b632dd1575a6cd1cc6e057b39;hb=b8352f46d7d45631d38fc120ccda09268818a686;hpb=479933dbc99e984f1ecf9987441fa3ee8a7bd382 diff --git a/util.cpp b/util.cpp index b8862ed..45bf5b5 100644 --- a/util.cpp +++ b/util.cpp @@ -3,6 +3,8 @@ #include #include #include +#include +#include #include "log.h" #include "util.h" @@ -12,7 +14,9 @@ using namespace std; int make_tempfile(const std::string &contents) { char filename[] = "/tmp/cubemap.XXXXXX"; + mode_t old_umask = umask(0600); int fd = mkstemp(filename); + umask(old_umask); if (fd == -1) { log_perror("mkstemp"); return -1;