mod_posix: Set umask to 'umask' from the config, or 027
[prosody.git] / plugins / mod_posix.lua
index 0f28041c2306339c49fdd10353a3e5fad8a279b7..8c2c7d7dd5ad44bfe29f6a2564271409584659c5 100644 (file)
@@ -23,6 +23,9 @@ local prosody = _G.prosody;
 
 module.host = "*"; -- we're a global module
 
+local umask = module:get_option("umask") or "027";
+pposix.umask(umask);
+
 -- Allow switching away from root, some people like strange ports.
 module:add_event_hook("server-started", function ()
                local uid = module:get_option("setuid");