all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: Maxime Devos <maximedevos@telenet.be>
Cc: Danny Milosavljevic <dannym@scratchpost.org>, 44944@debbugs.gnu.org
Subject: bug#44944: Unable to log into X session via gdm
Date: Mon, 26 Sep 2022 20:12:31 -0400	[thread overview]
Message-ID: <87tu4ty8sw.fsf@gmail.com> (raw)
In-Reply-To: <d6954217-2778-f161-87e0-882356ea4ebd@telenet.be> (Maxime Devos's message of "Sun, 25 Sep 2022 13:47:15 +0200")

Hello,

Maxime Devos <maximedevos@telenet.be> writes:

> On 16-09-2022 21:00, Maxim Cournoyer wrote:
>> 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.
>
> Remember that any function from X to a finite set Y is a hash function
> -- this included very simple ones like e.g. X={1,...,N}, Y={1,...,N},
> map every number \(k\) to \(k\).

[...]

> But if you have to remember the old users anyway and gradually build
> up a hash function, then you might as well simplify things by not
> going for a classically "good" hash function but rather a simple table
> that is gradually build up (technically a hash function), as I've
> tried out in <https://issues.guix.gnu.org/36508#21> (currently limited
> to uids, gid not yet supported, also largely untested).
>
> (*) Implementation:
>
> (define (hash username)
>   (define %table
>     `(("root" . 0)
>       ("foo" . 1)
>       ("bar" . 2)
>       ; <insert entries for all other (system) usernames in Guix here>
>       [...]))
>   (or (assoc-ref %table username)
>       (error "doesn't exist")))

Thanks for explaining.  Thinking some more about it, it seems having
such a function would be of limited value after all: it'd only be useful
to avoid confusion about stale files ownership by avoiding to reuse any
user id used in the present or past; it wouldn't avoid having stale
files with the wrong ownership.

So the solution seems to instead be extra careful with removing as much
state as we can, and checking things in activation scripts.  For GDM for
example I was able to put the /var/lib/gdm directory on a tmpfs which
gets reset on every reboot, which should help with this and other (stale
cache files) problem its service had.

Thanks,

Maxim




      reply	other threads:[~2022-09-27  0:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-29 13:02 bug#44944: Unable to log into X session via gdm Danny Milosavljevic
2020-11-29 17:00 ` Marius Bakke
2020-11-29 21:20   ` Danny Milosavljevic
2022-09-16 19:00 ` Maxim Cournoyer
2022-09-16 21:03   ` Maxim Cournoyer
2022-09-20 14:49   ` bokr
2022-09-22  4:11     ` Maxim Cournoyer
2022-09-25 11:47   ` Maxime Devos
2022-09-27  0:12     ` Maxim Cournoyer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tu4ty8sw.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=44944@debbugs.gnu.org \
    --cc=dannym@scratchpost.org \
    --cc=maximedevos@telenet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.