[Libguestfs] [PATCH] appliance: Make sure /tmp and /var/tmp are real directories.

Richard W.M. Jones rjones at redhat.com
Wed Jun 3 17:57:38 UTC 2015


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




More information about the Libguestfs mailing list