[lfs] branch trunk updated: shadow: create empty /etc/sub{u,g}id files

git Owner ([email protected] via lfs-book Mailing List) <[email protected]> Sat, 04 Jul 2026 18:12:39 +0000
Newsgroups gmane.linux.lfs.book
Message-ID <178318875927.2587785.549419844500063335@rivendell.linuxfromscratch.org>
This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch trunk
in repository lfs.

The following commit(s) were added to refs/heads/trunk by this push:
     new 4344f6bde shadow: create empty /etc/sub{u,g}id files
4344f6bde is described below

commit 4344f6bdeac83fd8fccb686d48ad6ecf8acf4f9c
Author: Xi Ruoyao <[email protected]>
AuthorDate: Sun Jul 5 02:03:45 2026 +0800

    shadow: create empty /etc/sub{u,g}id files
    
    They are databases for subordinate user and group IDs, which are useful
    for rootless containers like podman (well, it's beyond BLFS but maybe
    users will install it on BLFS anyway).  If those files exist, useradd,
    groupadd, and etc. will automatically manage their contents; otherwise
    the user will create them (following the podman doc) and manage their
    contents for already created users/groups manually.  Doing so would be
    more error-prune than the automatic handling, and also inconsistent (the
    new user and groups will have the subordinate IDs automatically, but the
    existing user and groups will not).
    
    So for convinence and consistency, create them and let the Shadow
    utilities to manage them.
---
 chapter08/shadow.xml | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/chapter08/shadow.xml b/chapter08/shadow.xml
index 7104b2759..6364354d3 100644
--- a/chapter08/shadow.xml
+++ b/chapter08/shadow.xml
@@ -291,6 +291,22 @@ useradd -D --gid 999</userinput></screen>
 
     </variablelist>
 
+    <para>
+      Finally, create the empty <filename>/etc/subuid</filename> and
+      <filename>/etc/subgid</filename> files:
+    </para>
+
+    <screen><userinput>touch /etc/sub{u,g}id</userinput></screen>
+
+    <para>
+      The content of those files will be automatically updated by some
+      utilities provided by Shadow to allocate subordinate user and group
+      IDs.  Read the man pages
+      <ulink role='man' url='&man;subuid.5'>subuid(5)</ulink> and
+      <ulink role='man' url='&man;subgid.5'>subgid(5)</ulink> for the
+      details about the subordinate IDs.
+    </para>
+
   </sect2>
 
   <sect2 role="configuration">

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

-- 
http://lists.linuxfromscratch.org/sympa/info/lfs-book
Unsubscribe: See the above information page