Posts: 1,028
SamK
Joined: 21 Aug 2011
#1
As previously reported, the live media continues to disallow the use of upper and lower case letters in the account name.

In antiX-13 (and earlier releases) the installer permitted mixed case account names. The regression was introduced in antiX-15 and remains present in antiX-16 RC1.

After installation, via the Control Center it is possible to create a user account with mixed case letters. This indicates the issue is located in the live installer and is a wholly unnecessary restriction. It goes against the basic antiX concepts of flexibility and user choice.

By restricting a mixed case account name to being created post installation, it prevents the carry over of pre-installation customizing to the installed system. It defeats one of the most recent innovations of antiX, thereby making it necessary to separately configure each account manually, on each individual machine.

Additionally, the unnecessary restriction is unhelpful and confusing on existing sites where mixed case names are already employed, particularly those that provide networked resources. For example where share access and/or management is authorised using a mixed case name. It is also confusing for users in locations where antiX is used alongside other distros that do permit a mixed case name.

antiX should continue its previous standard method of allowing a mixed case account name to be specified in the live installer.
Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#2
samk, I'm not sure what is standard anymore.

adduser reports this when I try to add Dolphin (capital D)

Code: Select all

root@littlebit:/home/dolphin# adduser Dolphin
adduser: Please enter a username matching the regular expression configured
via the NAME_REGEX configuration variable.  Use the `--force-badname'
option to relax this check or reconfigure NAME_REGEX.
This is also true in ubuntu. I believe this is forced by debian upstream. To get Dolphin, I had to user"useradd" which doesn't create home folders.

the user-management app actually forces a --bad-name switch to use the mixed case username.

Code: Select all

function add-user {
    USER="$1";
    OPTIONS="$2";
    echo"$USER" > /tmp/user-setup.txt
    echo"$USER" >> /tmp/user-setup.txt
    echo"$USER" >> /tmp/user-setup.txt
    echo"0" >> /tmp/user-setup.txt
    echo"0" >> /tmp/user-setup.txt
    echo"0" >> /tmp/user-setup.txt
    echo"0" >> /tmp/user-setup.txt
    echo"y" >> /tmp/user-setup.txt
    adduser $USER --force-badname $OPTIONS < /tmp/user-setup.txt
so the question is, which one is wrong. the installer (with the same restrictions as adduser) or the control center app, with the --force-badname switch
Posts: 1,028
SamK
Joined: 21 Aug 2011
#3
dolphin_oracle wrote:adduser reports this when I try to add Dolphin (capital D)

Code: Select all

root@littlebit:/home/dolphin# adduser Dolphin
adduser: Please enter a username matching the regular expression configured
via the NAME_REGEX configuration variable.  Use the `--force-badname'
option to relax this check or reconfigure NAME_REGEX.
[...]
so the question is, which one is wrong. the installer (with the same restrictions as adduser) or the control center app, with the --force-badname switch
Perhaps neither, or both.

Created 4 accounts to see the problem.
Quick, dirty and superficial test in a live no persistence environment.
As root

Code: Select all

useradd TestUser1
useradd TestUser2
useradd testuser3
useradd TestUser4
Verified the accounts created

Code: Select all

cat / etc/passwd | grep -E 'Test|test'
Testuser1:x:1001:1001::/home/Testuser1:/bin/sh
Testuser2:x:1002:1002::/home/Testuser2:/bin/sh
testuser3:x:1003:1003::/home/testuser3:/bin/sh
TestUser4:x:1004:1004::/home/TestUser4:/bin/sh
All 4 accounts were created with case variations and alphanumeric characters without any error messages.
Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#4
And no home folders created or default groups added.

The only thing that bugs me.is the reason for the adduser.conf. it comes from upstream and I wonder what problem it fixes. Or avoids.

Anyway the installer does the check in this case, not adduser.. Removing the check should allow.the creation of usernames as you request.

I still wonder about the reason for the check though. Doing some quick googling leads to a lot of recommendations to avoid mixed case but I have not found a clear reason as to why. Might possibly have to do with some sort of samba password syncing ( in samba dolphin is the same as DOlphin) but I'm really sketchy on this point.
Posts: 1,062
Dave
Joined: 20 Jan 2010
#5
Yes it does get confusing with Samba and other server services but IMHO it is really not that big of a problem (I set up several server systems) and can easily be remedied in other ways than name restrictions. Upper and lower case being different in all other areas of unix/linix but then restricted to match Microsoft's ideals is not something I agree with and when I use upper and lower case for filenames I would like to use them also for usernames. The fact to me that there is an override switch to allow mixed case to me suggests there is no real system crashing problem just a handful of minor potential issues.
Posts: 88
kmathern
Joined: 25 Aug 2012
#6
dolphin_oracle wrote:And no home folders created or default groups added. ...
If I change the NAME_REGEX line in /etc/adduser.conf

from

Code: Select all

#NAME_REGEX="^[a-z][-a-z0-9_]*\$"
to this

Code: Select all

NAME_REGEX="^[a-zA-Z][-a-zA-Z0-9_]*\$?$"
the adduser command will let me create a new user with a mix of uppercase/lowercase and numerics in the username, it also creates the default groups and I think also the home folders.

Code: Select all

$ sudo adduser Test1
Adding user `Test1' ...
Adding new group `Test1' (1001) ...
Adding new user `Test1' (1001) with group `Test1' ...
Creating home directory `/home/Test1' ...
Copying files from `/ etc/skel' ...
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Changing the user information for Test1
Enter the new value, or press ENTER for the default
    Full Name []: 
    Room Number []: 
    Work Phone []: 
    Home Phone []: 
    Other []: 
Is the information correct? [Y/n] 
Adding new user `Test1' to extra groups ...
Adding user `Test1' to group `dialout' ...
Adding user `Test1' to group `dip' ...
Adding user `Test1' to group `cdrom' ...
Adding user `Test1' to group `audio' ...
Adding user `Test1' to group `video' ...
Adding user `Test1' to group `plugdev' ...
Adding user `Test1' to group `users' ...
Adding user `Test1' to group `floppy' ...
Adding user `Test1' to group `netdev' ...
Adding user `Test1' to group `scanner' ...
Adding user `Test1' to group `lp' ...
Adding user `Test1' to group `lpadmin' ...
Adding user `Test1' to group `sudo' ...

Code: Select all

$ ls -lah /home/Test1
total 36K
drwxr-xr-x 5 Test1 Test1 4.0K Jun 18 10:04 .
drwxr-xr-x 4 root  root  4.0K Jun 18 10:04 ..
-rw-r--r-- 1 Test1 Test1  220 Jun 18 10:04 .bash_logout
-rwxr-xr-x 1 Test1 Test1 3.8K Jun 18 10:04 .bashrc
drwxr-xr-x 9 Test1 Test1 4.0K Jun 18 10:04 .config
drwxr-xr-x 2 Test1 Test1 4.0K Jun 18 10:04 .gtk-2.0
drwxr-xr-x 3 Test1 Test1 4.0K Jun 18 10:04 .local
-rw-r--r-- 1 Test1 Test1  675 Jun 18 10:04 .profile
-rw-r--r-- 1 Test1 Test1   12 Jun 18 10:04 .xscreensaver

Code: Select all

$ ls -lah /home/Test1/.config/
total 40K
drwxr-xr-x 9 Test1 Test1 4.0K Jun 18 10:04 .
drwxr-xr-x 5 Test1 Test1 4.0K Jun 18 10:04 ..
drwxr-xr-x 2 Test1 Test1 4.0K Jun 18 10:04 autostart
drwxr-xr-x 2 Test1 Test1 4.0K Jun 18 10:04 libfm
drwxr-xr-x 2 Test1 Test1 4.0K Jun 18 10:04 menus
drwxr-xr-x 2 Test1 Test1 4.0K Jun 18 10:04 Thunar
-rw-r--r-- 1 Test1 Test1   24 Jun 18 10:04 Trolltech.conf
drwxr-xr-x 2 Test1 Test1 4.0K Jun 18 10:04 vlc
drwxr-xr-x 2 Test1 Test1 4.0K Jun 18 10:04 volumeicon
drwxr-xr-x 6 Test1 Test1 4.0K Jun 18 10:04 xfce4
Would there be any unintentional consequences that might come up from changing the NAME_REGEX ?

edit: I did this as a test on my MX-15 install but I think I the results would be similar in antiX-16.


edit #2 It also works if I copy the stock /etc/adduser.conf file (without the NAME_REGEX changes) to a /usr/share/antiX/adduser.conf file and make the NAME_REGEX changes to it instead, and then run the adduser command with it's --conf option.

Code: Select all

$ sudo adduser --conf /usr/share/antiX/adduser.conf Test1
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#7
In antiX-13 (and earlier releases) the installer permitted
First post describes the status quo as a"regression".
Idunno the minstall author's rationale for enforcing lowercase-only, but here's where it is being enforced, by design


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://github.com/antiX-Linux/antiX-installer/blob/304ec8ac479700ef5a52b174d0bc1b9b694f9ef4/minstall.cpp"
linktext was:"https://github.com/antiX-Linux/antiX-in ... nstall.cpp"
====================================
minstall.cpp, line 1216

Code: Select all

} else if (!userNameEdit->text().contains(QRegExp("^[a-z_][a-z0-9_-]*[$]?$"))) {
    QMessageBox::critical(0, QString::null,
                          tr("The user name needs be lower case and it\n"
                            "cannot contain special characters or spaces\n"
                            "please choose another name before proceeding."));
    return false;
}
Posts: 1,028
SamK
Joined: 21 Aug 2011
#8
skidoo wrote:First post describes the status quo as a"regression".
Idunno the minstall author's rationale for enforcing lowercase-only, but here's where it is being enforced, by design
It is a regression in terms of what antiX was formerly able to do.
Dave wrote:...I use upper and lower case for filenames I would like to use them also for usernames. The fact to me that there is an override switch to allow mixed case to me suggests there is no real system crashing problem just a handful of minor potential issues.
kmathern wrote:If I change the NAME_REGEX line in /etc/adduser.conf...
I've just checked that file in antiX-13.2

Code: Select all

Abstract start
# check user and group names also against this regular expression.
#NAME_REGEX="^[a-z][-a-z0-9_]*\$"
Abstract end
So it was purposely disabled, but I don't recall any reports of it causing problems.
Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#9
As skidoo pointed out the installer does the account creation on its own. It does not use adduser but it does use the same username restrictions .
Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#10
In the end its anti's call, but looking at the code, all that should need done is to comment out the section skidoo points out (or changing the expression to something else)
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#11
would be quick/simple to change regex, but really need to check into why the current lowercase restriction was chosen
contains(QRegExp("^[a-zA-Z_][a-zA-Z0-9_-]*[$]?$"))

I wouldn't have noticed, never thought to test mixed-case usernames.

consider:
ControlCentre -} Manage Users
the prefilled example username displayed when left-side AddUser button is clicked
is antiXDemo
which certainly hints that mixed-case is supported.
-=-
someone should test:
Does the installer successfully migrate such an account (username=antiXDemo) which has been created during live persistence?
Posts: 1,028
SamK
Joined: 21 Aug 2011
#12
SamK wrote:
kmathern wrote:If I change the NAME_REGEX line in /etc/adduser.conf...
I've just checked that file in antiX-13.2

Code: Select all

Abstract start
# check user and group names also against this regular expression.
#NAME_REGEX="^[a-z][-a-z0-9_]*\$"
Abstract end
So it was purposely disabled, but I don't recall any reports of it causing problems.
dolphin_oracle wrote:As skidoo pointed out the installer does the account creation on its own. It does not use adduser but it does use the same username restrictions
When taken together with antiX-13 and earlier employing an installer that allowed the use of mixed case account names, and the principal shipped tool for creating accounts after installation also allowing mixed case, it is an indication that there is no absolute need for the restriction. As mentioned previously, I do not recall reports of either causing problems.
dolphin_oracle wrote:I still wonder about the reason for the check though.
skidoo wrote:...but really need to check into why the current lowercase restriction was chosen
The file antiX-installer/NOTICE on github contains the following

Code: Select all

abstract start
//   Copyright (C) 2003-2009 by Warren Woodford
//   Heavily edited, with permision, by anticapitalista for antiX-Linux and MX-14 2011-2014.
abstract end
It appears to have been developed in-house which is a good indication the configuration choices have also been made in-house.
Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#13
I meant the reason debian used the restriction for adduser. Which was not done in house.
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#14
I have uploaded new antiX-installer that should allow for capitals. It will be put in /jessie/dev (so you need to edit the ant,x,list) until users provede feedback that it works ok not just during installation, but also as user for a while. Also it should be tested with other languages.

Also available here, for those that use dpkg -i


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://download.tuxfamily.org/antix/Testing/antiX-16/"
linktext was:"http://download.tuxfamily.org/antix/Testing/antiX-16/"
====================================
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#15
MX Adrian authored"minstall", yes? That's who/where you might inquire about the chosen restriction.
Or not {grin}

The adduser manpage mentions POSIX compliance
so, unless I hear/read otherwise, I figger debian's default just reflects the"neckbeard-compliant way"