From: Maxime Devos <maximedevos@telenet.be>
To: "Mark H Weaver" <mhw@netris.org>, "Ludovic Courtès" <ludo@gnu.org>
Cc: Brendan Tildesley <btild@mailbox.org>, 36508@debbugs.gnu.org
Subject: bug#36508: GDM files have incorrect owner after temporarily removing service
Date: Fri, 16 Apr 2021 12:42:53 +0200 [thread overview]
Message-ID: <38fd9bfdc71c689df1606a0b00d632e423c5defa.camel@telenet.be> (raw)
In-Reply-To: <87eefbidcs.fsf@netris.org>
[-- Attachment #1: Type: text/plain, Size: 2389 bytes --]
On Thu, 2021-04-15 at 14:58 -0400, Mark H Weaver wrote:
> Ludovic Courtès <ludo@gnu.org> writes:
>
> > Mark H Weaver <mhw@netris.org> skribis:
> >
> > > Here's one idea: when activating a system, *never* delete users or
> > > groups if files still exist that are owned by those users/groups.
> > > Checking all filesystems would likely be too expensive, but perhaps it
> > > would be sufficient to check certain directories such as /var, /etc, and
> > > possibly the top directory of /home.
And /tmp, /media and /run/user.
> >
> > How would you determine which directories to look at though? What if we
> > miss an important one?
>
> I have another idea:
>
> Maintain historical mappings from user/group names to UIDs/GIDs, perhaps
> in some file in /etc, where entries are added but *never* automatically
> removed. When allocating UIDs/GIDs, we would avoid any UIDs/GIDs in the
> range of those mappings.
This seems rather convoluted to me. Why not reuse /etc/passwd and /etc/groups?
My suggestion:
1. *never* automatically delete users/groups from /etc/passwd, /etc/groups
(I thought that was how Guix already worked ...)
2. as users and groups appearing in /etc/passwd and /etc/groups, but not
in the operating system configuration can be confusing, change the comment
string of these users and groups, to something like
"account removed"
Add a group 'user-graveyard' for (3), and move these 'pseudo-removed' users
to the 'user-graveyard' group.
3. Don't forget to remove graveyard users from all groups (except user-graveyard),
make sure the graveyard users can't log in anymore ... (Perhaps add a rule to
the SSH and PAM configuration that forbids logging in to graveyard accounts,
by checking whether the user is in the 'user-graveyard' group?)
> Then, provide a UID/GID garbage collector, to be explicitly run by users
> if desired, which would scan all filesystems to find the set of UID/GIDs
> currently referenced, and remove entries from the historical mappings
> that are no longer needed.
That seems useful for if /etc/passwd and /etc/group is getting full, or just for
cleaning up. You may want to exclude /gnu/store though, for efficiency (-:.
And just in case check whether any live processes have the UID/GID.
Suggested command name: "guix user-gc".
Greetings,
Maxime.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
next prev parent reply other threads:[~2021-04-16 10:44 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-05 8:36 bug#36508: GDM files have incorrect owner after temporarily replacing with SDDM ison
2021-04-13 13:24 ` bug#36508: GDM files have incorrect owner after temporarily removing service Brendan Tildesley via Bug reports for GNU Guix
2021-04-13 20:51 ` Mark H Weaver
2021-04-14 4:31 ` Brendan Tildesley via Bug reports for GNU Guix
2021-04-15 18:09 ` Mark H Weaver
2021-04-14 10:32 ` Ludovic Courtès
2021-04-14 12:21 ` Brendan Tildesley via Bug reports for GNU Guix
2021-04-15 14:24 ` Ludovic Courtès
2021-04-15 18:30 ` Mark H Weaver
2021-04-15 20:05 ` Ludovic Courtès
2021-04-15 22:22 ` Mark H Weaver
2021-04-16 15:18 ` Ludovic Courtès
2021-04-17 16:16 ` Mark H Weaver
2021-04-15 23:04 ` Mark H Weaver
2021-04-16 15:14 ` Ludovic Courtès
2021-04-15 18:35 ` Mark H Weaver
2021-04-15 18:58 ` Mark H Weaver
2021-04-16 10:42 ` Maxime Devos [this message]
2021-04-17 16:28 ` Mark H Weaver
2022-09-18 12:22 ` bug#36508: [DRAFT PATCH] Stable allocation of uids, by keeping a historical mapping Maxime Devos
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=38fd9bfdc71c689df1606a0b00d632e423c5defa.camel@telenet.be \
--to=maximedevos@telenet.be \
--cc=36508@debbugs.gnu.org \
--cc=btild@mailbox.org \
--cc=ludo@gnu.org \
--cc=mhw@netris.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).