aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2023-08-09 22:29:44 +0800
committerXi Ruoyao <xry111@xry111.site>2023-08-09 22:30:52 +0800
commit7c306241b640614e28805de23becdd339fcb2d73 (patch)
treef12c99624128c768401db007c3daff47c7b9d2f9
parent91f9a174b535628ce48a1a8f9c3dddc3b9389f06 (diff)
coreutils: Use groupadd/groupdel for creating/removing dummy group
They look better than "echo >>" and "sed -i". And I think an example showing how to use groupadd/groupdel is good anyway. The format of /etc/group is already shown in chapter 7.
-rw-r--r--chapter08/coreutils.xml5
1 files changed, 3 insertions, 2 deletions
diff --git a/chapter08/coreutils.xml b/chapter08/coreutils.xml
index c72041b3b..7d715f2f3 100644
--- a/chapter08/coreutils.xml
+++ b/chapter08/coreutils.xml
@@ -116,7 +116,7 @@ FORCE_UNSAFE_CONFIGURE=1 ./configure \
these tests are not skipped, add a temporary group and make the
user <systemitem class="username">tester</systemitem> a part of it:</para>
-<screen><userinput remap="test">echo "dummy:x:102:tester" &gt;&gt; /etc/group</userinput></screen>
+<screen><userinput remap="test">groupadd -g 102 dummy -U tester</userinput></screen>
<para>Fix some of the permissions so that the non-&root; user can
compile and run the tests:</para>
@@ -134,7 +134,8 @@ FORCE_UNSAFE_CONFIGURE=1 ./configure \
<para>Remove the temporary group:</para>
-<screen><userinput remap="test">sed -i '/dummy/d' /etc/group</userinput></screen>
+<screen><userinput remap="test">groupdel dummy</userinput></screen>
+
<para>Install the package:</para>
<screen><userinput remap="install">make install</userinput></screen>