more fun with symlinks
This commit is contained in:
parent
118bdcc26e
commit
12219c1bea
@ -447,11 +447,20 @@ class VFS(object):
|
|||||||
|
|
||||||
def canonical(self, rem: str, resolve: bool = True) -> str:
|
def canonical(self, rem: str, resolve: bool = True) -> str:
|
||||||
"""returns the canonical path (fully-resolved absolute fs path)"""
|
"""returns the canonical path (fully-resolved absolute fs path)"""
|
||||||
rp = self.realpath
|
ap = self.realpath
|
||||||
if rem:
|
if rem:
|
||||||
rp += "/" + rem
|
ap += "/" + rem
|
||||||
|
|
||||||
return absreal(rp) if resolve else rp
|
return absreal(ap) if resolve else ap
|
||||||
|
|
||||||
|
def dcanonical(self, rem: str) -> str:
|
||||||
|
"""resolves until the final component (filename)"""
|
||||||
|
ap = self.realpath
|
||||||
|
if rem:
|
||||||
|
ap += "/" + rem
|
||||||
|
|
||||||
|
ad, fn = os.path.split(ap)
|
||||||
|
return os.path.join(absreal(ad), fn)
|
||||||
|
|
||||||
def ls(
|
def ls(
|
||||||
self,
|
self,
|
||||||
|
@ -2491,7 +2491,7 @@ class HttpCli(object):
|
|||||||
vpnodes.append([quotep(vpath) + "/", html_escape(node, crlf=True)])
|
vpnodes.append([quotep(vpath) + "/", html_escape(node, crlf=True)])
|
||||||
|
|
||||||
vn, rem = self.asrv.vfs.get(self.vpath, self.uname, False, False)
|
vn, rem = self.asrv.vfs.get(self.vpath, self.uname, False, False)
|
||||||
abspath = vn.canonical(rem)
|
abspath = vn.dcanonical(rem)
|
||||||
dbv, vrem = vn.get_dbv(rem)
|
dbv, vrem = vn.get_dbv(rem)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -1330,8 +1330,24 @@ def gen_filekey_dbg(
|
|||||||
|
|
||||||
assert log_ptn
|
assert log_ptn
|
||||||
if log_ptn.search(fspath):
|
if log_ptn.search(fspath):
|
||||||
t = "fk({}) salt({}) size({}) inode({}) fspath({})"
|
try:
|
||||||
log(t.format(ret[:8], salt, fsize, inode, fspath))
|
import inspect
|
||||||
|
|
||||||
|
ctx = ",".join(inspect.stack()[n][3] for n in range(2, 5))
|
||||||
|
except:
|
||||||
|
ctx = ""
|
||||||
|
|
||||||
|
try:
|
||||||
|
p2 = "a"
|
||||||
|
p2 = absreal(fspath)
|
||||||
|
if p2 != fspath:
|
||||||
|
raise Exception()
|
||||||
|
except:
|
||||||
|
t = "maybe wrong abspath for filekey;\norig: {}\nreal: {}"
|
||||||
|
log(t.format(fspath, p2), 1)
|
||||||
|
|
||||||
|
t = "fk({}) salt({}) size({}) inode({}) fspath({}) at({})"
|
||||||
|
log(t.format(ret[:8], salt, fsize, inode, fspath, ctx), 5)
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user