From 625969c2de5402dce45ff0ae93c1b17ffe050e41 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 12 Jan 2025 11:43:36 +0800 Subject: [PATCH 1/5] aboutlfs: Also mention umask in addition to export LFS= for bash profiles --- chapter02/aboutlfs.xml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/chapter02/aboutlfs.xml b/chapter02/aboutlfs.xml index 64229f114..158f8f3a5 100644 --- a/chapter02/aboutlfs.xml +++ b/chapter02/aboutlfs.xml @@ -57,24 +57,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. From 39679232f7a6ebfcd5d9a410b26cf0e3c7cabe00 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 12 Jan 2025 11:55:59 +0800 Subject: [PATCH 2/5] 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). --- chapter02/aboutlfs.xml | 10 ++++++++++ chapter04/settingenviron.xml | 7 ++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/chapter02/aboutlfs.xml b/chapter02/aboutlfs.xml index 158f8f3a5..f46d4e3ba 100644 --- a/chapter02/aboutlfs.xml +++ b/chapter02/aboutlfs.xml @@ -33,6 +33,16 @@ 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 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. + Do not forget to check that LFS is set and the umask is set to 022 whenever diff --git a/chapter04/settingenviron.xml b/chapter04/settingenviron.xml index b179bb0b3..564e29d84 100644 --- a/chapter04/settingenviron.xml +++ b/chapter04/settingenviron.xml @@ -76,11 +76,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 + From 016ba17be9c30b1a39718da471619706888dbea7 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 12 Jan 2025 13:20:45 +0800 Subject: [PATCH 3/5] procps: Remove the systemd revision specific workaround The issue is fixed in procps-ng-4.0.5. --- chapter08/procps.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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