Page MenuHomePureOS Tracker

PureOS OEM setup fails if username contains capital letters
Closed, ResolvedPublic

Description

What happens:

If username is changed so that it contains capital letters, OEM setup fails because user creation fails.

What should happen

User should not be able to type anything other than small letters to the username field.

Event Timeline

mladen triaged this task as High priority.May 12 2020, 08:20
mladen created this task.

The OEM installer converts a user Full Name into a Username in lower case letters, but it is possible for a user to manually edit the username and add a upper case latter again. Like in the picture bellow.

Then the user creation fails, and on reboot user has a shell with nothing expect the upper right side options menu, with an option to run the setup again.

If the user tries a second time and uses lower case letters setup will work and account will be created.

joao.azevedo added a comment.EditedMay 13 2020, 11:59

This issue is caused because g-i-s follows RHEL/Fedora useradd rules which are different from debian. Fedora/RHEL allows usernames with upper case letters.
And g-i-s provides no error message when a PureOS user tries to create a username that does not comply with the useradd rules followed in PureOS.

GNOME g-i-s devs seem to be aware of this issue. While there is no bug report there is an open merge request not yet accepted, made more than a year ago (almost two):

https://gitlab.gnome.org/GNOME/gnome-initial-setup/-/merge_requests/30

From what I can see the merge request failed building in the pipeline (https://gitlab.gnome.org/GNOME/gnome-initial-setup/-/merge_requests/30/pipelines)

I guess a task to solve this could be:

  • check if the code change proposed is still valid, since it is 301 commits behind master
  • check what is blocking this merge request, it is is only the pipeline

But it might be possible that they are looking for a fix similar to g-c-c , see bellow:

Extra context on this issue

This issue it seems that in the past was also present in Gnome Control Center because g-i-s copied g-c-c config file.

There was an original merge request in g-c-c to fix this, which was a copy of the current merge request in g-i-s:

https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/359

In the discussion of that merge request the issue with Fedora having different rules for user creation is explained.

That merge request was rejected in favor of another approach in two other merge requests (https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/362 https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/537).

The different approach in g-c-c- is, since distros have different rules for usernames, use a dynamic way to detect the rules for user creation of different distros, instead of harcoding the different rules of Fedora or Debian

mladen raised the priority of this task from High to Unbreak Now!.May 20 2020, 04:38

Matthias is looking upstream to see if the fix has been already made in effort to de-duplicate work.

mak closed this task as Resolved.Jul 18 2020, 09:30

This has been fixed in PureOS for some time now, but we'll still need an upstream solution. I'll likely push this change to Debian as well meanwhile, so Debian can benefit from the bugfix as well.

This has been fixed in PureOS for some time now

@mak can I hug you?

I'll likely push this change to Debian as well meanwhile, so Debian can benefit from the bugfix as well.

Is this not something that can also be pushed to upstream g-i-s

mak added a comment.Jul 18 2020, 09:45

Is this not something that can also be pushed to upstream g-i-s

It should be, but Debian carries a very similar patch for gnome-control-center downstream as well, which makes me a bit suspicious... Since rules on non-Debian systems for usernames are a bit less strict, maybe those patches were rejected in the past? (I couldn't find any reference to that though, so I'll just make a new attempt to get the changes in)