<feed xmlns='http://www.w3.org/2005/Atom'>
<title>guix/gnu/build/accounts.scm, branch master</title>
<subtitle>Transactional package manager, declarative GNU/Linux distribution, reproducible deployment tool, and more! https://guix.gnu.org</subtitle>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/'/>
<entry>
<title>system: Relax subordinate ID validation.</title>
<updated>2025-12-11T14:43:16+00:00</updated>
<author>
<name>Giacomo Leidi</name>
<email>therewasa@fishinthecalculator.me</email>
</author>
<published>2025-11-15T10:18:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=fdb46ae7b19d45a6a1f5adb660283981bf4b7a1d'/>
<id>fdb46ae7b19d45a6a1f5adb660283981bf4b7a1d</id>
<content type='text'>
https://codeberg.org/guix/guix/issues/3925 raised the inabilityy of the
subordinate IDs service of handling externally managed sub{u,g}id file
entries. This patch relaxes the checks in place for existing ranges,
by allowing subid-range records lower than %subordinate-id-min, leaving
all the space from subid 0 to %subordinate-id-min - 1 to external
users. Generic ranges are still allocated within %subordinate-id-min and
%subordinate-id-max.

* gnu/build/accounts.scm (&lt;unused-id-range&gt;)[min]: Change default value
to 0, allowing subid-ranges with a start lesser than
%subordinate-id-min.
(allocate-generic-range): Allocate generic ranges starting from
%subordinate-id-min, leaving ranges starting before %subordinate-id-min.
(allocate-specific-range): Move bounds check to...
(allocate-subids): ...here. Now bound validation is applied only to user
provided ranges.
* tests/accounts.scm: Test new behavior.

Fixes: guix/guix#3925
Change-Id: Id923b122c97a20f148684f5fb144fd9422810612
Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
Merges: #4235
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://codeberg.org/guix/guix/issues/3925 raised the inabilityy of the
subordinate IDs service of handling externally managed sub{u,g}id file
entries. This patch relaxes the checks in place for existing ranges,
by allowing subid-range records lower than %subordinate-id-min, leaving
all the space from subid 0 to %subordinate-id-min - 1 to external
users. Generic ranges are still allocated within %subordinate-id-min and
%subordinate-id-max.

* gnu/build/accounts.scm (&lt;unused-id-range&gt;)[min]: Change default value
to 0, allowing subid-ranges with a start lesser than
%subordinate-id-min.
(allocate-generic-range): Allocate generic ranges starting from
%subordinate-id-min, leaving ranges starting before %subordinate-id-min.
(allocate-specific-range): Move bounds check to...
(allocate-subids): ...here. Now bound validation is applied only to user
provided ranges.
* tests/accounts.scm: Test new behavior.

Fixes: guix/guix#3925
Change-Id: Id923b122c97a20f148684f5fb144fd9422810612
Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
Merges: #4235
</pre>
</div>
</content>
</entry>
<entry>
<title>accounts: Add /etc/subid and /etc/subgid allocation logic.</title>
<updated>2024-12-18T17:32:40+00:00</updated>
<author>
<name>Giacomo Leidi</name>
<email>goodoldpaul@autistici.org</email>
</author>
<published>2024-10-07T22:40:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=337037d22cfcc7764c1ce87127166c351a91369d'/>
<id>337037d22cfcc7764c1ce87127166c351a91369d</id>
<content type='text'>
This commit adds allocation logic for subid ranges. Subid ranges are
ranges of contiguous subids that are mapped to a user in the host
system. This patch implements a flexible allocation algorithm allowing
users that do not want (or need) to specify details of the subid ranges
that they are requesting to avoid doing so, while upholding requests of
users that need to have specific ranges.

* gnu/build/accounts.scm (%subordinate-id-min): New variable;
(%subordinate-id-max): new variable;
(%subordinate-id-count): new variable;
(subordinate-id?): new variable;
(&amp;subordinate-id-error): new variable;
(&amp;subordinate-id-overflow-error): new variable;
(&amp;illegal-subid-range-error): new variable;
(&amp;specific-subid-range-expected-error): new variable;
(&amp;generic-subid-range-expected-error): new variable;
(within-interval?): new variable;
(allocate-unused-range): new variable;
(allocate-generic-range): new variable;
(allocate-specific-range): new variable;
(reserve-subids): new variable;
(range-&gt;entry): new variable;
(entry-&gt;range): new variable;
(allocate-subids): new variable;
(subuid+subgid-databases): new variable.

* gnu/system/accounts.scm (subid-range-end): New variable;
(subid-range-has-start?): new variable;
(subid-range-less): new variable.

* test/accounts.scm: Test them.

Change-Id: I8de1fd7cfe508b9c76408064d6f498471da0752d
Co-Authored-By: Ludovic Courtès &lt;ludo@gnu.org&gt;
Signed-off-by: Giacomo Leidi &lt;goodoldpaul@autistici.org&gt;
Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit adds allocation logic for subid ranges. Subid ranges are
ranges of contiguous subids that are mapped to a user in the host
system. This patch implements a flexible allocation algorithm allowing
users that do not want (or need) to specify details of the subid ranges
that they are requesting to avoid doing so, while upholding requests of
users that need to have specific ranges.

* gnu/build/accounts.scm (%subordinate-id-min): New variable;
(%subordinate-id-max): new variable;
(%subordinate-id-count): new variable;
(subordinate-id?): new variable;
(&amp;subordinate-id-error): new variable;
(&amp;subordinate-id-overflow-error): new variable;
(&amp;illegal-subid-range-error): new variable;
(&amp;specific-subid-range-expected-error): new variable;
(&amp;generic-subid-range-expected-error): new variable;
(within-interval?): new variable;
(allocate-unused-range): new variable;
(allocate-generic-range): new variable;
(allocate-specific-range): new variable;
(reserve-subids): new variable;
(range-&gt;entry): new variable;
(entry-&gt;range): new variable;
(allocate-subids): new variable;
(subuid+subgid-databases): new variable.

* gnu/system/accounts.scm (subid-range-end): New variable;
(subid-range-has-start?): new variable;
(subid-range-less): new variable.

* test/accounts.scm: Test them.

Change-Id: I8de1fd7cfe508b9c76408064d6f498471da0752d
Co-Authored-By: Ludovic Courtès &lt;ludo@gnu.org&gt;
Signed-off-by: Giacomo Leidi &lt;goodoldpaul@autistici.org&gt;
Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>accounts: Add /etc/subuid and /etc/subgid support.</title>
<updated>2024-12-18T17:32:40+00:00</updated>
<author>
<name>Giacomo Leidi</name>
<email>goodoldpaul@autistici.org</email>
</author>
<published>2024-10-07T22:40:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=58f430f69e71f95cedab9912c1c9f2cc8660fad9'/>
<id>58f430f69e71f95cedab9912c1c9f2cc8660fad9</id>
<content type='text'>
This commit adds a new record type, &lt;subid-entry&gt; and serializers
and deserializers for it in (gnu build accounts).  Each instance of this
record represents one line in either /etc/subuid or /etc/subgid.  Since
Shadow uses the same representation for both files, it should be ok if
we do it as well.

This commit adds also &lt;subid-range&gt;, a user facing representation of
&lt;subid-entry&gt;. It is supposed to be usable directly in OS configurations.

* gnu/build/accounts.scm (subid-entry): New record;
(write-subgid): add serializer for subgids;
(write-subuid): add serializer for subuids;
(read-subgid): add serializer for subgids;
(read-subuid): add serializer for subuids.
* gnu/system/accounts.scm (subid-range): New record.
* test/accounts.scm: Test them.

Change-Id: I6b037e40e354c069bf556412bb5b626bd3ea1b2c
Signed-off-by: Giacomo Leidi &lt;goodoldpaul@autistici.org&gt;
Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit adds a new record type, &lt;subid-entry&gt; and serializers
and deserializers for it in (gnu build accounts).  Each instance of this
record represents one line in either /etc/subuid or /etc/subgid.  Since
Shadow uses the same representation for both files, it should be ok if
we do it as well.

This commit adds also &lt;subid-range&gt;, a user facing representation of
&lt;subid-entry&gt;. It is supposed to be usable directly in OS configurations.

* gnu/build/accounts.scm (subid-entry): New record;
(write-subgid): add serializer for subgids;
(write-subuid): add serializer for subuids;
(read-subgid): add serializer for subgids;
(read-subuid): add serializer for subuids.
* gnu/system/accounts.scm (subid-range): New record.
* test/accounts.scm: Test them.

Change-Id: I6b037e40e354c069bf556412bb5b626bd3ea1b2c
Signed-off-by: Giacomo Leidi &lt;goodoldpaul@autistici.org&gt;
Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>accounts: Fix typo in comment.</title>
<updated>2023-10-12T16:53:06+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2023-10-12T14:41:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=8b8ab17561cad10ce2b613ece8e8cdfba729fc1a'/>
<id>8b8ab17561cad10ce2b613ece8e8cdfba729fc1a</id>
<content type='text'>
* gnu/build/accounts.scm (passwd-&gt;shadow): Fix typo in comment.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* gnu/build/accounts.scm (passwd-&gt;shadow): Fix typo in comment.
</pre>
</div>
</content>
</entry>
<entry>
<title>accounts: Ensure ‘last-change’ field of shadow entries is never zero.</title>
<updated>2023-10-08T21:43:49+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2023-10-07T16:19:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=002c5bec07e88c00d9d96209438728d0271f57da'/>
<id>002c5bec07e88c00d9d96209438728d0271f57da</id>
<content type='text'>
* gnu/build/accounts.scm (passwd-&gt;shadow): Add ‘max’ call so NOW is
greater than or equal to 1.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* gnu/build/accounts.scm (passwd-&gt;shadow): Add ‘max’ call so NOW is
greater than or equal to 1.
</pre>
</div>
</content>
</entry>
<entry>
<title>system: Allow 'chfn' to change the user's full name.</title>
<updated>2022-01-01T14:10:12+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2021-12-31T16:45:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=671e6a81804f264ddcdd6fe7579644404da079b8'/>
<id>671e6a81804f264ddcdd6fe7579644404da079b8</id>
<content type='text'>
Fixes &lt;https://issues.guix.gnu.org/52539&gt;.
Reported by Jacob First &lt;jacob.first@member.fsf.org&gt;.

* gnu/build/accounts.scm (allocate-passwd): Add comment as to why
'real-name' is taken from PREVIOUS.  Add (not system?) to the
condition.
* gnu/system.scm (operating-system-etc-service) &lt;login.defs&gt;: Add
"CHFN_RESTRICT".
* gnu/system.scm (%setuid-programs): Add "chfn".
* gnu/system/pam.scm (base-pam-services): Add "chfn".
* doc/guix.texi (User Accounts): Document it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes &lt;https://issues.guix.gnu.org/52539&gt;.
Reported by Jacob First &lt;jacob.first@member.fsf.org&gt;.

* gnu/build/accounts.scm (allocate-passwd): Add comment as to why
'real-name' is taken from PREVIOUS.  Add (not system?) to the
condition.
* gnu/system.scm (operating-system-etc-service) &lt;login.defs&gt;: Add
"CHFN_RESTRICT".
* gnu/system.scm (%setuid-programs): Add "chfn".
* gnu/system/pam.scm (base-pam-services): Add "chfn".
* doc/guix.texi (User Accounts): Document it.
</pre>
</div>
</content>
</entry>
<entry>
<title>accounts: Delete duplicate entries.</title>
<updated>2019-08-27T22:27:14+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2019-08-27T20:38:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=dd4e46edda6c255ca170a6650c6f92b16ff50a3f'/>
<id>dd4e46edda6c255ca170a6650c6f92b16ff50a3f</id>
<content type='text'>
When adding multiple instances of a service requiring some user
account/group, we could end up with multiple entries for that account or
group in /etc/passwd or /etc/group.

* gnu/build/accounts.scm (database-writer)[write-entries]: Add call to
'delete-duplicates'.
* tests/accounts.scm ("write-passwd with duplicate entry"): New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When adding multiple instances of a service requiring some user
account/group, we could end up with multiple entries for that account or
group in /etc/passwd or /etc/group.

* gnu/build/accounts.scm (database-writer)[write-entries]: Add call to
'delete-duplicates'.
* tests/accounts.scm ("write-passwd with duplicate entry"): New test.
</pre>
</div>
</content>
</entry>
<entry>
<title>accounts: Use 'fsync' instead of 'fdatasync'.</title>
<updated>2019-06-27T09:14:40+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2019-06-27T08:39:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=c25b44d640f709599e3c484a458ae452d99108e1'/>
<id>c25b44d640f709599e3c484a458ae452d99108e1</id>
<content type='text'>
* gnu/build/accounts.scm (catch-ENOSYS): Remove.
(database-writer): Use 'fsync' instead of 'fdatasync'.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* gnu/build/accounts.scm (catch-ENOSYS): Remove.
(database-writer): Use 'fsync' instead of 'fdatasync'.
</pre>
</div>
</content>
</entry>
<entry>
<title>accounts: Call 'fdatasync' when writing databases.</title>
<updated>2019-06-05T21:10:37+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2019-06-05T09:14:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=d088d5c4848f08bd62e722789132f9345659c52c'/>
<id>d088d5c4848f08bd62e722789132f9345659c52c</id>
<content type='text'>
* gnu/build/accounts.scm (catch-ENOSYS): New macro.
(database-writer): Call 'fdatasync'.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* gnu/build/accounts.scm (catch-ENOSYS): New macro.
(database-writer): Call 'fdatasync'.
</pre>
</div>
</content>
</entry>
<entry>
<title>accounts: Close database before renaming it.</title>
<updated>2019-06-05T21:10:37+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2019-06-05T09:12:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=ed8570dce3683b73bdf668b3ad0f529a1cea30c5'/>
<id>ed8570dce3683b73bdf668b3ad0f529a1cea30c5</id>
<content type='text'>
Fixes &lt;https://bugs.gnu.org/35996&gt;.
Reported by Florian Pelz &lt;pelzflorian@pelzflorian.de&gt;.

* gnu/build/accounts.scm (database-writer): Move 'close-port' call
before 'rename-file'.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes &lt;https://bugs.gnu.org/35996&gt;.
Reported by Florian Pelz &lt;pelzflorian@pelzflorian.de&gt;.

* gnu/build/accounts.scm (database-writer): Move 'close-port' call
before 'rename-file'.
</pre>
</div>
</content>
</entry>
</feed>
