[Pkg-libvirt-commits] [libguestfs] 03/26: random_seed: Don't try to create random seed if no parent directory.

Hilko Bengen bengen at moszumanska.debian.org
Sun Nov 1 17:11:25 UTC 2015


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag upstream/1.28.12
in repository libguestfs.

commit 62e8c81dac7553d2cc1e2f4da0e1d3e6149f6992
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Mon Apr 27 20:28:26 2015 +0100

    random_seed: Don't try to create random seed if no parent directory.
    
    Partial fix for https://bugzilla.redhat.com/show_bug.cgi?id=1215803
    
    (cherry picked from commit b70aec11c649b3c5ff22bc0f6a64e794ca3e7515)
---
 customize/random_seed.ml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/customize/random_seed.ml b/customize/random_seed.ml
index 8eedc1e..9c336f6 100644
--- a/customize/random_seed.ml
+++ b/customize/random_seed.ml
@@ -56,8 +56,13 @@ let rec set_random_seed (g : Guestfs.guestfs) root =
         None in
     match file with
     | Some file ->
-      make_random_seed_file g file;
-      created := true
+      let dir =
+        let i = String.rindex file '/' in
+        String.sub file 0 i in
+      if g#is_dir dir then (
+        make_random_seed_file g file;
+        created := true
+      )
     | None -> ()
   );
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list