Can't create domain starting with numerical character using API

Jarpse

New member
Joined
Jan 9, 2015
Messages
4
Please move this thread when it isn't the right forum to post it in.

I'm trying to add a domain name to the system beginning with numerical characters using the API.
directadmin contains the "allow_numeric_username" directive turned on (1) and I am able to create the same domain name directly in the panel itself without problems.

However, using the API gives back the same error I would get with the setting turned off (0).

Any insights on this?
 
Sorry, I meant the username in this case. The username is derived from the domain name so when the domain name starts numerical, the username would as well (there are normal letters as well, so no conflict with other user ID's).

This is the exact error I would get back:

array(10) { ["error"]=> string(1) "1" ["text"]=> string(27) "Cannot Execute Your Request" ["details"]=> string(52) "The username is invalid. Usernames must start with a" ["#45z,_contain_"]=> string(0) "" ["#62"]=> string(0) "" ["#61_"]=> string(0) "" ["#51_characters_and_"]=> string(0) "" ["#60"]=> string(0) "" ["#49"]=> string(0) "" ["#48_"]=> string(0) "" }
 
Looking at the code, the allow_numeric_username=1 should be respected there..

I've added more debug output to the pre-release binaries if you want to try them, debug level 2000.
It will spit this out if the setting is not on:
Code:
debug(2000, "FormCheck::isUsername(%s): invalid because it starts with a number: %c", username, username[0]);
but that will only be shown if allow_numeric_username=0 is set, and the first char is a number.

I have a feeling that it might actually just be either a config setting read issue, or DA wasn't restarted.
Maybe confirm the setting, eg:
Code:
./directadmin c | grep allow_numeric_username
and force a hard restart:
Code:
killall -9 directadmin
/etc/init.d/directadmin restart
John
 
For what it's worth, I never use usernames starting with a number; I break the rule for that, because usernames beginning with numbers are not recommended as I recall.

Of course this could be a problem with non-sophisticated provisioning systems (I'm using WHMCS but have never tried setup automation). Anyone know if usrenames starting with a number can cause any issues in the real world?

Jeff
 
It could give problems:

"Note that we have seen issues were services confuse numerical usernames with user ID numbers, so we still don't advise using this."

But I am not using a pure number-based username here so I should be good.

[root@box]# ./directadmin c | grep allow_numeric_username
allow_numeric_username=1

DirectAdmin was restarted as well. If I turn it to 0 I can no longer add usernames starting with 0-9. If I change it to 1 I can, but using the API the behaviour stays the same.
 
Back
Top