mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
improve accuracy of failsafe-check
also fix fsutil relabel after 8417098c
This commit is contained in:
parent
14bb299918
commit
999789c742
|
@ -355,6 +355,7 @@ class VFS(object):
|
|||
self.flags = flags # config options
|
||||
self.root = self
|
||||
self.dev = 0 # st_dev
|
||||
self.badcfg1 = False
|
||||
self.nodes: dict[str, VFS] = {} # child nodes
|
||||
self.histtab: dict[str, str] = {} # all realpath->histpath
|
||||
self.dbv: Optional[VFS] = None # closest full/non-jump parent
|
||||
|
@ -1554,6 +1555,8 @@ class AuthSrv(object):
|
|||
self.log(t, 1)
|
||||
axs = AXS()
|
||||
vfs = VFS(self.log_func, absreal("."), "", "", axs, {})
|
||||
if not axs.uread:
|
||||
vfs.badcfg1 = True
|
||||
elif "" not in mount:
|
||||
# there's volumes but no root; make root inaccessible
|
||||
zsd = {"d2d": True, "tcolor": self.args.tcolor}
|
||||
|
|
|
@ -131,9 +131,10 @@ class Fstab(object):
|
|||
if not self.trusted:
|
||||
# no mtab access; have to build as we go
|
||||
if "/" in rem:
|
||||
self.tab.add("idk", os.path.join(vn.vpath, rem.split("/")[0]))
|
||||
zs = os.path.join(vn.vpath, rem.split("/")[0])
|
||||
self.tab.add("idk", zs, zs)
|
||||
if rem:
|
||||
self.tab.add(nval, path)
|
||||
self.tab.add(nval, path, path)
|
||||
else:
|
||||
vn.realpath = nval
|
||||
|
||||
|
|
|
@ -1238,14 +1238,7 @@ class HttpCli(object):
|
|||
return self.tx_404(True)
|
||||
else:
|
||||
vfs = self.asrv.vfs
|
||||
if (
|
||||
not vfs.nodes
|
||||
and not vfs.axs.uread
|
||||
and not vfs.axs.uwrite
|
||||
and not vfs.axs.uget
|
||||
and not vfs.axs.uhtml
|
||||
and not vfs.axs.uadmin
|
||||
):
|
||||
if vfs.badcfg1:
|
||||
t = "<h2>access denied due to failsafe; check server log</h2>"
|
||||
html = self.j2s("splash", this=self, msg=t)
|
||||
self.reply(html.encode("utf-8", "replace"), 500)
|
||||
|
|
Loading…
Reference in a new issue