in reply to Win32::netAdmin pwd question

There is no way possible to retreive a user's plaintext password via the Win32 API. When you call UserGetAttributes(), the $password variable ends up being undefined.

I'm not sure why the FTP login call isn't die()ing. But, you should first turn on warnings and use strict if you're not already. Also, take out the quotes around the username & password for your login call, like this:

$ftp->login($utente,$password) || die $!;

Replies are listed 'Best First'.
Re: Re: Win32::netAdmin pwd question
by Anonymous Monk on Feb 25, 2003 at 19:31 UTC
    hello,

    the $password is defined I tested it with:

    if defined $password print "defined pwd";

    and it print it.
    cheers lor*
      I read through the source for Win32::NetAdmin, and it uses the Win32 API call "NetUserGetInfo". According to Microsoft's documentation, "The NetUserEnum and NetUserGetInfo functions return a NULL pointer to maintain password security."

      So, the $password is not set with a valid password. Have you tried printing out the value to see if it's correct? Maybe there's junk data in there, or maybe something else in your program is setting it by accident.