Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WFCORE-2592] Special characters escaping in service.bat #4574

Merged
merged 1 commit into from
Jul 22, 2021

Conversation

lvydra
Copy link
Contributor

@lvydra lvydra commented Apr 27, 2021

@github-actions github-actions bot added the deps-ok Dependencies have been checked, and there are no significant changes label Apr 27, 2021
@lvydra
Copy link
Contributor Author

lvydra commented Apr 27, 2021

The purpose of this PR is to enable escaping of special characters, which are part of windows command line syntax, for jbosspass argument.
The whole password argument should be put in double quotes, then individual characters can be escaped by:

  1. ; and # which are part of procrun syntax can be escaped by putting them into single quotes (this works even before this PR)
  2. & < > | ^ ( ) ! as part of windows command line syntax can be escaped with ^
  3. other special characters like % , ; \ * ? . = [ ] are ok

@wildfly-ci
Copy link

Core - Full Integration Build 10562 outcome was FAILURE using a merge of c86d2a7
Summary: Tests failed: 2 (2 new), passed: 7761, ignored: 150 Build time: 04:16:02

Failed tests

org.wildfly.test.integration.elytron.ssl.AutomaticSelfSignedCertificateNotGeneratedTestCase.testSelfSignedCertificateNotGeneratedWithGenerateAttributeUndefined: java.lang.AssertionError: Failed to execute line '/subsystem=elytron/key-manager=AutomaticSelfSignedCertificateNotGeneratedTestCase:undefine-attribute(name=generate-self-signed-certificate-host)'
org.jboss.as.cli.CommandLineException: {
    "outcome" => "failed",
    "failure-description" => "WFLYCTL0216: Management resource '[
    (\"subsystem\" => \"elytron\"),
    (\"key-manager\" => \"AutomaticSelfSignedCertificateNotGeneratedTestCase\")
]' not found",
    "rolled-back" => true
}
 at org.jboss.as.cli.handlers.OperationRequestHandler.handle(OperationRequestHandler.java:95)
 at org.jboss.as.cli.impl.CommandContextImpl.handleOperation(CommandContextImpl.java:1886)
 at org.jboss.as.cli.impl.CommandContextImpl.handle(CommandContextImpl.java:875)
 at org.jboss.as.test.integration.management.util.CLIWrapper.sendLine(CLIWrapper.java:218)
 at org.jboss.as.test.integration.management.util.CLIWrapper.sendLine(CLIWrapper.java:244)
 at org.wildfly.test.integration.elytron.ssl.AutomaticSelfSignedCertificateNotGeneratedTestCase.testSelfSignedCertificateNotGeneratedWithGenerateAttributeUndefined(AutomaticSelfSignedCertificateNotGeneratedTestCase.java:126)

java.lang.AssertionError: 
Failed to execute line '/subsystem=elytron/key-manager=AutomaticSelfSignedCertificateNotGeneratedTestCase:undefine-attribute(name=generate-self-signed-certificate-host)'
org.jboss.as.cli.CommandLineException: {
    "outcome" => "failed",
    "failure-description" => "WFLYCTL0216: Management resource '[
    (\"subsystem\" => \"elytron\"),
    (\"key-manager\" => \"AutomaticSelfSignedCertificateNotGeneratedTestCase\")
]' not found",
    "rolled-back" => true
}
	at org.jboss.as.cli.handlers.OperationRequestHandler.handle(OperationRequestHandler.java:95)
	at org.jboss.as.cli.impl.CommandContextImpl.handleOperation(CommandContextImpl.java:1886)
	at org.jboss.as.cli.impl.CommandContextImpl.handle(CommandContextImpl.java:875)
	at org.jboss.as.test.integration.management.util.CLIWrapper.sendLine(CLIWrapper.java:218)
	at org.jboss.as.test.integration.management.util.CLIWrapper.sendLine(CLIWrapper.java:244)
	at org.wildfly.test.integration.elytron.ssl.AutomaticSelfSignedCertificateNotGeneratedTestCase.testSelfSignedCertificateNotGeneratedWithGenerateAttributeUndefined(AutomaticSelfSignedCertificateNotGeneratedTestCase.java:126)

	at org.jboss.as.test.integration.management.util.CLIWrapper.sendLine(CLIWrapper.java:222)
	at org.jboss.as.test.integration.management.util.CLIWrapper.sendLine(CLIWrapper.java:244)
	at org.wildfly.test.integration.elytron.ssl.AutomaticSelfSignedCertificateNotGeneratedTestCase.testSelfSignedCertificateNotGeneratedWithGenerateAttributeUndefined(AutomaticSelfSignedCertificateNotGeneratedTestCase.java:126)
------- Stdout: -------
 [0m08:04:37,924 INFO  [org.jboss.as.repository] (management-handler-thread - 1) WFLYDR0001: Content added at location /store/work/tc-work/37b47ae8b9c60325/full/testsuite/integration/elytron/target/wildfly/standalone/data/content/15/27b8e95908d8512fd10a9bb21fe11d3722af03/content
 [0m [0m08:04:37,926 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0027: Starting deployment of "AutomaticSelfSignedCertificateNotGeneratedTestCase.war" (runtime-name: "AutomaticSelfSignedCertificateNotGeneratedTestCase.war")
 [0m [0m08:04:37,981 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 40) WFLYUT0021: Registered web context: '/AutomaticSelfSignedCertificateNotGeneratedTestCase' for server 'default-server'
 [0m [0m08:04:37,989 INFO  [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0010: Deployed "AutomaticSelfSignedCertificateNotGeneratedTestCase.war" (runtime-name : "AutomaticSelfSignedCertificateNotGeneratedTestCase.war")
 [0m


org.wildfly.test.integration.elytron.ssl.AutomaticSelfSignedCertificateNotGeneratedTestCase.testSelfSignedCertificateNotGeneratedIfKeyStoreFileExists: java.lang.AssertionError
	at org.wildfly.test.integration.elytron.ssl.AutomaticSelfSignedCertificateNotGeneratedTestCase.testSelfSignedCertificateNotGeneratedIfKeyStoreFileExists(AutomaticSelfSignedCertificateNotGeneratedTestCase.java:100)


@github-actions
Copy link

There has been no activity on this PR for 45 days. It will be auto-closed after 90 days.

@github-actions github-actions bot added the Stale label Jun 12, 2021
Comment on lines +392 to +402

for %%C in (^^^^ ^^^( ^^^) ^^^> ^^^< ^^^& ^^^|) do (
if not "!JBOSSPASS:%%C=!"=="!JBOSSPASS!" set IS_SANITIZED=true
set "JBOSSPASS=!JBOSSPASS:%%C=^^%%C!"
)
if not "!IS_SANITIZED!" == "true" (
for %%C in (^^ ^( ^) ^> ^< ^& ^|) do (
set "JBOSSPASS=!JBOSSPASS:%%C=^^^%%C!"
)
)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't say I understand this, but I trust you :)

@jamezp jamezp added ready-for-merge This PR is ready to be merged and fulfills all requirements and removed Stale labels Jul 21, 2021
@bstansberry bstansberry merged commit 6b77356 into wildfly:main Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deps-ok Dependencies have been checked, and there are no significant changes ready-for-merge This PR is ready to be merged and fulfills all requirements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants