psss / rpms / libguestfs

Forked from rpms/libguestfs 5 years ago
Clone
Blob Blame History Raw
From 2b882052e062226196fe6889c8ac7f4d3a7c9b89 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 7 Nov 2013 15:30:13 +0000
Subject: [PATCH] builder: Allow /tmp or /Temp to be symlinks to a directory.

(cherry picked from commit 63ec023f19f2b397dfa629a8674bb9fbed752c71)
---
 builder/builder.ml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/builder/builder.ml b/builder/builder.ml
index 4049011..84aa869 100644
--- a/builder/builder.ml
+++ b/builder/builder.ml
@@ -489,9 +489,11 @@ let main () =
   let logfile =
     match g#inspect_get_type root with
     | "windows" | "dos" ->
-      if g#is_dir "/Temp" then "/Temp/builder.log" else "/builder.log"
+      if g#is_dir ~followsymlinks:true "/Temp" then "/Temp/builder.log"
+      else "/builder.log"
     | _ ->
-      if g#is_dir "/tmp" then "/tmp/builder.log" else "/builder.log" in
+      if g#is_dir ~followsymlinks:true "/tmp" then "/tmp/builder.log"
+      else "/builder.log" in
 
   (* Function to cat the log file, for debugging and error messages. *)
   let debug_logfile () =
-- 
1.8.3.1