Menu

#5458 When moving files using File Manager, if the processes is terminated prematurely all the source files get deleted

1.970
open
nobody
8
2021-03-02
2021-03-01
samsirry
No

The File Manager cut-paste operation works in the background.
I once tried to move a couple of terabytes from one drive to another using this method, then I changed my mind shortly after the operation started.
Since that the UI doesn't provide a way to cancel the operation, I went ahead and killed the process that's doing the move (I don't remember exactly what program was it, but it was something unexpected for a file copy operation, something like tar maybe).
It seems that when the process got killed webmin assumed that the copy was completed successfully and proceeded to delete all the source files, then I found out a little too late.

I consider this a high priority bug because it can cause irreversible data loss in case the file copy process crashes for whatever unseen reason.

Discussion

  • Ilia

    Ilia - 2021-03-01

    Hi,

    Thanks for reporting this. Taking a quick look at the code I can see now this could happening. This is an old code.

    I will fix it for the future release, and maybe add a cancel button to stop the process for large files.

     
  • Ilia

    Ilia - 2021-03-01

    Hey, give it a try. This patch should prevent deleting a file if it wasn't copied properly.

     
  • samsirry

    samsirry - 2021-03-02

    Thank you so much. I'll test it in a couple of days (as soon as I get my hands free).

    But can you please recommend a procedure to get the new code? I mean, I'm not much familiar with git. Is there a nightly package I can yum or will I be using a local copy using git somehow?

     
  • Ilia

    Ilia - 2021-03-02

    The file that needes to be edited can be found on the commit.

     

Log in to post a comment.