[master/f21-branch][PATCH] Strip suggested usernames to 8 characters

David Shea dshea at redhat.com
Wed Sep 10 18:18:59 UTC 2014


On 09/10/2014 02:16 PM, David Shea wrote:
> On 09/10/2014 01:55 PM, Vratislav Podzimek wrote:
>> On Tue, 2014-08-26 at 10:40 +0200, Vratislav Podzimek wrote:
>>> This is a practical and widely used pattern.
>>>
>>> Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
>>> ---
>>>   pyanaconda/users.py | 3 ++-
>>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/pyanaconda/users.py b/pyanaconda/users.py
>>> index 82cd2d3..f25c8fa 100644
>>> --- a/pyanaconda/users.py
>>> +++ b/pyanaconda/users.py
>>> @@ -192,8 +192,9 @@ def guess_username(fullname):
>>>       if len(fullname) > 1:
>>>           username = fullname[0].decode("utf-8")[0].lower() + username
>>>   +    # strip accents and make the username at most 8 characters long
>>>       username = strip_accents(username).encode("utf-8")
>>> -    return username
>>> +    return username[0:8]
>>>     class Users:
>>>       def __init__ (self):
>> Anybody against this change on master?
>>
>
> Do any other tools in Fedora strip or warn about long user names? I 
> don't see any reason to do this if long usernames aren't breaking 
> something.

As far as what GNOME does, not only do they suggest usernames of any 
length, but they stick the whole first name in there, too: 
https://dshea.fedorapeople.org/gnome-control-user.png


More information about the anaconda-patches mailing list