From ae915b2a8a2b7e05756fb1246dd71772eb846490 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 21 Sep 2015 22:06:59 +0100 Subject: [PATCH] Disable chcon on NFS. --- libguestfs.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libguestfs.spec b/libguestfs.spec index ee55237..c1c7570 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -784,9 +784,12 @@ cp -a %{name}-%{version} tmp-python3 mv tmp-python3 %{name}-%{version}/python3 popd -if [ "$(getenforce | tr '[A-Z]' '[a-z]')" != "disabled" ]; then - # For sVirt to work, the local temporary directory we use in the - # tests must be labelled the same way as /tmp. +# For sVirt to work, the local temporary directory we use in the tests +# must be labelled the same way as /tmp. This doesn't work if either +# the directory is on NFS (no SELinux labels) or if SELinux is +# disabled, hence the tests. +if [ "$(stat -f -L -c %T .)" != "nfs" ] && \ + [ "$(getenforce | tr '[A-Z]' '[a-z]')" != "disabled" ]; then chcon --reference=/tmp tmp fi