[Libguestfs] [PATCH] appliance: Make sure /tmp and /var/tmp are real directories.
Pino Toscano
ptoscano at redhat.com
Fri Jun 5 14:40:26 UTC 2015
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 ...
--
Pino Toscano
More information about the Libguestfs
mailing list