X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=src%2FMakefile.am;h=ad3b478954761252e0adec3ea69329769aac3dcc;hp=43f1b0d2b60f9b4976034fb915cbf25c067682d4;hb=8fca8549edb1581448fa45d08d90bad399c5dbfa;hpb=2a9abc7791a12af07ec2dada4b3a9a16eb452dca diff --git a/src/Makefile.am b/src/Makefile.am index 43f1b0d..ad3b478 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -179,3 +179,14 @@ guestfs.3: guestfs.pod \ --name "guestfs" \ --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \ > $@ + +# Check user doesn't try to do 'make all' or 'make check' as root. +# https://www.redhat.com/archives/libguestfs/2010-April/msg00098.html + +all-local: checkroot +check-local: checkroot +checkroot: + @if [ "`id -u`" = 0 ]; then \ + echo "*** Error: Don't run 'make' or 'make check' as root."; \ + exit 1; \ + fi