From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <bug-guix-bounces+larch=yhetil.org@gnu.org>
Received: from mp11.migadu.com ([2001:41d0:8:6d80::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms5.migadu.com with LMTPS
	id TXbxORRAMmPkbgAAbAwnHQ
	(envelope-from <bug-guix-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Tue, 27 Sep 2022 02:13:09 +0200
Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp11.migadu.com with LMTPS
	id 6GMRORRAMmNIWgEA9RJhRA
	(envelope-from <bug-guix-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Tue, 27 Sep 2022 02:13:08 +0200
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id 7EEB2B5BF
	for <larch@yhetil.org>; Tue, 27 Sep 2022 02:13:08 +0200 (CEST)
Received: from localhost ([::1]:50664 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-guix-bounces+larch=yhetil.org@gnu.org>)
	id 1ocyDj-0003u6-6O
	for larch@yhetil.org; Mon, 26 Sep 2022 20:13:07 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:35982)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1ocyDe-0003tj-AS
 for bug-guix@gnu.org; Mon, 26 Sep 2022 20:13:02 -0400
Received: from debbugs.gnu.org ([209.51.188.43]:52932)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1ocyDe-0001y3-1z
 for bug-guix@gnu.org; Mon, 26 Sep 2022 20:13:02 -0400
Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1ocyDd-0006A9-JX
 for bug-guix@gnu.org; Mon, 26 Sep 2022 20:13:01 -0400
X-Loop: help-debbugs@gnu.org
Subject: bug#44944: Unable to log into X session via gdm
Resent-From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-guix@gnu.org
Resent-Date: Tue, 27 Sep 2022 00:13:01 +0000
Resent-Message-ID: <handler.44944.B44944.166423756323662@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 44944
X-GNU-PR-Package: guix
X-GNU-PR-Keywords: 
To: Maxime Devos <maximedevos@telenet.be>
Cc: Danny Milosavljevic <dannym@scratchpost.org>, 44944@debbugs.gnu.org
Received: via spool by 44944-submit@debbugs.gnu.org id=B44944.166423756323662
 (code B ref 44944); Tue, 27 Sep 2022 00:13:01 +0000
Received: (at 44944) by debbugs.gnu.org; 27 Sep 2022 00:12:43 +0000
Received: from localhost ([127.0.0.1]:52010 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1ocyDL-00069a-GD
 for submit@debbugs.gnu.org; Mon, 26 Sep 2022 20:12:43 -0400
Received: from mail-qk1-f181.google.com ([209.85.222.181]:43911)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maxim.cournoyer@gmail.com>) id 1ocyDH-00069J-Md
 for 44944@debbugs.gnu.org; Mon, 26 Sep 2022 20:12:42 -0400
Received: by mail-qk1-f181.google.com with SMTP id o7so5157398qkj.10
 for <44944@debbugs.gnu.org>; Mon, 26 Sep 2022 17:12:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 
 h=mime-version:user-agent:message-id:in-reply-to:date:references
 :subject:cc:to:from:from:to:cc:subject:date;
 bh=PfZxTZvmBdKS9Cr2pRhXIhDkX3eTHN19csfFS20w1Fw=;
 b=i5uVVUV1yiqpzdKyoqdWs8/dgb+zGxx3RfcpvB1+oK6HEaaT9jiYSLRz1/sLZsLu3l
 kOERa2fXbgLNr63EVCuj87xIcjxwVGC4IPs/UUFpQ00fKZKiYw1qiRkg2MGQCJF3YJiO
 idlElLdgzeEiq8LuCSs0H4i1P8PSN7DgV6KJDngEMLeO7q+zSzTgrPwWhAwc/9iXUmwS
 QsD6E840TNiM7GnO8Lh0n3PTPDdjgYt0QE2O04YcyULznmqpLn47ZLDVkTE0EsfO7zdl
 pIHMeCXSs3tPxvbndUvPs6uQ9H0MVcgsCucVS32lnc/dSpbqOSdxlOIwgHuhz218BPht
 T56w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=mime-version:user-agent:message-id:in-reply-to:date:references
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date;
 bh=PfZxTZvmBdKS9Cr2pRhXIhDkX3eTHN19csfFS20w1Fw=;
 b=ulEQZB3/vtVorL0d61glC8XVUmZeHMfJehTA+YbQfhgpwCZBrids28A9EH6vIhx25+
 s3jeUmBoVoEgEkDYsVsNNe0XTruYJhUA0IEjLaEFoKtIoxaeHkUqQjnRtckh+giBmYLs
 8UUzG2aFCkvTVq7pSr730Rif64vemBTRW6RhFDBhyNC4oQEQiMYoSJvVi2kGt2BajSh+
 JbA11nMMLyLZ44Tc5Pe6o77QrVykU65FBLI8yoGB6vubT/elLbr8RDxw8ilIQAHtOx7x
 +LDKlCC4hT0uY+odBenKBqIF5Lw00zp1KuZzRaDGjwanx71n17DwOCa4WfctbaB1flE7
 2D8Q==
X-Gm-Message-State: ACrzQf2T86dC71A4uhb6x0Pmfh6irb0U5kx6EFOgb6+S9cFh1SsN58lA
 Nxew7ogeqg01hJpHZMcvQDllDR8fNqyXLw==
X-Google-Smtp-Source: AMsMyM6JyMuAuKlR8+5uRwEe5XlG9loEXY2HY614RuyHEr62s0Zuej8K+VtcUwZJm3Tefv/Qzg0f5Q==
X-Received: by 2002:a05:620a:4686:b0:6ce:93c8:9973 with SMTP id
 bq6-20020a05620a468600b006ce93c89973mr16270719qkb.714.1664237553964; 
 Mon, 26 Sep 2022 17:12:33 -0700 (PDT)
Received: from hurd (dsl-10-132-99.b2b2c.ca. [72.10.132.99])
 by smtp.gmail.com with ESMTPSA id
 bj36-20020a05620a192400b006ceb8f36302sm12603428qkb.71.2022.09.26.17.12.32
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 26 Sep 2022 17:12:33 -0700 (PDT)
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
References: <20201129140240.546b1403@scratchpost.org>
 <8735crdu0p.fsf@gmail.com>
 <d6954217-2778-f161-87e0-882356ea4ebd@telenet.be>
Date: Mon, 26 Sep 2022 20:12:31 -0400
In-Reply-To: <d6954217-2778-f161-87e0-882356ea4ebd@telenet.be> (Maxime Devos's
 message of "Sun, 25 Sep 2022 13:47:15 +0200")
Message-ID: <87tu4ty8sw.fsf@gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: bug-guix@gnu.org
List-Id: Bug reports for GNU Guix <bug-guix.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-guix>,
 <mailto:bug-guix-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-guix>
List-Post: <mailto:bug-guix@gnu.org>
List-Help: <mailto:bug-guix-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-guix>,
 <mailto:bug-guix-request@gnu.org?subject=subscribe>
Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org
Sender: "bug-Guix" <bug-guix-bounces+larch=yhetil.org@gnu.org>
X-Migadu-Flow: FLOW_IN
X-Migadu-To: larch@yhetil.org
X-Migadu-Country: US
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1664237588;
	h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:cc:mime-version:mime-version:
	 content-type:content-type:resent-cc:resent-from:resent-sender:
	 resent-message-id:in-reply-to:in-reply-to:references:references:
	 list-id:list-help:list-unsubscribe:list-subscribe:list-post:
	 dkim-signature; bh=PfZxTZvmBdKS9Cr2pRhXIhDkX3eTHN19csfFS20w1Fw=;
	b=ULxOkOITwvsnAXMtEAokkPfmEhoOIY+UNldqN9bzJvLG2YA1Gf6V5kaVHI23vJrFY9g6FR
	MVt3efZ681KUxI5r28Rcxs37zn2PH98mOPV/JUDKqt8IOBd5BSlL2oBIj7kovWC+OH23Wb
	kU4N6NnEYaTO64oXRZ+2ZVgN8PG1EVxmVH36y68Rez10K0vYMMqI2OeJjT+fF0zZtRCDRo
	MXHQ4ZX5QAcuXWL0pea/TwMMWcjtr/ysX0EmJhITSqhz5N+I49gOVyFH0YrJQUAWJn/j3p
	o3daT+zn3QkVi/PbmQFWEsesgwB9BOgWYMWcR32uZWXyktC/+UWL4+7K7Es4fQ==
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664237588; a=rsa-sha256; cv=none;
	b=tOisloVOMUav7ZI5grAPhXKpjxxd2wIF6AfhZF3lTQPl0XPBM3Fq5TNCZVlo3k9RTqHMmY
	1pQnwr/UDdXjUv8A4ltNmFVts+5QpVceVkzKAw8NnVL0MypBTVUOzeWqP9MPiPVZRCq0cb
	Wd3LFkFE3irIMGh/twVNumSBgEOsbkYrnGQb5KWW9Nx/JiHxcfVNsFePSuQXmgjDGLTAKC
	p8pLNMjqsPuaf0NvKZKnV9JQjioAt/R51upWbnDo1EdSksl4/+dyP48atue3ETIx5jkzRE
	/a2XRjmyqDh1Q51kp+Ydi5pSQ7cFrAuEWmcO09tEBEqUv77v/gU/JpzFr/rsZQ==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=i5uVVUV1;
	dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none);
	spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"
X-Migadu-Spam-Score: 7.66
Authentication-Results: aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=i5uVVUV1;
	dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none);
	spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"
X-Migadu-Queue-Id: 7EEB2B5BF
X-Spam-Score: 7.66
X-Migadu-Scanner: scn1.migadu.com
X-TUID: sXI9n/LTKtSm

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