From: Dariqq <dariqq@posteo.net>
To: 73680@debbugs.gnu.org
Subject: bug#73680: privileged-programs: cant set setuid/setgid to new accounts/groups
Date: Tue, 8 Oct 2024 10:45:44 +0000 [thread overview]
Message-ID: <82936b4e-f572-407a-a98d-1d5771c6ec37@posteo.net> (raw)
In-Reply-To: <5c7a4291-cc53-447d-bbc8-33f69788eae8@posteo.net>
I downloaded the latest iso
(https://ci.guix.gnu.org/build/6060923/details from yesterday) and tried
to install opensmtpd in there.
After the reconfigure i got the 'failed to privilege <binary>: Success'
warning but upon reboot things were working.
I think I know what is happening now:
The *first* time we try to privilege something it fails because the
group does not yet exist. After a reboot it is succeeeding because it is
using the group info from the previous boot, because that has not been
recreated yet.
This seems to work for groups because the getgrnam error "group does not
exist" is a 'system-error being caught by the exception handler, while
the getpwnam-error "user does not exist" is a 'misc-error instead,
causing a backtrace which aborts further activation scripts (that would
create the user)
As a simple workaround we could catch the getpwnam error too but this is
not really solving anything and relies on previous state which might be
incorrect. This is also really fragile.
Another idea would be to run the account+user creating scripts as early
as possible. Or as a more thorough solution model the dependency on
users/groups directly to enforce the ordering (might be problematic
because some activation scripts also requrie a user/group to set
permissions which would make the extension graph not acyclic (accounts
-> activation -> accounts). Maybe this is doable with a more minimal
accounts service that only knows about users/group names?
I am surprised this has not been causing issues earlier as also a lot of
direct activation-extensions set ownership on directories (that this
works seems like a lucky coincidence in how
service-extension/service-folding works rather than a design consideration).
next prev parent reply other threads:[~2024-10-08 10:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-07 14:55 bug#73680: privileged-programs: cant set setuid/setgid to new accounts/groups Dariqq
[not found] ` <handler.73680.B.17283129493491.ack@debbugs.gnu.org>
2024-10-07 20:31 ` bug#73680: Acknowledgement (privileged-programs: cant set setuid/setgid to new accounts/groups) Dariqq
2024-10-08 10:45 ` Dariqq [this message]
2024-10-09 16:35 ` bug#73680: privileged-programs: cant set setuid/setgid to new accounts/groups Dariqq
2024-10-09 18:08 ` Dariqq
2024-10-12 8:20 ` Dariqq
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=82936b4e-f572-407a-a98d-1d5771c6ec37@posteo.net \
--to=dariqq@posteo.net \
--cc=73680@debbugs.gnu.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).