| Summary: | (6.4.0) CommandContext not properly handling special text | |||
|---|---|---|---|---|
| Product: | [JBoss] JBoss Enterprise Application Platform 6 | Reporter: | Miles Tjandrawidjaja <mtjandra> | |
| Component: | CLI | Assignee: | jboss-set | |
| Status: | CLOSED EOL | QA Contact: | Petr Kremensky <pkremens> | |
| Severity: | medium | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | unspecified | CC: | bbaranow, brian.stansberry, cdewolf | |
| Target Milestone: | --- | |||
| Target Release: | EAP 6.4.0 | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | Doc Type: | Bug Fix | ||
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1134303 (view as bug list) | Environment: | ||
| Last Closed: | 2019-08-19 12:46:23 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Bug Depends On: | ||||
| Bug Blocks: | 1134303, 1134309 | |||
|
Description
Miles Tjandrawidjaja
2013-10-17 19:47:32 UTC
AFAICS, it's in the jboss-dmr ModelNode.fromString(str) parser. If you try
data-source add --name=jbpmDS --jndi-name=java:jboss/datasources/jbpmDS --driver-name=h2 --user-name=soa --password=\"soa\" --connection-url=jdbc:h2:file:${jboss.server.data.dir}/ô/h2/soa;mvcc=true
i.e. w/o quotes then it'll be parsed by the CLI parser and it'll work.
Every value is first parsed with the DMR parser if that fails then the CLI is trying its own parser. Usually, a (simple) quoted string will be parsed by the DMR parser successfully and the result will used for the operation request.
And this was fixed as https://issues.jboss.org/browse/DMR-8. (In reply to Alexey Loubyansky from comment #2) > And this was fixed as https://issues.jboss.org/browse/DMR-8. Actually, that issue is a bit different and targets more JSON strings. To make sure this issue is covered I created https://issues.jboss.org/browse/DMR-10 I have tried without quotes for the --connection url.
Result:
<connection-url>true</connection-url>
Expected:
<connection-url>jdbc:h2:file:${jboss.server.data.dir}/ô/h2/soa;mvcc=true</connection-url>
With Quotes
================
String line = "data-source add --name=jbpmDS --jndi-name=java:jboss/datasources/jbpmDS --driver-name=h2 --user-name=soa --password=\"soa\" --connection-url=\"jdbc:h2:file:${jboss.server.data.dir}/ô/h2/soa;mvcc=true\"";
================
<datasource jndi-name="java:jboss/datasources/jbpmDS" pool-name="jbpmDS" enabled="false">
<connection-url>jdbc:h2:file:${jboss.server.data.dir}/?/h2/soa;mvcc=true</connection-url>
<driver>h2</driver>
<security>
<user-name>soa</user-name>
<password>soa</password>
</security>
</datasource>
Without Quotes
================
String line = "data-source add --name=jbpmDS --jndi-name=java:jboss/datasources/jbpmDS --driver-name=h2 --user-name=soa --password=\"soa\" --connection-url=jdbc:h2:file:${jboss.server.data.dir}/ô/h2/soa;mvcc=true";
================
<datasource jndi-name="java:jboss/datasources/jbpmDS" pool-name="jbpmDS" enabled="false">
<connection-url>true</connection-url>
<driver>h2</driver>
<security>
<user-name>soa</user-name>
<password>soa</password>
</security>
</datasource>
For future evaluation purposes, this is cased in the DMR at the ModelNode.fromString(str) method. The existing string-to-byte-array conversion is limited to the 'us-ascii' character set for use in the cookcc parsing library. Lloyd is working on a refactor that removes the cookcc library, but I don't know the expected release for it. |