> hi all,
> 
> I've problem with executing an external program in my perl 
> program. I'm trying to build an server for managing pop3 
> accounts to which I can connect for example via php sockets.
> 
> For server/client enviroment I'm using Net::Server perl 
> module. Everything works all right, until I need to run 
> external 'pw' script. Then client connection to my server 
> closes without any errors messages.
> 
> If I use the same code (specified below) in my simple test 
> file everything works. 
> 
> This code is specified in child process of my server, which 
> is created after connection to it (in 'process_request' 
> subroutine of Net::Server::Fork module).
> 
> Here is the problematic part of code:
> 
> 
>         $tmp = "$pw_path useradd";
Is $pw_path the entire path or relative.
I've found on my freebsd box that I had to have the entire path to htpasswd to modift 
.htpasswd files.

Not sure if pw is the same as passwd in the sense that :
1) Unless you're root passwd changes the current user's passwd only, so you may be 
trying to change nobody or www password
2) Even if the script is running setuid you would still be changing only the script's 
owner's password.
But if it is then the script may be trying to change a passord it has no permission to.
FreeBSd is great about security and it wouldn't be too secure to let one script change 
everyone's passwords  via some evil troll.

>         $tmp .= " -n " . $username;
>         $tmp .= " -q -m -s " . $shell;
>         $tmp .= " -h 0";
> 
>         if( defined(open(PW,"| $tmp")) ) {      # here client 
> closes the connection    
>                 print PW $password, "\n";
>                 close PW or warn "$pw_path exited on $?: $!";
>         } else {
>                 print "$pw_path failure: $! ($?)";
>         }
>         1;

What's the one for, is this in a library?

> 
> 'pw' script needs some command line arguments defined in 
> variable $tmp which is passed to open. '-h 0' argument make 
> pw to wait for password to be specified on standart input, so 
> I need build an pipe to it.
> 
> I'm running FreeBSD 4.7 with perl 5.005_03 and Net-Server-0.83.
> 
> 
> Pease help me to figure what I have done wrong. 
> Thank you.
> 
> roman
> 
> 
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to