fix move/delete without -e2d (thx exci)

This commit is contained in:
ed 2021-09-07 21:20:34 +02:00
parent 156f13ded1
commit 02e3d44998

View file

@ -1455,11 +1455,13 @@ class Up2k(object):
self.log("rm {}\n {}".format(vpath, abspath)) self.log("rm {}\n {}".format(vpath, abspath))
_ = dbv.get(volpath, uname, *permsets[0]) _ = dbv.get(volpath, uname, *permsets[0])
with self.mutex: with self.mutex:
cur = None
try: try:
ptop = dbv.realpath ptop = dbv.realpath
cur, wark, _, _, _, _ = self._find_from_vpath(ptop, volpath) cur, wark, _, _, _, _ = self._find_from_vpath(ptop, volpath)
self._forget_file(ptop, volpath, cur, wark, True) self._forget_file(ptop, volpath, cur, wark, True)
finally: finally:
if cur:
cur.connection.commit() cur.connection.commit()
bos.unlink(abspath) bos.unlink(abspath)
@ -1583,7 +1585,7 @@ class Up2k(object):
def _find_from_vpath(self, ptop, vrem): def _find_from_vpath(self, ptop, vrem):
cur = self.cur.get(ptop) cur = self.cur.get(ptop)
if not cur: if not cur:
return None, None return [None] * 6
rd, fn = vsplit(vrem) rd, fn = vsplit(vrem)
q = "select w, mt, sz, ip, at from up where rd=? and fn=? limit 1" q = "select w, mt, sz, ip, at from up where rd=? and fn=? limit 1"