Problem calling script with arguments

F

Florian Lindner

Hello,

I have a 3rd party perl script:

head -n 1 /usr/sbin/ftpasswd
#!/usr/bin/perl

I want to write data to stdin and read from stdout:

proc = Popen( ["/usr/bin/perl", "/usr/sbin/ftpasswd" "--hash", "--stdin"],
stdout=PIPE, stdin=PIPE)

output, input = proc.communicate(pwd)
return output.strip()

Since pwd comes from a non-trusted source I don't want to use shell=True.

The arguments to the perl interpreter do not seem to right:

Can't open perl script "/usr/sbin/ftpasswd--hash": No such file or directory

Adding a leading " " to "--hash" does not help.

How can I use that script and achieve something like

# echo "123" | ftpasswd --hash --stdin
ftpasswd: $1$8BuLAqCl$y/URBN/OCSLsKtnu8nFHH0

Thanks!

Florian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top