Subject: bug#44944: Unable to log into X session via gdm

From: Maxim Cournoyer <[email-masked]>
Date: Thu, 22 Sep 2022 00:11:49 -0400

Hi,

[email-masked] writes:

> Hi Maxim,
>
> On +2022-09-16 15:00:22 -0400, Maxim Cournoyer wrote:
>> Hi,
>> 
>> Danny Milosavljevic <[email-masked]> writes:
>> 
>> > The latest guix system reconfigure (of yesterday) left me unable to login into
>> > my X session.  guix system rollback DID NOT fix it.
>> >
>> > I would enter my password and it would "try" to login and return right back to
>> > the gdm login screen.
>> >
>> > I've since removed gdm from my OS configuration (because I have to do actual
>> > *work* on this computer), but I think it would have been enough to just
>> > chown /var/lib/gdm and rm ~/.xsession-errors (!) in order to make it work
>> > again.
>> >
>> > Does that mean that user ids are non-reproducible?
>> >
>> > Why not have user_id = hash(user_name) ?  Then they *are* reproducible.
>> 
>> That'd be cool, but how would you implement such a hash, that returns
>> something fixed between 0 and 1024?  That doesn't sound feasible,
>> although I'm no hash function expert.
>>
>
> To "return something fixed between 0 and 1024" (1023?) In a context
> with less than 1024 users, couldn't one wrap Danny's "hash(username)"
> with a local function that finds a 0..1023 index into a trusted table
> of hash(username) values represented as string lines?

I'm not sure I follow.  If you had some pseudo-code, that might help me
:-).

> Similar to the idea of representing 32-bit sRGB 16-million-colors+transparency
> with an 8-bit pallette index -- or even a 1-bit index for fg/bg alternates
> to black/white.

I'd need to read more deeply about the topic to understand, but I
welcome mathematicians wizards to devise a cute little function to do
that :-).

> BTW, for the unlimited-number-of-users case, what sets the 1024 range limit?

It's just a convention for "system" users, e.g. users typically not
having a home directory, and perhaps other traits.  It can differ
between distributions.  Some information about it here [0].

[0]  https://unix.stackexchange.com/a/80279/82353

Thanks,

Maxim