X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2FMakefile.am;h=f38a91570ac214abfefa91dbc22e41cf64c91033;hb=d156fd724dd7e1064c41c21bd2005da55d5175d7;hp=4764a550d4baee613a3fd2a9600f17f7a15e526d;hpb=cb9613b993792c1c4b14fa0d9b5001ff644ac2f4;p=libguestfs.git diff --git a/src/Makefile.am b/src/Makefile.am index 4764a55..f38a915 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -176,3 +176,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