mirror of
https://github.com/lxsang/antd-web-apps
synced 2024-11-20 02:18:20 +01:00
Merge pull request #37 from lxsang/master
setting file should not be readable by other user
This commit is contained in:
commit
a361a475c9
@ -53,10 +53,12 @@ function SystemController:settings(...)
|
||||
if user then
|
||||
local ospath = require("vfs").ospath("home:///", user)
|
||||
if REQUEST and REQUEST.json then
|
||||
local f = io.open(ospath .. "/" .. ".settings.json", "w")
|
||||
local file_path = ospath .. "/" .. ".settings.json"
|
||||
local f = io.open(file_path, "w")
|
||||
if f then
|
||||
f:write(REQUEST.json)
|
||||
f:close()
|
||||
os.execute("chmod o-r "..file_path)
|
||||
result(true)
|
||||
else
|
||||
fail("Cannot save setting")
|
||||
|
Loading…
Reference in New Issue
Block a user