From 6e179a90255308dc64eec386fb3ae49ab16acca4 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 27 Apr 2024 12:22:28 +0800 Subject: [PATCH] changingowner: Add --from lfs for chown root:root commands So if the user has not set $LFS properly, chown will do nothing instead of wreak havoc in the host distro. --from has been available for Coreutils chown since 2000 so we don't need to raise the host system requirement. --- chapter07/changingowner.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter07/changingowner.xml b/chapter07/changingowner.xml index 8f7b5519c..16c052b39 100644 --- a/chapter07/changingowner.xml +++ b/chapter07/changingowner.xml @@ -33,9 +33,9 @@ user root by running the following command: -chown -R root:root $LFS/{usr,lib,var,etc,bin,sbin,tools} +chown --from lfs -R root:root $LFS/{usr,lib,var,etc,bin,sbin,tools} case $(uname -m) in - x86_64) chown -R root:root $LFS/lib64 ;; + x86_64) chown --from lfs -R root:root $LFS/lib64 ;; esac