Results 1 to 8 of 8

Thread: FTP - Make permanent changes to stupid-ftpd.conf

  1. #1
    Join Date
    Nov 2004
    Location
    Trondheim, Norway
    Posts
    14

    FTP - Make permanent changes to stupid-ftpd.conf

    OK, my first posting in the forum comes here..

    I've just installed the custom firmware ver 1.8.1.7-3 (looks very cool!!). I've creating my custom stupid-ftpd.conf file and made it permanent with flashfs-command. The problem is that when I plug in a USB-drive the stupid-ftpd starts and it replaces my stupid-ftpd.conf file with a default one. How can I avoid my custom stupid-ftpd.conf file being replaced?

  2. #2
    Join Date
    Apr 2004
    Location
    Netherlands
    Posts
    1,308
    This config file in /tmp is being created whithin a script. I have no idea about how to change this ...

  3. #3
    You cannot avoid the auto-usb program to run. This one run the ftp process and create on the fly stupid-ftpd.conf file.

    You can try to disable the "enable ftp server" option in USB application menu.

    Then you can make sure the stupid-ftpd process is not run, and make change permanent using the instruction in here

    Otherwise, you'll have to make a script to overwrite the stupid-ftp.conf and maybe use a cron to run is on a regular basis

  4. #4
    Join Date
    Nov 2004
    Location
    Trondheim, Norway
    Posts
    14

    Using post-boot

    Still havent found a sollution. Tried adding the following lines to the post-boot:

    killall stupid-ftpd
    cp /tmp/stupid-ftpd.conf.tmp /tmp/stupid-ftpd.conf
    stupid-ftpd

    But it didn't work. Seems theese commands get executed before the USB is mounted and the "default" stupid-ftpd is started. Can I make a script like the one above that waits some seconds before beeing executed?

  5. #5
    Join Date
    Apr 2004
    Location
    Netherlands
    Posts
    1,308
    Quote Originally Posted by Bertie
    Still havent found a sollution. Tried adding the following lines to the post-boot:

    killall stupid-ftpd
    cp /tmp/stupid-ftpd.conf.tmp /tmp/stupid-ftpd.conf
    stupid-ftpd

    But it didn't work. Seems theese commands get executed before the USB is mounted and the "default" stupid-ftpd is started. Can I make a script like the one above that waits some seconds before beeing executed?
    1) Disable stupid-ftp in webinterface
    2) Place following code in the post-boot script:
    http://wl500g.info/showpost.php?p=6290&postcount=26
    3) After the delay code, copy your stupid-ftp config to /temp
    4) Also after delay start stupid-ftp daemon

    The proper place to store you custom configuration is in /usr/local/etc. So, save it there with flashfs save and commit.
    Try this and tell us if it works
    Last edited by Styno; 28-11-2004 at 00:56.

  6. #6
    Join Date
    Nov 2004
    Location
    Trondheim, Norway
    Posts
    14
    Still no luck. I'm a Linux-beginner so maybe it's some stupid mistake I'm doing.. Anyway, I tried edit my post-boot script so it waited until folder /tmp/harddisk/ftp_pub is availiable. No luck. So I tried waiting for the process stupid-ftpd instead. Still no luck. My post-boot contains the following:

    #!/bin/sh
    i=0
    while [$i -le 30]; do
    e=ps -ef | grep -c "[s]tupid-ftpd"
    if [$e -gt 0] ; then
    killall stupid-ftpd
    cp /usr/local/etc/stupid-ftpd/stupid-ftpd.conf.aon /tmp/stupid-ftpd.conf
    stupid-ftpd
    break;
    fi
    sleep 1
    i=(($i + 1))
    done

  7. #7
    Join Date
    Apr 2004
    Location
    Netherlands
    Posts
    1,308
    Is it possible to start the stupid-ftp daemon from a telnet session at all? If it does, my previous post should do the trick. If not I'm out of options...

  8. #8
    Join Date
    Nov 2004
    Location
    Trondheim, Norway
    Posts
    14

    I did it!

    Finally! I did it! (Not that it required very advanced sollutions...) Thanks hugo and Styno for your time. The main sollution was to replace the increment line in the delay script with

    : $((i = $i + 1 ))

    Also did the check on the file stupid-ftpd.conf, that is I delay the boot until this file exist. The whole script follows..

    i=0
    while [ $i -le 30 ]; do
    if [ -e /tmp/stupid-ftpd.conf ] ; then
    killall stupid-ftpd
    cp /tmp/local/etc/stupid-ftpd/stupid-ftpd.conf.aon /tmp/stupid-ftpd.conf
    stupid-ftpd
    break
    fi
    sleep 1
    : $((i = $i + 1 ))
    done

    A security issue might be that if the script for some reason times out (although 30 secs should be enough), the ftp deamon may run with the default stupid-ftpd.conf which enables anonymous access. I'll see to adding some code that, if file /tmp/stupid-ftpd.conf is not found, kills any stupid-ftpd running ("killall stupid-ftpd") and unmounts any connected USB-drive ("umount /tmp/harddisk").

Similar Threads

  1. wl500g deluxe - ftpd-topfield
    By Reinder in forum WL-500g Custom Development
    Replies: 8
    Last Post: 25-01-2008, 15:49
  2. pppoe.conf
    By Vertygo in forum WL-500g Q&A
    Replies: 2
    Last Post: 26-09-2005, 14:37
  3. Replies: 9
    Last Post: 27-01-2005, 16:24
  4. stupid ftpd - settings erased
    By rdk in forum WL-500g Q&A
    Replies: 8
    Last Post: 20-08-2004, 17:21

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •