lxc-download: Ignore return code from subshell

The previous change fixed parsing of multiple uid/gid ranges by using a while loop, however a failure in that loop will cause the script to exit (due to -e), so we need to ignore the return value of the commands inside that loop. Signed-off-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 5292adfd
...@@ -143,8 +143,8 @@ gpg_validate() { ...@@ -143,8 +143,8 @@ gpg_validate() {
in_userns() { in_userns() {
[ -e /proc/self/uid_map ] || { echo no; return; } [ -e /proc/self/uid_map ] || { echo no; return; }
awk '{ print $1 " " $2 " " $3 }' /proc/self/uid_map | while read line; do awk '{ print $1 " " $2 " " $3 }' /proc/self/uid_map | while read line; do
[ "$line" = "0 0 4294967295" ] && { echo no; return; } [ "$line" = "0 0 4294967295" ] && { echo no; return; } || true
echo $line | grep -q " 0 1$" && { echo userns-root; return; } echo $line | grep -q " 0 1$" && { echo userns-root; return; } || true
done done
[ "$(cat /proc/self/uid_map)" = "$(cat /proc/1/uid_map)" ] && \ [ "$(cat /proc/self/uid_map)" = "$(cat /proc/1/uid_map)" ] && \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment