the nobody UID is no longer allowed to read or write files

This commit is contained in:
Izaya 2017-09-15 19:56:35 +10:00 committed by Izaya
parent 4e3b65ad38
commit ae083f57d9

View File

@ -18,6 +18,7 @@ do
end
local function canread(fn)
fn = fs.canonical(fn)
if os.getuid() == "nobody" then return false end
if os.getuid() ~= "superuser" and fsattr[fn] then
if not parseacl(fsattr[fn].read or "")[os.getuid()] then return false end
end
@ -25,6 +26,7 @@ do
end
local function canwrite(fn)
fn = fs.canonical(fn)
if os.getuid() == "nobody" then return false end
if os.getuid() ~= "superuser" and fsattr[fn] then
if not parseacl(fsattr[fn].write)[os.getuid()] then return false end
end