does not canonicalize username before editing /etc/group

Bug #120051 reported by Jerome Haltom
6
Affects Status Importance Assigned to Milestone
adduser (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: adduser

`adduser isi\jhaltom admin' results in an entry being put into /etc/group of 'isi\jhaltom'. Invoking `getent passwd isi\jhaltom' returns a user named 'ISI\jhaltom'. adduser should use this canonical case-sensitive version.

Revision history for this message
Xeno Campanoli (xeno) wrote :

I see the following problems:

1. I am not able to reproduce the method of getting 'isi\jhaltom' as a username. When I try it on feisty with adduser it drops the '\' when I don't use quotes, or fails with a reasonable diagnostic when I do:

root@joehill:/etc# adduser isi\\jhaltom
adduser: To avoid problems, the username should consist only of
letters, digits, underscores, periods, at signs and dashes, and not start with
a dash (as defined by IEEE Std 1003.1-2001). For compatibility with Samba
machine accounts $ is also supported at the end of the username
---snip---

When I use the exact command you gave:

root@radioflyer:~# adduser isi\jhaltom admin
adduser: The user `isijhaltom' does not exist.
---snip---
is what I get. I don't see support for this functionality in the man page either. To proceed with this bug, please provide:

1. Your distribution and release of Ubuntu. This should be a Ubuntu bug. Perhaps also provide uname -a.
2. Specific document on that version of Ubuntu saying this kind of username, and this kind of adduser usage is supported.
3. Clarify exact commands and show results when you execute them please.
4. If you cannot repeat this please let us know that so we can keep it around but manage its priority better.

Changed in adduser:
status: Unconfirmed → Needs Info
Revision history for this message
Xeno Campanoli (xeno) wrote :

I see no feedback justifying the specified feature, so for now I think this bug should be marked Invalid. Perhaps Jerome if you can get back to us on this we can look into these matters further later.

Changed in adduser:
status: Incomplete → Invalid
Revision history for this message
Jerome Haltom (wasabi) wrote :

Uh. I didn't expect to have to quote my commands in a bug report. For all I know your shell doesn't use \ as an escape character. Also, there is a reason I put everything into single quotes.

root@radioflyer:~# adduser isi\\jhaltom admin

Seeing as you are using bash, you will want to run the command above.

Changed in adduser:
status: Invalid → Incomplete
Revision history for this message
Jerome Haltom (wasabi) wrote :

Also, I don't know what your comment "I am not able to reproduce the method of getting a user name" means. There are other ways to have user's introduced into the system than `adduser`. My specific example are users delivered from Windows Active Directory using Samba and Winbind. In this case, \ is used as a separator between the user name and realm/domain component.

Revision history for this message
Jerome Haltom (wasabi) wrote :

Actually I think I follow. You are being mislead by my use of '\' in a name. My bug is not about '\' in the name. It is about canonicalization of case as done by the `adduser` utility. The '\' just happens to be a copy/paste from my particular example.

Revision history for this message
Xeno Campanoli (xeno) wrote :

I apologize for not getting back on this sooner. I'm probably the worse person in Linuxdom for making any judgements regarding Windows, Active Directory, and Samba, and this I claim accounts for my ignorance about this bug. I'd better let someone else take it up from this point. I'll stay subscribed to find out what happens.

Revision history for this message
Jerome Haltom (wasabi) wrote :

Well, I want to make it clear that this bug is a bug regardless of Windows. The bug is simply that `adduser` does not reverse map the resolved uid back into a canonical username. The idea is this:

`getent passwd foo` returns the record for one or many users, searching based on the username "foo". The module that implements this search may or may not be case sensitive. In the case of Winbind and Windows, and most LDAP set ups I'm aware of, the search mechanism is not case sensitive. That is, searching for "foo" may result in a result for "Foo". Note the capital F. What`adduser` does it search for "foo", and if it exists, put "foo" into /etc/group. What it needs to do is use add the username returned in the getent query to insert into /etc/group. This way, if "foo" finds "Foo", "Foo" gets used.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for adduser (Ubuntu) because there has been no activity for 60 days.]

Revision history for this message
Colin Watson (cjwatson) wrote :

This shouldn't have been Incomplete; reopening and moving milestone forward.

Changed in adduser:
status: Invalid → Confirmed
Revision history for this message
Rok Jaklič (rokj) wrote :

Hi.

Is there "an easy way" to reproduce this? Maybe username is not being used because "that other program" did not use --force-badname parameter?

Rok

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.