unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#34730] [PATCH 0/4] Add (gnu build accounts) and use it to create /etc/passwd & co.
@ 2019-03-04 11:12 Ludovic Courtès
  2019-03-04 11:16 ` [bug#34730] [PATCH 1/4] system: Add (gnu system accounts) Ludovic Courtès
  2019-03-07 19:49 ` bug#34730: [PATCH 0/4] Add (gnu build accounts) and use it to create /etc/passwd & co Ludovic Courtès
  0 siblings, 2 replies; 6+ messages in thread
From: Ludovic Courtès @ 2019-03-04 11:12 UTC (permalink / raw)
  To: 34730

Hello Guix!

This patch series adds a new module, (gnu build accounts), and
uses it to create /etc/{passwd,group,shadow} upon system activation.

This replaces functionality currently provided by the Shadow
command-line tools (‘useradd’, ‘usermod’, etc.) and libc (‘getspnam’,
‘putpwent’, and all these wonderful APIs.)

It’s more code on our side, but it’s overall much less code involved
to create those databases.  The code makes the UID/GID allocation
strategy and state handling (preserving passwords and UIDs/GIDs, not
reusing currently-used UIDs/GIDs, etc.) much clearer and auditable.
Previously all this was buried in imperative calls to ‘useradd’ & co.,
which in turn have an ID allocation strategy baked deep down into
the Shadow code.

As a side effect the system boots slightly faster and we get PIDs
starting at ~190 instead of ~300 on a bare-bones system.  :-)

Feedback welcome!

Ludo’.

Ludovic Courtès (4):
  system: Add (gnu system accounts).
  activation: Operate on <user-account> and <user-group> records.
  Add (gnu build accounts).
  activation: Build account databases with (gnu build accounts).

 Makefile.am              |   1 +
 gnu/build/accounts.scm   | 561 +++++++++++++++++++++++++++++++++++++++
 gnu/build/activation.scm | 245 +++--------------
 gnu/build/install.scm    |   3 +-
 gnu/local.mk             |   2 +
 gnu/system/accounts.scm  | 109 ++++++++
 gnu/system/shadow.scm    |  92 +++----
 tests/accounts.scm       | 309 +++++++++++++++++++++
 8 files changed, 1061 insertions(+), 261 deletions(-)
 create mode 100644 gnu/build/accounts.scm
 create mode 100644 gnu/system/accounts.scm
 create mode 100644 tests/accounts.scm

-- 
2.21.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-03-07 19:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-04 11:12 [bug#34730] [PATCH 0/4] Add (gnu build accounts) and use it to create /etc/passwd & co Ludovic Courtès
2019-03-04 11:16 ` [bug#34730] [PATCH 1/4] system: Add (gnu system accounts) Ludovic Courtès
2019-03-04 11:16   ` [bug#34730] [PATCH 2/4] activation: Operate on <user-account> and <user-group> records Ludovic Courtès
2019-03-04 11:16   ` [bug#34730] [PATCH 3/4] Add (gnu build accounts) Ludovic Courtès
2019-03-04 11:16   ` [bug#34730] [PATCH 4/4] activation: Build account databases with " Ludovic Courtès
2019-03-07 19:49 ` bug#34730: [PATCH 0/4] Add (gnu build accounts) and use it to create /etc/passwd & co Ludovic Courtès

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).