exit immediately if attempting to run the test suite as root
[debian/tar] / debian / rules
index 3d6913c625fa3bedbbf5594d54d497de1341374a..7344973281f6e6c253d3ec1e61d0d91c6376021d 100755 (executable)
@@ -25,6 +25,12 @@ build-stamp: configure-stamp
 
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+       @runas=`whoami` ; \
+       if test $$runas = "root" ; \
+       then \
+         echo "Sorry, but the test suite is not designed to be run as root."; \
+         exit 1 ;\
+       fi
        (cd tests ; $(MAKE) clean)
        $(MAKE) check
 endif