diff --git a/chapter02/aboutlfs.xml b/chapter02/aboutlfs.xml index 64229f114..a04b1c422 100644 --- a/chapter02/aboutlfs.xml +++ b/chapter02/aboutlfs.xml @@ -28,11 +28,21 @@ /mnt/lfs (or whatever value the variable was set to) when it processes the command line. - Now setting the file mode creation mask (umask) to + Now set the file mode creation mask (umask) to 022 in case the host distro uses a different default: umask 022 + + 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 open(2) system + call, new files will end up with permission mode 644 and directories with + mode 755). An overly-permissive default can leave security holes in the + LFS system, and an overly-restrictive default can cause strange issues + building or using the LFS system. + Do not forget to check that LFS is set and the umask is set to 022 whenever @@ -57,24 +67,26 @@ given earlier on this page to set $LFS to the correct directory name and set umask to 022. - One way to ensure that the LFS variable is always - set is to edit the .bash_profile file in both your - personal home directory and in /root/.bash_profile and - enter the export command above. In addition, the shell specified in the + One way to ensure that the LFS variable and the + umask are always set properly is to edit the + .bash_profile file in both your personal home + directory and in /root/.bash_profile and + enter the export and umask commands + above. In addition, the shell specified in the /etc/passwd file for all users that need the LFS variable must be bash to ensure that the - /root/.bash_profile file is incorporated as a part of + .bash_profile file is incorporated as a part of the login process. Another consideration is the method that is used to log into the host system. If logging in through a graphical display manager, the user's .bash_profile is not normally used when - a virtual terminal is started. In this case, add the export command to + a virtual terminal is started. In this case, add the commands to the .bashrc file for the user and root. In addition, some distributions use an "if" test, and do not run the remaining .bashrc instructions for a non-interactive bash invocation. Be sure to place the - export command ahead of the test for non-interactive use. + commands ahead of the test for non-interactive use. diff --git a/chapter04/creatingminlayout.xml b/chapter04/creatingminlayout.xml index 54d86c0d8..119b600ca 100644 --- a/chapter04/creatingminlayout.xml +++ b/chapter04/creatingminlayout.xml @@ -18,7 +18,7 @@ location. We do this so those temporary programs will be overwritten when the final versions are built in . - At first, set the owner and permission mode of the + First, set the owner and permission mode of the $LFS directory (i.e. the root directory in the newly created file system for the LFS system) to &root; and 755 in case the host distro has been diff --git a/chapter04/settingenviron.xml b/chapter04/settingenviron.xml index 67c2bd886..95da193c0 100644 --- a/chapter04/settingenviron.xml +++ b/chapter04/settingenviron.xml @@ -90,11 +90,8 @@ EOF umask 022 - Setting the user file-creation mask (umask) to 022 ensures that newly - created files and directories are only writable by their owner, but are - readable and executable by anyone (assuming default modes are used by the - open(2) system call, new files - will end up with permission mode 644 and directories with mode 755). + Setting the umask as we've already explained in + diff --git a/chapter08/procps.xml b/chapter08/procps.xml index 8a4716ade..399d0cec7 100644 --- a/chapter08/procps.xml +++ b/chapter08/procps.xml @@ -67,8 +67,7 @@ Compile the package: -make -make src_w_LDADD='$(LDADD) -lsystemd' +make