mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 00:52:16 -06:00
smb: fix file rename
This commit is contained in:
parent
fb21bfd6d6
commit
4b2b4ed52d
2
.vscode/launch.py
vendored
Normal file → Executable file
2
.vscode/launch.py
vendored
Normal file → Executable file
|
@ -1,3 +1,5 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# takes arguments from launch.json
|
# takes arguments from launch.json
|
||||||
# is used by no_dbg in tasks.json
|
# is used by no_dbg in tasks.json
|
||||||
# launches 10x faster than mspython debugpy
|
# launches 10x faster than mspython debugpy
|
||||||
|
|
|
@ -760,6 +760,7 @@ and some minor issues,
|
||||||
* listens on the first `-i` interface only (default = 0.0.0.0 = all)
|
* listens on the first `-i` interface only (default = 0.0.0.0 = all)
|
||||||
* login doesn't work on winxp, but anonymous access is ok -- remove all accounts from copyparty config for that to work
|
* login doesn't work on winxp, but anonymous access is ok -- remove all accounts from copyparty config for that to work
|
||||||
* win10 onwards does not allow connecting anonymously / without accounts
|
* win10 onwards does not allow connecting anonymously / without accounts
|
||||||
|
* on windows, creating a new file through rightclick --> new --> textfile throws an error due to impacket limitations -- hit OK and F5 to get your file
|
||||||
* python3 only
|
* python3 only
|
||||||
* slow
|
* slow
|
||||||
|
|
||||||
|
|
|
@ -198,7 +198,10 @@ class SMB(object):
|
||||||
vp2 = vp2.lstrip("/")
|
vp2 = vp2.lstrip("/")
|
||||||
ap2 = self._v2a("rename", vp2, vp1)[1]
|
ap2 = self._v2a("rename", vp2, vp1)[1]
|
||||||
self.hub.up2k.handle_mv(LEELOO_DALLAS, vp1, vp2)
|
self.hub.up2k.handle_mv(LEELOO_DALLAS, vp1, vp2)
|
||||||
bos.makedirs(ap2, exist_ok=True)
|
try:
|
||||||
|
bos.makedirs(ap2)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
def _mkdir(self, vpath: str) -> None:
|
def _mkdir(self, vpath: str) -> None:
|
||||||
return bos.mkdir(self._v2a("mkdir", vpath)[1])
|
return bos.mkdir(self._v2a("mkdir", vpath)[1])
|
||||||
|
|
|
@ -1923,8 +1923,8 @@ def sendfile_kern(
|
||||||
n = os.sendfile(out_fd, in_fd, ofs, req)
|
n = os.sendfile(out_fd, in_fd, ofs, req)
|
||||||
stuck = 0
|
stuck = 0
|
||||||
except OSError as ex:
|
except OSError as ex:
|
||||||
|
# client stopped reading; do another select
|
||||||
d = time.time() - stuck
|
d = time.time() - stuck
|
||||||
log("sendfile stuck for {:.3f} sec: {!r}".format(d, ex), "90")
|
|
||||||
if d < 3600 and ex.errno == errno.EWOULDBLOCK:
|
if d < 3600 and ex.errno == errno.EWOULDBLOCK:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue