You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Aleksandr Dubinsky (JIRA)" <ji...@apache.org> on 2015/10/25 12:06:27 UTC

[jira] [Commented] (EXEC-93) Handling of escaped values by StringUtils

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

Aleksandr Dubinsky commented on EXEC-93:
----------------------------------------

Can someone bring an example when quoting anything makes sense? Quotes are a feature of the shell to distinguish when one argument ends and another begins. We're doing this explicitly with calls to `addArgument`. Why is it doing any quoting at all?

> 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)