[Proftpd-user] Exclusive locks when receiving files? - proftpd

This is a discussion on [Proftpd-user] Exclusive locks when receiving files? - proftpd ; I have searched the Internet and the list archives for this question and came up empty. I'd like to be able to use proftpd to replace some Windows FTP servers and migrate to encrypted sessions with TLS. We will use ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: [Proftpd-user] Exclusive locks when receiving files?

  1. [Proftpd-user] Exclusive locks when receiving files?

    I have searched the Internet and the list archives for this question and
    came up empty.

    I'd like to be able to use proftpd to replace some Windows FTP servers
    and migrate to encrypted sessions with TLS. We will use samba to grant
    other machines running Windows access to the incoming files.

    The problem that we have is that the Windows FTP servers open new files
    with exclusive locks, making it so that the retrieval software is not
    allowed to move the file until the FTP transfer finishes. Linux-based
    solutions typically use shared locks, which mean that other processes
    are perfectly free to read the file and delete it before the transfer is
    done - a real problem.

    Is there any way to get proftpd to open received files with exclusive
    locks so that samba is unable to manipulate the file until it's
    finished? Would it be terribly hard to hack the code myself? I have
    some experience with coding, but have never done it for a living.

    A messy alternative would be if proftpd can do something like the ncftpd
    event daemon. I could write a script that looks for events and moves
    files to a pickup area. Alternatively I could write a script that
    watches logfiles and lsof output. I have a design in my head to do
    this, but I don't plan to write it unless I must.

    Ultimately I have the same question with regards to sftp in openssh, but
    I'll pursue that with them.

    Thanks,
    Shawn



    -------------------------------------------------------------------------
    This SF.net email is sponsored by: Microsoft
    Defy all challenges. Microsoft(R) Visual Studio 2008.
    http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
    _______________________________________________
    ProFTPD Users List
    Unsubscribe problems?
    http://www.proftpd.org/list-unsub.html


  2. Re: [Proftpd-user] Exclusive locks when receiving files?

    On Sun, Jun 01, 2008 at 11:36:32AM -0600, Shawn Heisey wrote:

    Hi,

    > The problem that we have is that the Windows FTP servers open new files
    > with exclusive locks, making it so that the retrieval software is not
    > allowed to move the file until the FTP transfer finishes. Linux-based
    > solutions typically use shared locks, which mean that other processes
    > are perfectly free to read the file and delete it before the transfer is
    > done - a real problem.


    Could the HidenStores option be a workaround for you?
    http://www.nl.proftpd.org/docs/direc...l#HIDDENSTORES


    > A messy alternative would be if proftpd can do something like the ncftpd
    > event daemon. I could write a script that looks for events and moves
    > files to a pickup area. Alternatively I could write a script that
    > watches logfiles and lsof output. I have a design in my head to do
    > this, but I don't plan to write it unless I must.


    That should be possible http://www.castaglia.org/proftpd/modules/mod_exec.html

    Sven
    --
    If God passed a mic to me to speak
    I'd say stay in bed, world
    Sleep in peace
    [The Cardigans - 03:45: No sleep]

    -------------------------------------------------------------------------
    This SF.net email is sponsored by: Microsoft
    Defy all challenges. Microsoft(R) Visual Studio 2008.
    http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
    _______________________________________________
    ProFTPD Users List
    Unsubscribe problems?
    http://www.proftpd.org/list-unsub.html


+ Reply to Thread