Pure-authd not passing variables to pure-ftpd

Discussion in 'Server Operation' started by welshdemon, Feb 8, 2011.

  1. welshdemon

    welshdemon New Member

    Hi, after days of struggling, I hope somebody might have an idea.

    I have set up pure-authd and pure-ftpd. They are both running, I have created the socket etc.

    In my authentication module (a php script) for testing purposes I have done a vardump in to a file, and have realised that pure-authd is not passing on any variables (username, password of the current person trying to log in via ftp) to the PHP script.

    Would anybody have any ideas why this is?

    It has taken me about 3 days to write the authentication module (I am fairly new to PHP and Linux) which I am sure is working (have tested it vigorously on the command line and things), but after 10 hours wondering why it wouldnt work and messing about with the script, I have realised that the variables were never even getting in to the script in the first place! DOH!!!

    I am running the processes such as this:

    pure-authd -s /var/run/ftpd.sock -r /usr/bin/ftpauth.php &

    /usr/sbin/pure-config.pl /etc/pure-ftpd/pure-ftpd.conf

    (pure-ftpd.conf has this line in it and enabled: )
    ExtAuth /var/run/ftpd.sock

    Everything seems as if it is working other than this. For instance, when testing the setup with a very basic auth module which doesnt require a username or password (the basic module just passes "auth_ok:1" to pure-ftpd and the user is then logged in), I can log in to the FTP server fine.

    But like I say, a vardump ($argv) on my proper PHP authentication script would suggest that no username or password are being passed to it.

    If somebody has any idea I would be very grateful!

    Regards,

    Paul.
     
    Last edited: Feb 8, 2011
  2. welshdemon

    welshdemon New Member

    Fixed.

    As a newbie to PHP and Linux. I was trying to use getopt and argv and various other methods to get the variables in to the PHP script.

    It turns out I had to use $_env in my PHP script.

    $AUTHD_ACCOUNT = $_ENV["AUTHD_ACCOUNT"];

    I am posting this in case anybody ever gets stuck and stumbles across this thread from google.
     

Share This Page