Bug 1057625 - add-user.sh syntax cygwin fix (for EAP 6.3.0)
Summary: add-user.sh syntax cygwin fix (for EAP 6.3.0)
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Scripts and Commands
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: DR0
: EAP 6.3.0
Assignee: Permaine Cheung
QA Contact: Petr Kremensky
Russell Dickenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-24 13:48 UTC by Permaine Cheung
Modified: 2014-07-09 00:13 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
In previous versions of JBoss EAP 6, it was found that the `add-user.sh` script would fail when run in Cygwin environments. The cause was identified as a poorly formatted line of code in the script. This issue has been resolved in this release, however the script still carries an unresolved issue when run in Cygwin environments. Refer to ticket 1069252 in the Known Issues section of this document for more information.
Clone Of: 1056130
Environment:
Last Closed: 2014-06-28 15:27:21 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1069252 0 unspecified CLOSED [QE] (6.3.0) add-user.sh is not working with cygwin 2021-02-22 00:41:40 UTC

Internal Links: 1069252

Description Permaine Cheung 2014-01-24 13:48:27 UTC
add-user.sh fails under cygwin for bad syntax. It's a trivial one line change like WFLY-130 (https://github.com/wildfly/wildfly/pull/5737):

> diff --git a/build/src/main/resources/bin/add-user.sh b/build/src/main/resources/bin
> index 38cc026..074ed0c 100755
> --- a/build/src/main/resources/bin/add-user.sh
> +++ b/build/src/main/resources/bin/add-user.sh
> @@ -11,7 +11,7 @@ DIRNAME=`dirname "$0"`
>  # OS specific support (must be 'true' or 'false').
>  cygwin=false;
>  if  [ `uname|grep -i CYGWIN` ]; then
> -    cygwin = true;
> +    cygwin=true;
>  fi
>  
>  # For Cygwin, ensure paths are in UNIX format before anything is touched



Cloning for EAP 6.3.0.

Comment 2 Petr Kremensky 2014-02-24 14:06:12 UTC
We should try to fix also the second problem as add-user is still not working with cygwin.

Using add-user.sh with cygwin:

EAP 6.2.0.GA
./add-user.sh
./add-user.sh: line 14: cygwin: command not found
Error: Unable to access jarfile /cygdrive/w/pkremens/jboss-eap-6.2/jboss-modules.jar

EAP 6.3.0.DR0
./add-user.sh 
cygpath: can't convert empty path
Exception in thread "main" java.lang.IllegalStateException: JBAS015232: No java.io.Console available to interact with user.
	at org.jboss.as.domain.management.security.adduser.AddUser.<init>(AddUser.java:74)
	at org.jboss.as.domain.management.security.adduser.AddUser.main(AddUser.java:215)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.jboss.modules.Module.run(Module.java:292)
	at org.jboss.modules.Main.main(Main.java:455)

Comment 3 Permaine Cheung 2014-02-24 14:39:59 UTC
The original reported problem has been committed, the second one needs to be look at by dev, please file a separate BZ for that.

Comment 4 Petr Kremensky 2014-02-24 15:21:30 UTC
Closing this one as script was fixed. Opened a new issue for add-user as such. See BZ1069252.

Verified on EAP 6.3.0.DR0


Note You need to log in before you can comment on or make changes to this bug.