in reply to IPC::Run command is correctly constructed but does not have effect

I have this pinned down to this line:
422 $args->{keypass} = "'" . $self->getPassword("Private key passwor +d",1) . "'"

If the "'" concatenations are removed and a pass phrase without spaces is entered then the openssl commands execute from the script. If spaces are used then the command fails. If the password input is escaped with ' ' then the command simply does not execute from the script but does from the command line.

How do I allow private key pass-phrases to contain blanks and still get the script to operate?

  • Comment on Re: IPC::Run command is correctly constructed but does not have effect
  • Download Code

Replies are listed 'Best First'.
Re^2: IPC::Run command is correctly constructed but does not have effect
by Corion (Patriarch) on Oct 25, 2016 at 18:36 UTC

    Whatever is building the command line is doing it wrong:

    -passin pass:'test me'

    ... should likely be

    -passin 'pass:test me'

    For example, the following line building some command line will also not deal well with spaces in your password:

    $cmd = "-des3 -passout pass:$args->{keypass} ".$cmd if defined($args-> +{keypass});

    Also, this line:

    my $common_args = "-$args->{digest} -days $args->{days} ". " -key $cakey -passin pass:$args->{keypass}";

    As a general rule, if it doesn't work on the command line/shell prompt, there is very little that IPC::Run can do to make it work either.