mirror of
https://github.com/9001/copyparty.git
synced 2025-09-30 21:52:27 -06:00
ftp: fix unmapped root; closes #827
This commit is contained in:
parent
e1ea9852c6
commit
280815f158
|
@ -279,6 +279,10 @@ class FtpFs(AbstractedFS):
|
||||||
def chdir(self, path: str) -> None:
|
def chdir(self, path: str) -> None:
|
||||||
nwd = join(self.cwd, path)
|
nwd = join(self.cwd, path)
|
||||||
vfs, rem = self.hub.asrv.vfs.get(nwd, self.uname, False, False)
|
vfs, rem = self.hub.asrv.vfs.get(nwd, self.uname, False, False)
|
||||||
|
if not vfs.realpath:
|
||||||
|
self.cwd = nwd
|
||||||
|
return
|
||||||
|
|
||||||
ap = vfs.canonical(rem)
|
ap = vfs.canonical(rem)
|
||||||
try:
|
try:
|
||||||
st = bos.stat(ap)
|
st = bos.stat(ap)
|
||||||
|
@ -288,12 +292,9 @@ class FtpFs(AbstractedFS):
|
||||||
# returning 550 is library-default and suitable
|
# returning 550 is library-default and suitable
|
||||||
raise FSE("No such file or directory")
|
raise FSE("No such file or directory")
|
||||||
|
|
||||||
if vfs.realpath:
|
|
||||||
avfs = vfs.chk_ap(ap, st)
|
avfs = vfs.chk_ap(ap, st)
|
||||||
if not avfs:
|
if not avfs:
|
||||||
raise FSE("Permission denied", 1)
|
raise FSE("Permission denied", 1)
|
||||||
else:
|
|
||||||
avfs = vfs
|
|
||||||
|
|
||||||
self.cwd = nwd
|
self.cwd = nwd
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue