Bug in the SFTP service with folder shared path

  • Hi, we may have a bug in the SFTP service.

    I'll try to explain with an example.

    If I initially create a shared folder with a path and then share it via SFTP, when I access it with SFTP, the shared folder is accessed correctly.

    So far, everything is fine (initial situation).

    I subsequently changed the path of the shared folder, and the new path seems to be correctly updated in the SFTP share as well. However, when I try to access it again via SFTP, the path pointed to by the SFTP service remains the old one, meaning the path change on the SFTP service doesn't seem to have been applied.

    The only way to fix things seems to be to remove the SFTP share and recreate it!

    Perhaps the problem could be due to the chroot mechanism used by the SFTP service?

    Note that the folders shared via FTP and SMB are correctly updated and point to the new path.

    The problem only occurs with the SFTP service.

    See the attached screenshots.


    Thanks as always for your valuable work.

    • Official Post

    I subsequently changed the path of the shared folder, and the new path seems to be correctly updated in the SFTP share as well. However, when I try to access it again via SFTP, the path pointed to by the SFTP service remains the old one, meaning the path change on the SFTP service doesn't seem to have been applied.

    The only way to fix things seems to be to remove the SFTP share and recreate it!

    Perhaps the problem could be due to the chroot mechanism used by the SFTP service?

    Yep, this is expected. It is very difficult to deal with a path changing. I would block it if I could but the path changing is outside the plugin. I really don't have the time or want to make the plugin's code super complicated to deal with this situation.

    omv 8.5.11-1 synchrony | 7.0 proxmox kernel

    plugins:

    omvextrasorg 8.0.3 | kvm 8.3.4 | compose 8.2.2 | cterm 8.0.4 | borgbackup 8.2.1 | tempmon 8.0.5 |

    mergerfs 8.0.4 | scripts 8.0.6 | writecache 8.3.0 | backup 8.1 | kernel 8.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Yep, this is expected. It is very difficult to deal with a path changing. I would block it if I could but the path changing is outside the plugin. I really don't have the time or want to make the plugin's code super complicated to deal with this situation.

    Okay. Perhaps a good compromise solution would be to generate an error when saving the new path to the shared folder if that folder is "mentioned" in the SFTP service, warning in the error message that the folder must first be unshared from the SFTP service before saving the new path.

    Thanks again for your work.

    • Official Post

    Perhaps a good compromise solution would be to generate an error when saving the new path to the shared folder if that folder is "mentioned" in the SFTP service, warning in the error message that the folder must first be unshared from the SFTP service before saving the new path.

    That would be a change in core OMV and would only be needed if the sftp plugin was installed (not many use it). Volker isn't going to add a external plugin specific change.


    I will look at this but don't count on anything changing. Changing paths in shared folders causes problems with a lot of things.

    omv 8.5.11-1 synchrony | 7.0 proxmox kernel

    plugins:

    omvextrasorg 8.0.3 | kvm 8.3.4 | compose 8.2.2 | cterm 8.0.4 | borgbackup 8.2.1 | tempmon 8.0.5 |

    mergerfs 8.0.4 | scripts 8.0.6 | writecache 8.3.0 | backup 8.1 | kernel 8.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Official Post

    try 8.0.1 in the repo now. I created a test script and one of the tests changes the sharedfolder path. It is working. If that doesn't work on your system, it is going to stay broken.

    omv 8.5.11-1 synchrony | 7.0 proxmox kernel

    plugins:

    omvextrasorg 8.0.3 | kvm 8.3.4 | compose 8.2.2 | cterm 8.0.4 | borgbackup 8.2.1 | tempmon 8.0.5 |

    mergerfs 8.0.4 | scripts 8.0.6 | writecache 8.3.0 | backup 8.1 | kernel 8.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!