in reply to Using SSH and SCP in a perl script with taint flag

Howdy!

Is $ENV{PATH} properly set? The errors from the system call lead my thoughts there.

yours,
Michael
  • Comment on Re: Using SSH and SCP in a perl script with taint flag

Replies are listed 'Best First'.
Re^2: Using SSH and SCP in a perl script with taint flag
by stefl (Acolyte) on May 28, 2015 at 16:03 UTC

    Thanks for replying! In my full application code, I have $ENV{PATH} = "/bin"; but I'm not sure if this is sufficient (I'm still new to perl). Would that meet the requirement, or is there something else I need to consider?
    Edit: I should say as well, I added that line to my test code and got the following error: "Cannot exec(ssh -e none <username>@<IP>): No such file or directory"

      Howdy!

      That would suggest that your PATH is lacking. Try "which ssh" from a command line to sort out where it actually is. Setting PATH explicitly as you do is something you have to do in taint mode; you just need to make sure you put everything in or invoke it with a full path.

      yours,
      Michael