mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 17:12: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.flags = flags # config options
|
||||||
self.root = self
|
self.root = self
|
||||||
self.dev = 0 # st_dev
|
self.dev = 0 # st_dev
|
||||||
|
self.badcfg1 = False
|
||||||
self.nodes: dict[str, VFS] = {} # child nodes
|
self.nodes: dict[str, VFS] = {} # child nodes
|
||||||
self.histtab: dict[str, str] = {} # all realpath->histpath
|
self.histtab: dict[str, str] = {} # all realpath->histpath
|
||||||
self.dbv: Optional[VFS] = None # closest full/non-jump parent
|
self.dbv: Optional[VFS] = None # closest full/non-jump parent
|
||||||
|
@ -1554,6 +1555,8 @@ class AuthSrv(object):
|
||||||
self.log(t, 1)
|
self.log(t, 1)
|
||||||
axs = AXS()
|
axs = AXS()
|
||||||
vfs = VFS(self.log_func, absreal("."), "", "", axs, {})
|
vfs = VFS(self.log_func, absreal("."), "", "", axs, {})
|
||||||
|
if not axs.uread:
|
||||||
|
vfs.badcfg1 = True
|
||||||
elif "" not in mount:
|
elif "" not in mount:
|
||||||
# there's volumes but no root; make root inaccessible
|
# there's volumes but no root; make root inaccessible
|
||||||
zsd = {"d2d": True, "tcolor": self.args.tcolor}
|
zsd = {"d2d": True, "tcolor": self.args.tcolor}
|
||||||
|
|
|
@ -131,9 +131,10 @@ class Fstab(object):
|
||||||
if not self.trusted:
|
if not self.trusted:
|
||||||
# no mtab access; have to build as we go
|
# no mtab access; have to build as we go
|
||||||
if "/" in rem:
|
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:
|
if rem:
|
||||||
self.tab.add(nval, path)
|
self.tab.add(nval, path, path)
|
||||||
else:
|
else:
|
||||||
vn.realpath = nval
|
vn.realpath = nval
|
||||||
|
|
||||||
|
|
|
@ -1238,14 +1238,7 @@ class HttpCli(object):
|
||||||
return self.tx_404(True)
|
return self.tx_404(True)
|
||||||
else:
|
else:
|
||||||
vfs = self.asrv.vfs
|
vfs = self.asrv.vfs
|
||||||
if (
|
if vfs.badcfg1:
|
||||||
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
|
|
||||||
):
|
|
||||||
t = "<h2>access denied due to failsafe; check server log</h2>"
|
t = "<h2>access denied due to failsafe; check server log</h2>"
|
||||||
html = self.j2s("splash", this=self, msg=t)
|
html = self.j2s("splash", this=self, msg=t)
|
||||||
self.reply(html.encode("utf-8", "replace"), 500)
|
self.reply(html.encode("utf-8", "replace"), 500)
|
||||||
|
|
Loading…
Reference in a new issue