[Pkg-libvirt-commits] [libguestfs] 02/26: firstboot: Don't create very long filenames for --firstboot-command (RHBZ#1212152).

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 1e2d26ea249418cc30efb0b8e02eb3c9cfbe90d9
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Mon Apr 27 15:05:15 2015 +0100

    firstboot: Don't create very long filenames for --firstboot-command (RHBZ#1212152).
    
    (cherry picked from commit 2841400721a577dffc8940fd7ef17a536f4fb0f6)
---
 customize/firstboot.ml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/customize/firstboot.ml b/customize/firstboot.ml
index 2fe2dfc..5a1574d 100644
--- a/customize/firstboot.ml
+++ b/customize/firstboot.ml
@@ -30,7 +30,9 @@ let unix2dos s =
 let sanitize_name =
   let rex = Str.regexp "[^A-Za-z0-9_]" in
   fun n ->
-    Str.global_replace rex "-" n
+    let n = Str.global_replace rex "-" n in
+    let len = String.length n and max = 60 in
+    if len >= max then String.sub n 0 max else n
 
 (* For Linux guests. *)
 module Linux = struct

-- 
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