forked from Hyperion/HyperionOS
NC firmware update (thanks spsf). opencomputers now uses mutiple gpus to speed up rendering and now has net drivers. currently working on kernel memory protections to prevent malicious kernel drivers. spm does not work on opencomputers, this is a known issue i am working on fixing it :D sorry for the slow development.
This commit is contained in:
1 parent
fbaafc7cff
commit
ef4b856ee6
89 files changed
+3955
-563
No files matched your search
@@ -973,6 +973,9 @@ function vfs.symlink(target, linkPath)
|
||||
if type(target) ~= "string" or type(linkPath) ~= "string" then error("EINVAL") end
|
||||
local norm = normalizePath(linkPath)
|
||||
local parent = norm:match("^(.*)/[^/]+$") or "/"
|
||||
if not vfs.exists(parent) then
|
||||
vfs.mkdir(parent)
|
||||
end
|
||||
local disk = resolveMount(linkPath)
|
||||
if disk:isReadOnly() then error("ERDONLY") end
|
||||
if parent == "" then parent = "/" end
|
||||
@@ -1017,7 +1020,7 @@ function vfs.access(path, mode)
|
||||
return true
|
||||
end
|
||||
|
||||
local function updateMeta(path, fn, noFollow)
|
||||
local function updateMeta(path, fn, noFollow, nullify)
|
||||
local real = namei(path, noFollow)
|
||||
local norm = real
|
||||
local parent = norm:match("^(.*)/[^/]+$") or "/"
|
||||
@@ -1042,9 +1045,13 @@ local function updateMeta(path, fn, noFollow)
|
||||
if uf.close then uf.close() end
|
||||
existing = parseMetafile(raw)
|
||||
end
|
||||
local entry = existing[name] or { etype=0, owner=0, group=0, perms=63, cmeta="" }
|
||||
fn(entry)
|
||||
existing[name] = entry
|
||||
if not nullify then
|
||||
local entry = existing[name] or { etype=0, owner=0, group=0, perms=63, cmeta="" }
|
||||
fn(entry)
|
||||
existing[name] = entry
|
||||
else
|
||||
existing[name] = nil
|
||||
end
|
||||
local f = disk:open(mp, "w"); f.write(makeMetafile(existing)); if f.close then f.close() end
|
||||
end
|
||||
|
||||
@@ -1055,7 +1062,7 @@ function vfs.chmod(path, perms)
|
||||
local meta = getFileMeta(path)
|
||||
local euid = (kernel.currentTask and (kernel.currentTask.euid or kernel.currentTask.uid)) or kernel.uid
|
||||
if euid ~= 0 and euid ~= meta.owner then error("EACCES") end
|
||||
updateMeta(path, function(e) e.perms = perms end)
|
||||
updateMeta(path, function(e) e.perms = perms end, nil, not perms)
|
||||
end
|
||||
|
||||
function vfs.fchmod(fd, perms)
|
||||
|
||||
Reference in new issue
Block a user