Skip to content

Improve user's full name handling

Pascal Hambourg requested to merge pham/user-setup:pham/fullname into master

This proposal contains a collection of patches originating from bugs #1101196 #1101196 #1104550 (the installer silently fails to create the first user when the full name contains non-ASCII characters such as accented letters) triggered when adduser 3.149 started doing overly strict sanitation while user-setup does not do any full name input sanitation. adduser 3.152 relaxes full name sanitation and allows non-ASCII characters again but still rejects some characters (colon and control characters) which are forbidden by low-level tools usermod and chfn.

  1. Replace deprecated --gecos with --comment in adduser invocation.
  2. Set the full name with chfn instead of adduser so that user creation will not fail unexpectedly if the full name contains unknown forbidden characters.
  3. Do not set LANG=C any more when creating the user in installed system chroot. UTF-8 characters are allowed in the full name and C.UTF-8 is used by the installer and is always available in the installed system. I did not see any perl error mentioned in the associated comment after removing it. (This change does not seem to make a difference so may be delayed after Trixie release)
  4. Sanitize full name:
    • Replace colon (field separator in /etc/passwd), comma (comment sub-field separator) and control characters with spaces.
    • Squeeze repeated spaces.
    • Remove leading and trailing spaces.

These patches are mostly independent and may be cherry-picked individually.

Merge request reports

Loading