From 8e560b4a8af6dc50ea0d62872ee56d7bab65771e Mon Sep 17 00:00:00 2001 From: Filippo Squillace Date: Tue, 16 Feb 2021 18:13:27 +0100 Subject: [PATCH] Make namespace check more robust and update README --- README.md | 4 ++-- lib/core/namespace.sh | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fc0f5ba..ee832f1 100644 --- a/README.md +++ b/README.md @@ -139,14 +139,14 @@ command. In `proot` mode, JuNest does no longer support the building of AUR pack first: ```sh -pacman -Sy --ignore sudo base-devel +pacman -Syu --ignore sudo base-devel :: sudo is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n] n ... ... ``` JuNest uses a modified version of `sudo`. That's why the original `sudo` -package must be ignored in the previous command. +package **must be ignored** in the previous command. Have fun! --------- diff --git a/lib/core/namespace.sh b/lib/core/namespace.sh index c80b80d..e9d3a53 100644 --- a/lib/core/namespace.sh +++ b/lib/core/namespace.sh @@ -27,7 +27,9 @@ function _is_user_namespace_enabled() { return $NOT_EXISTING_FILE fi - if ! zgrep_cmd -q "CONFIG_USER_NS=y" $config_file + # `-q` option in zgrep may cause a gzip: stdout: Broken pipe + # Use redirect to /dev/null instead + if ! zgrep_cmd "CONFIG_USER_NS=y" $config_file > /dev/null then return $NO_CONFIG_FOUND fi @@ -37,7 +39,9 @@ function _is_user_namespace_enabled() { return 0 fi - if ! zgrep_cmd -q "1" $PROC_USERNS_CLONE_FILE + # `-q` option in zgrep may cause a gzip: stdout: Broken pipe + # Use redirect to /dev/null instead + if ! zgrep_cmd "1" $PROC_USERNS_CLONE_FILE > /dev/null then return $UNPRIVILEGED_USERNS_DISABLED fi