Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ac2pic committed Oct 29, 2023
1 parent a9f8792 commit dca46c6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/commands.nim
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ proc dumpSave(cmd: ClientRequest, client: AsyncSocket, mountId: string) {.async.
let sourceFile = joinPath(mntFolder, relativePath)
try:
copyFile(sourceFile, targetFile)
except IOError:
respondWithError(client, "E:COPY_FAILED")
failed = true
break
except OSError:
respondWithError(client, "E:COPY_FAILED")
failed = true
Expand Down Expand Up @@ -208,10 +212,15 @@ proc updateSave(cmd: ClientRequest, client: AsyncSocket, mountId: string) {.asyn
let sourcePath = joinPath(cmd.sourceFolder, relativePath)
try:
copyFile(sourcePath, targetPath)
except IOError:
respondWithError(client, "E:COPY_FAILED")
failed = true
break
except OSError:
respondWithError(client, "E:COPY_FAILED")
failed = true
break

discard setuid(0)
discard umountSave(mntFolder, handle, false)
discard rmdir(mntFolder.cstring)
Expand Down

0 comments on commit dca46c6

Please sign in to comment.