On 2023-01-30, Gilles Querret wrote:

> I have to pass a secret to an Exec task (in a custom Ant plugin), and one
> way to do that is to pipe the output of another command line to this exec
> task.

Unfortunately there is no direct support for pipes.

> I've tried setInputString, but the passphrase is visible when using "ant
> -v", and I'd like to avoid that. I'd also like to avoid having to use
> temporary files with the passphrase, as this is usually not very secure.
> Is it possible to use the Redirector element from Java code ?

I quickly thought you could try using named pipes rather than temporary
files on an OS that supports it, but I must admit I've never tried that
myself from within Ant. And it would have the same security implications
as a temporary file anyway.

Using Redirector should work, you don't create a redirector but rather a
RedirectorElement and send that to ExecTask#addConfiguredRedirector.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org

Reply via email to