in reply to Re^3: Passing values to htdigest from command line problem
in thread Passing values to htdigest from command line problem

This node falls below the community's minimum standard of quality and will not be displayed.
  • Comment on Re^4: Passing values to htdigest from command line problem

Replies are listed 'Best First'.
Re^5: Passing values to htdigest from command line problem
by chargrill (Parson) on Oct 11, 2006 at 07:31 UTC

    I'm tempted to say "yes".

    However...

    I expect you might find a module meeting your expectations -- I haven't run htdigest, but I expect that the problem is that the htdigest apache utility expects to be run interactively, expecting you to interact with it.



    --chargrill
    s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)
      From IO::Tty README: "Sorry, ActiveState Perl on Windows is NOT supported, basically because there are no pseudo-terminals under Windows."
      So Expect.pm isnt an option any more.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re^5: Passing values to htdigest from command line problem
by jaf (Initiate) on Jan 09, 2007 at 10:28 UTC
    Have you tried the following from the commandline?

    perl -MDigest::MD5 -e'print Digest::MD5::md5_hex("user:realm:password")'

    (that should be all on one line)? It should produce the MD5 password string. If that works, but the following into your perl script:

    use Digest::MD5;
    ...
    my $MDpasswd=Digest::MD5::md5_hex("$user:$realm:$password");

    where $user is the 'user' variable generated within your script, $realm is the 'realm' variable generated within your script and $password is the plain text password generated within your script (perhaps the code between 'use Digest...' and 'my $MDpasswd=...' opens up the files you were mentioning and reads from it the user, realm and uncoded passwords).

    Hope this helps