installing appears broken by 199f218bf431b77c12a728f7072bed1553a0f0af
The intent of commit 199f218bf431b77c12a728f7072bed1553a0f0af seems praiseworthy, but since 'all-am' is automatically added by Automake as a prerequisite of the 'install' target, its effect is to stop people running 'make install' as root: make install-am make[2]: Entering directory `/usr/src/libguestfs/x86_64-spindle/src' make -C ../generator stamp-generator make[3]: Entering directory `/usr/src/libguestfs/x86_64-spindle/generator' make[3]: `stamp-generator' is up to date. make[3]: Leaving directory `/usr/src/libguestfs/x86_64-spindle/generator' *** Error: Don't run 'make' or 'make check' as root. make[2]: *** [checkroot] Error 1 make[2]: Leaving directory `/usr/src/libguestfs/x86_64-spindle/src' make[1]: *** [install] Error 2 make[1]: Leaving directory `/usr/src/libguestfs/x86_64-spindle/src' make: *** [install-recursive] Error 1 This seems... counterintuitive. Was that really the intent of this change? (And how did nobody notice it? I'm using Automake 1.11.1, but Automake has done this for a long, long time.)
On Sat, Oct 23, 2010 at 11:23:41PM +0100, Nix wrote:
The intent of commit 199f218bf431b77c12a728f7072bed1553a0f0af seems praiseworthy, but since 'all-am' is automatically added by Automake as a prerequisite of the 'install' target, its effect is to stop people running 'make install' as root:
make install-am make[2]: Entering directory `/usr/src/libguestfs/x86_64-spindle/src' make -C ../generator stamp-generator make[3]: Entering directory `/usr/src/libguestfs/x86_64-spindle/generator' make[3]: `stamp-generator' is up to date. make[3]: Leaving directory `/usr/src/libguestfs/x86_64-spindle/generator' *** Error: Don't run 'make' or 'make check' as root. make[2]: *** [checkroot] Error 1 make[2]: Leaving directory `/usr/src/libguestfs/x86_64-spindle/src' make[1]: *** [install] Error 2 make[1]: Leaving directory `/usr/src/libguestfs/x86_64-spindle/src' make: *** [install-recursive] Error 1
This seems... counterintuitive. Was that really the intent of this change?
The intent is to stop anyone running 'make all' as root. People used to see "permission error" from febootstrap and think that meant they had to run the build as root (which you must *not* do and is actively dangerous). What I don't understand is why 'make install' is running the all-local rule.
(And how did nobody notice it? I'm using Automake 1.11.1, but Automake has done this for a long, long time.)
I guess we never run 'make install' as root. I use libguestfs from the build directory, or build it in RPM (which does 'make install DESTDIR=...' as non-root). See the various */run*local scripts. Thanks for the report, do you have a suggested patch which just stops people doing make all/check as root? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
On Sun, Oct 24, 2010 at 09:19:28AM +0100, Richard W.M. Jones wrote:
Thanks for the report, do you have a suggested patch which just stops people doing make all/check as root?
Or thinking about this a bit more, it may be enough to prevent people from running appliance/{make,update}.sh.in as root. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
On 24 Oct 2010, Richard W. M. Jones stated:
On Sat, Oct 23, 2010 at 11:23:41PM +0100, Nix wrote:
This seems... counterintuitive. Was that really the intent of this change?
The intent is to stop anyone running 'make all' as root. People used to see "permission error" from febootstrap and think that meant they had to run the build as root (which you must *not* do and is actively dangerous).
Plainly. "What do you mean my OS was partly overwritten by the appliance?"
What I don't understand is why 'make install' is running the all-local rule.
install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-am: all-am all-am: Makefile $(LTLIBRARIES) $(MANS) $(HEADERS) all-local *wham* This dependency is hardwired: see automake-1.11/lib/am/install.am, line 71 or thereabouts.
(And how did nobody notice it? I'm using Automake 1.11.1, but Automake has done this for a long, long time.)
I guess we never run 'make install' as root. I use libguestfs from the build directory, or build it in RPM (which does 'make install DESTDIR=...' as non-root). See the various */run*local scripts.
Exactly what I thought. I keep on meaning to rejig my autobuilder to do a fakeroot install, but it's sufficiently annoying to translate the permission state on these into *real* root installs (thanks to the inode number hell, and the different downsides of recording filenames in fakeroot.log instead) that I haven't done so yet.
Thanks for the report, do you have a suggested patch which just stops people doing make all/check as root?
I think your suggestion of checking at appliance make/update stage is better. After all, this is what actually does the damage. I'll whip something up for that soon.
participants (2)
-
Nix -
Richard W.M. Jones