[ 
https://issues.apache.org/jira/browse/EXEC-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14910130#comment-14910130
 ] 

Michael Vorburger commented on EXEC-93:
---------------------------------------

Aloha.. is commons-exec still actively maintained? Can you guys merge this? I'm 
asking because this issue is affecting me too.. while fixing 
https://github.com/vorburger/MariaDB4j/issues/30 I've found that something à la 
addArgument("--datadir='/tmp/dir with space'") is not correctly handled, 
because the current (in commons-exec v1.3) code seems to assume that quotes are 
necessarily around a complete Argument, which is not correct, so in this 
example it seems to strip the trailing ' but leave the one after = and creates 
a mess. From what I glanced over in the attached EXEC-93.patch (not tried out / 
not code reviewed in more details) it would appear that this would fix that 
problem - it would be great to see this in a commons-exec v1.4 release.

> Handling of escaped values by StringUtils
> -----------------------------------------
>
>                 Key: EXEC-93
>                 URL: https://issues.apache.org/jira/browse/EXEC-93
>             Project: Commons Exec
>          Issue Type: Bug
>    Affects Versions: 1.3, 1.4
>            Reporter: Viktor Sadovnikov
>             Fix For: 1.4
>
>         Attachments: EXEC-93.patch
>
>
> An arguments can contain an environment variable value. For example, in 
> command {{cd /tmp && STORAGE_DIR=/tmp resolve.sh}} {{STORAGE_DIR=/tmp}} is an 
> argument, which is used by {{resolve.sh}}.
> However values of the variables can be more complicated and can contain 
> escaped quotes. Current implementation of 
> {{StringUtils#quoteArgument(String)}} does not handle these values correctly. 
> Attached patch contains fix for this problem and unit tests to demonstrate 
> the problem and the fix



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to