The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

problem using arguments in postwwwacct

Discussion in 'General Discussion' started by kiltannen, Oct 24, 2004.

  1. kiltannen

    kiltannen Registered

    Joined:
    Jul 17, 2004
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I have a script which is working in every respect - EXCEPT for the user password.

    the only result I seem to get from:
    $pass = $ARGV[2];

    is this:
    fd:3:6

    which seems singularly unhelpfull. [Not to mention obviously wrong]

    Does anybody know why this happens? Is my version of wwwacct broken in some way?

    regards
    Kilt
     
  2. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    The password isn't passed to the postwwwacct script in the @ARGV variable.

    $ARGV[2] contains password info, not the password. Check your wwwacct script around line 200 to see exactly what it does contain and what to do with it.
     
  3. kiltannen

    kiltannen Registered

    Joined:
    Jul 17, 2004
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    OK - I pasted this in directly after obtaining the user password argument - seemed like the right way to go BUT the script now dies - I believe right at this point...

    any ideas?

    here's the code I took from wwwacct:
    Code:
    if ($pass =~ /^fd:/) {
            chomp($pass);
    
            $SIG{'ALRM'} = sub {
                    print "\e[1m\e[31mTimeout while getting password from FD\e[0m\n\n";
    		die ;
            };
    
            my($passwdfd,$passwdlength);
            (undef,$passwdfd,$passwdlength) =split(/:/,$pass);
            $passwdfd =~ s/[\s\n\t]*//g;
            $passwdlength =~ s/[\s\n\t]*//g;
    
            alarm(30);
    
            open(FH, "<&=${passwdfd}") || die "$0: Error while reading from  password FD $!";
            $pass =<FH>;
            close(FH);
    
            chomp($pass);
    
            alarm(0);
    }
    Are there some globals that I need to add in some fashion?

    BTW - there were no error messages - it simply did not run the postwwwacct script at all...

    kilt
     
    #3 kiltannen, Oct 24, 2004
    Last edited: Oct 24, 2004
  4. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Put this:

    use CGI::Carp qw(fatalsToBrowser);

    near the beginning of the script and see what it says.


    Maybe remove
    Code:
            $SIG{'ALRM'} = sub {
                    print "\e[1m\e[31mTimeout while getting password from FD\e[0m\n\n";
    		die ;
            };
    
    from it.
     
  5. kiltannen

    kiltannen Registered

    Joined:
    Jul 17, 2004
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    OK,

    Here's the error message:

    Software error:

    /scripts/postwwwacct: Error while reading from password FD Bad file descriptor at /scripts/postwwwacct line 189.


    This is the specific line:
    Code:
    open(FH, "<&=${passwdfd}") || die "$0: Error while reading from  password FD $!";
    I am guessing this is because it is looking for the FH file and not finding it - I do PHP tolerably well - but I am thinking this is PERL or some other language, and that makes it hard...

    I did a search for this file name - not there on the server at all. - Maybe it's some kind of temp file?

    kilt
     
    #5 kiltannen, Oct 24, 2004
    Last edited: Oct 24, 2004
  6. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    I will take a look tomorrow and see what needs to be done.
     
Loading...

Share This Page