Software / code / prosody
Comparison
plugins/mod_posix.lua @ 2440:11e3d16a128f
mod_posix: Set umask to 'umask' from the config, or 027
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sun, 10 Jan 2010 22:15:15 +0000 |
| parent | 2438:819ba949c7bc |
| child | 2445:9806fac994f8 |
comparison
equal
deleted
inserted
replaced
| 2439:511ba389147a | 2440:11e3d16a128f |
|---|---|
| 20 local logger_set = require "util.logger".setwriter; | 20 local logger_set = require "util.logger".setwriter; |
| 21 | 21 |
| 22 local prosody = _G.prosody; | 22 local prosody = _G.prosody; |
| 23 | 23 |
| 24 module.host = "*"; -- we're a global module | 24 module.host = "*"; -- we're a global module |
| 25 | |
| 26 local umask = module:get_option("umask") or "027"; | |
| 27 pposix.umask(umask); | |
| 25 | 28 |
| 26 -- Allow switching away from root, some people like strange ports. | 29 -- Allow switching away from root, some people like strange ports. |
| 27 module:add_event_hook("server-started", function () | 30 module:add_event_hook("server-started", function () |
| 28 local uid = module:get_option("setuid"); | 31 local uid = module:get_option("setuid"); |
| 29 local gid = module:get_option("setgid"); | 32 local gid = module:get_option("setgid"); |