Richard W.M. Jones
2015-Jun-03 17:57 UTC
[Libguestfs] [PATCH] appliance: Make sure /tmp and /var/tmp are real directories.
Currently if /tmp (on the host) is a symlink, then the symlink is copied into the appliance, probably pointing to a non-existent directory, and everything goes downhill from there. Avoid this by making sure that /tmp and /var/tmp are real directories. --- appliance/init | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/appliance/init b/appliance/init index 3c5ef1b..3973f18 100755 --- a/appliance/init +++ b/appliance/init @@ -10,6 +10,11 @@ RUNLEVEL=S PREVLEVEL=N export RUNLEVEL PREVLEVEL +# Make sure /tmp /var/tmp are real directories, not symlinks. +rm -f /tmp /var/tmp +mkdir /tmp /var/tmp +chmod 1777 /tmp /var/tmp + # Make sure to find all the libraries, also those in non-standard place # but with a proper ld.so configuration pointing at them ldconfig -- 2.3.1
Pino Toscano
2015-Jun-05 14:40 UTC
Re: [Libguestfs] [PATCH] appliance: Make sure /tmp and /var/tmp are real directories.
In data mercoledì 3 giugno 2015 18:57:38, Richard W.M. Jones ha scritto:> Currently if /tmp (on the host) is a symlink, then the symlink is > copied into the appliance, probably pointing to a non-existent > directory, and everything goes downhill from there. > > Avoid this by making sure that /tmp and /var/tmp are real directories. > --- > appliance/init | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/appliance/init b/appliance/init > index 3c5ef1b..3973f18 100755 > --- a/appliance/init > +++ b/appliance/init > @@ -10,6 +10,11 @@ RUNLEVEL=S > PREVLEVEL=N > export RUNLEVEL PREVLEVEL > > +# Make sure /tmp /var/tmp are real directories, not symlinks. > +rm -f /tmp /var/tmp > +mkdir /tmp /var/tmp > +chmod 1777 /tmp /var/tmpMaybe just do that if they are not existing already? if [ ! -d /tmp ]; then ... -- Pino Toscano
Richard W.M. Jones
2015-Jun-06 13:03 UTC
Re: [Libguestfs] [PATCH] appliance: Make sure /tmp and /var/tmp are real directories.
On Fri, Jun 05, 2015 at 04:40:26PM +0200, Pino Toscano wrote:> In data mercoledì 3 giugno 2015 18:57:38, Richard W.M. Jones ha scritto: > > Currently if /tmp (on the host) is a symlink, then the symlink is > > copied into the appliance, probably pointing to a non-existent > > directory, and everything goes downhill from there. > > > > Avoid this by making sure that /tmp and /var/tmp are real directories. > > --- > > appliance/init | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/appliance/init b/appliance/init > > index 3c5ef1b..3973f18 100755 > > --- a/appliance/init > > +++ b/appliance/init > > @@ -10,6 +10,11 @@ RUNLEVEL=S > > PREVLEVEL=N > > export RUNLEVEL PREVLEVEL > > > > +# Make sure /tmp /var/tmp are real directories, not symlinks. > > +rm -f /tmp /var/tmp > > +mkdir /tmp /var/tmp > > +chmod 1777 /tmp /var/tmp > > Maybe just do that if they are not existing already? > > if [ ! -d /tmp ]; then ...Yup, that's likely to be better. I'll push a modified patch. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
Maybe Matching Threads
- [PATCH] appliance: Make sure /tmp and /var/tmp are real directories.
- [PATCH] appliance: init: run ldconfig
- Re: [PATCH v2 1/5] uuid: add support to change uuid of btrfs partition
- Re: [PATCH v2 1/5] uuid: add support to change uuid of btrfs partition
- xinetd custom service - perl - remote address