From /etc/rhn/default/rhn_server.conf # New usernames # min_user_len is used for sanity checks on the username upon authentication; # min_new_user_len is the minimum user length for new users # For legacy reasons, we need two different checks min_new_user_len = 5 This is a false statement. From CreateUserCommand.java if (login.length() < Config.get().getInt("min_user_len")) { errors.add(new ValidatorError("error.minlogin", Config.get().getString("min_user_len"))); return; } As you can see min_new_user_len is never consulted. So, either consult it with something like if (login.length() < Config.get().getInt("min_user_len") || login.length() < Config.get().getInt("min_new_user_len")) { Or remove the reference to min_new_user_len. The very little searching I did, returned no other references to that value. So it should be ok to remove so there is no confusion in the future. Version-Release number of selected component (if applicable): spacewalk-java-0.5.44-84.el5sat How reproducible: Everytime Steps to Reproduce: 1. Set min_new_user_len to 3 in /etc/rhn/rhn.conf 2. Restart services 3. Try to create a user with a login of 3 characters Actual results: Failure Expected results: Success
This is effecting our implementation of Satellite as well. Our LDAP uses 4 character logins and we can't integrate Satellite with the rest of our infrastructure.
It should be noted, that the new user code does consult min_user_len, but not min_new_user_len (as one may imagine due to the name of the variable). So as a workaround, I've had to set min_new_user_len & min_user_len to the values required.
For reference, changing the min_user_len value in /etc/rhn/default/rhn_server.conf does not affect this behavior. /etc/rhn/default/rhn_server.conf min_user_len = 3 min_new_user_len = 3 I found web.min_user_len in /etc/rhn/default/rhn_web.conf, changed it to 3, restarted satellite and it works.
Please note that any customizations should be done in /etc/rhn/rhn.conf only, not in the */default/*.conf files.
I've now removed the option min_new_user_len from rhn_server.conf in Spacewalk master, 7adfcb1e3f02428ce18b40ec417aad1668085b47.
VERIFIED on Satellite-5.6.0-RHEL6-re20130917.0 Steps of reproduce Sat-5.6.0: 1. Check default value: > export PASSWD="xxx" > spacewalk-api --server localhost --user=admin --password=$PASSWD user.create "%session%" aa "123456" "XXX" "YYY" "xxx@localhost" "Logins must be no shorter than 3 characters." 2. change defaults values in /etc/rhn/rhn.conf: > echo "min_user_len = 6" >> /etc/rhn/rhn.conf > echo "min_new_user_len = 7" >> /etc/rhn/rhn.conf 3. run this command > spacewalk-api --server localhost --user=admin --password=$PASSWD user.create "%session%" aa "123456" "XXX" "YYY" "xxx@localhost" "Logins must be no shorter than 6 characters." Steps of reproduce Sat-5.4.1: 1. Check default value: > export PASSWD="xxx" > spacewalk-api --server localhost --user=admin --password=$PASSWD user.create "%session%" aa "123456" "XXX" "YYY" "xxx@localhost" "Logins must be no shorter than 5 characters." 2. change rhn.conf > echo "min_user_len = 6" >> /etc/rhn/rhn.conf > echo "min_new_user_len = 7" >> /etc/rhn/rhn.conf 3. run this command > spacewalk-api --server localhost --user=admin --password=$PASSWD user.create "%session%" aa "123456" "XXX" "YYY" "xxx@localhost" "Logins must be no shorter than 6 characters."
FIX steps of reproduce, add step 1.1 for both situations 1.1 restart satellite > rhn-satellite restart
Satellite 5.6 has been released. This bug was tracked under the release. This bug was either VERIFIED or RELEASE_PENDING (re-verified prior shortly before release). Moving to CLOSED CURRENT_RELEASE. Text from Upgrade Erratum follows: Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHEA-2013-1395.html