Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1062595 - RuntimeException by add-user utility once the user name matches the password (non-interactive mode)
RuntimeException by add-user utility once the user name matches the password ...
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Scripts and Commands (Show other bugs)
6.2.0
Unspecified Unspecified
unspecified Severity low
: DR6
: EAP 6.3.0
Assigned To: Darran Lofthouse
Petr Kremensky
Russell Dickenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-07 06:48 EST by Petr Kremensky
Modified: 2014-06-28 11:38 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previous versions of JBoss EAP 6 would throw a RuntimeException if a non-interactive call to the `add-user` utility failed (as happens with problematic username/password combinations). This exception was intended to alert scripts that a failure had occurred. The exceptions could, however, be mistaken as a bug since these types of exceptions should not be propagated without being handled. A custom exception has been added to this release of the product to indicate that displaying this exception is intentional and not indicative of a bug in the `add-user` utility.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-28 11:38:53 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker WFLY-3130 Major Closed Add a custom RuntimeException to add-user utility. 2018-05-23 06:25 EDT

  None (edit)
Description Petr Kremensky 2014-02-07 06:48:35 EST
Description of problem:
 Passing the same username and password to add-user non-interactively throws RuntinmeException.

Version-Release number of selected component (if applicable):
 6.2.0

How reproducible:
always

Steps to Reproduce:
 1. Navigate inte $EAP_HOME/bin directory
 2. Run: add-user.[sh|bat] asdasd@2 asdasd@2

Actual results:
---------------------------------
 * Error * 
JBAS015238: Username must not match the password.

Exception in thread "main" java.lang.RuntimeException: JBAS015238: Username must not match the password.
	at org.jboss.as.domain.management.security.adduser.ErrorState.execute(ErrorState.java:67)
	at org.jboss.as.domain.management.security.adduser.AddUser.run(AddUser.java:130)
	at org.jboss.as.domain.management.security.adduser.AddUser.main(AddUser.java:208)
	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)
---------------------------------

Expected results:
---------------------------------
 * Error * 
JBAS015238: Username must not match the password.
---------------------------------
Comment 1 Petr Kremensky 2014-02-07 06:55:45 EST
Same with the missing password:
bin]$ ./add-user.sh admin

 * Error * 
JBAS015236: No Password entered, exiting.

Exception in thread "main" java.lang.RuntimeException: JBAS015236: No Password entered, exiting.
	at org.jboss.as.domain.management.security.adduser.ErrorState.execute(ErrorState.java:67)
	at org.jboss.as.domain.management.security.adduser.AddUser.run(AddUser.java:130)
	at org.jboss.as.domain.management.security.adduser.AddUser.main(AddUser.java:208)
	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 2 Petr Kremensky 2014-02-07 07:59:25 EST
Also non-alphanumeric character in password throws RE:
bin]$ ./add-user.sh aaa#aaa asdasd@2

 * Error * 
JBAS015239: Only alpha/numeric usernames accepted.

Exception in thread "main" java.lang.RuntimeException: JBAS015239: Only alpha/numeric usernames accepted.
	at org.jboss.as.domain.management.security.adduser.ErrorState.execute(ErrorState.java:67)
	at org.jboss.as.domain.management.security.adduser.AddUser.run(AddUser.java:130)
	at org.jboss.as.domain.management.security.adduser.AddUser.main(AddUser.java:208)
	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-07 10:17:58 EST
Darran, please investigate. Thanks!
Comment 4 Petr Kremensky 2014-02-27 08:14:48 EST
Same exception for non-existing properties file
bin]$ ./add-user.sh -a -u appuser1 -p password1! -g app1group -sc /home/someusername/userconfigs/ -up appusers.properties -gp appgroups.properties
Exception in thread "main" java.lang.RuntimeException: JBAS015234: No appusers.properties files found
Comment 5 Darran Lofthouse 2014-03-18 11:45:22 EDT
Just checked and this does not appear to be an upstream issue, this is not surprising as password validation has moved on considerably upstream - the fix here is going to be EAP specific.
Comment 6 Darran Lofthouse 2014-03-18 12:15:24 EDT
Outputting the exception is valid as this is to indicate to scripts calling in non-interactive mode that a failure occurred - however we should use out own exception type instead of RuntimeException.
Comment 7 JBoss JIRA Server 2014-03-18 12:16:14 EDT
Darran Lofthouse <darran.lofthouse@jboss.com> updated the status of jira WFLY-3130 to Coding In Progress
Comment 10 Petr Kremensky 2014-03-31 01:48:33 EDT
Verified on EAP 6.3.0.DR6
Comment 11 Scott Mumford 2014-04-23 21:03:00 EDT
Refactored release notes text and marked for inclusion in documentation.
Comment 12 sgilda 2014-05-12 16:18:54 EDT
Changed <literal></literal> tags in Doc Text to ticks (`) to fix Bug 1096865

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