Move the explanation of umask 022 from settingenviron to aboutlfs

Explain it once we use it.  Also fix an error in the text (we don't make
files executable, we only make directories searchable).
This commit is contained in:
Xi Ruoyao 2025-01-12 11:55:59 +08:00
parent 625969c2de
commit 39679232f7
No known key found for this signature in database
GPG Key ID: ACAAD20E19E710E3
2 changed files with 12 additions and 5 deletions

View File

@ -33,6 +33,16 @@
default:</para> default:</para>
<screen role="nodump"><userinput>umask 022</userinput></screen> <screen role="nodump"><userinput>umask 022</userinput></screen>
<para>Setting the umask to 022 ensures that newly created files and
directories are only writable by their owner, but are readable and
searchable (only for directories) by anyone (assuming default modes are
used by the <ulink role='man' url='&man;open.2'>open(2)</ulink> system
call, new files will end up with permission mode 644 and directories with
mode 755). An over-permissive default can leave security holes in the
LFS system, and an over-restrictive default can cause strange issues
building or using the LFS system.</para>
<caution> <caution>
<para>Do not forget to check that <envar>LFS</envar> is set and the <para>Do not forget to check that <envar>LFS</envar> is set and the
umask is set to <literal>022</literal> whenever umask is set to <literal>022</literal> whenever

View File

@ -76,11 +76,8 @@ EOF</userinput></screen>
<varlistentry> <varlistentry>
<term><parameter>umask 022</parameter></term> <term><parameter>umask 022</parameter></term>
<listitem> <listitem>
<para>Setting the user file-creation mask (umask) to 022 ensures that newly <para>Setting the umask as we've already explained in
created files and directories are only writable by their owner, but are <xref linkend='ch-partitioning-aboutlfs' role='.'/></para>
readable and executable by anyone (assuming default modes are used by the
<ulink role='man' url='&man;open.2'>open(2)</ulink> system call, new files
will end up with permission mode 644 and directories with mode 755).</para>
</listitem> </listitem>
</varlistentry> </varlistentry>