Pino Toscano
2015-Jul-24 13:26 UTC
[Libguestfs] [PATCH] customize: random_seed: add CirrOS location
CirrOS has its random-seed file in /etc. --- customize/random_seed.ml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/customize/random_seed.ml b/customize/random_seed.ml index 34a7af7..5a15ad9 100644 --- a/customize/random_seed.ml +++ b/customize/random_seed.ml @@ -30,6 +30,7 @@ let rec set_random_seed (g : Guestfs.guestfs) root "/var/lib/systemd/random-seed"; (* Fedora after F20? *) "/var/lib/urandom/random-seed"; (* Debian *) "/var/lib/misc/random-seed"; (* SuSE *) + "/etc/random-seed"; (* CirrOS *) ] in List.iter ( fun file -> @@ -52,6 +53,8 @@ let rec set_random_seed (g : Guestfs.guestfs) root Some "/var/lib/urandom/random-seed" | "linux", ("opensuse"|"sles"|"suse-based") -> Some "/var/lib/misc/random-seed" + | "linux", "cirros" -> + Some "/etc/random-seed" | _ -> None in match file with -- 2.1.0
Pino Toscano
2015-Jul-24 13:26 UTC
[Libguestfs] [PATCH] customize: password: improve unknown default crypto message
When warning that there is no known default password encryption for the current guest, print its version in MAJOR.MINOR format if MAJOR is zero. Also, fix wrapping (and indentation) of the message. --- customize/password.ml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/customize/password.ml b/customize/password.ml index 111240e..7a050d6 100644 --- a/customize/password.ml +++ b/customize/password.ml @@ -163,6 +163,13 @@ and default_crypto g root | "ubuntu", _ -> `MD5 | _, _ -> - warning (f_"password: using insecure md5 password encryption for -guest of type %s version %d.\nIf this is incorrect, use --password-crypto option and file a bug.") distro major; + let verstr + let minor = g#inspect_get_minor_version root in + match major, minor with + | x, _ when x > 0 -> string_of_int x + | 0, 0 -> "0" + | x, y -> "0." ^ string_of_int y in + warning (f_"password: using insecure md5 password encryption for guest of type %s version %s. +If this is incorrect, use --password-crypto option and file a bug.") + distro verstr; `MD5 -- 2.1.0
Richard W.M. Jones
2015-Jul-24 14:00 UTC
Re: [Libguestfs] [PATCH] customize: random_seed: add CirrOS location
On Fri, Jul 24, 2015 at 03:26:44PM +0200, Pino Toscano wrote:> CirrOS has its random-seed file in /etc. > --- > customize/random_seed.ml | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/customize/random_seed.ml b/customize/random_seed.ml > index 34a7af7..5a15ad9 100644 > --- a/customize/random_seed.ml > +++ b/customize/random_seed.ml > @@ -30,6 +30,7 @@ let rec set_random_seed (g : Guestfs.guestfs) root > "/var/lib/systemd/random-seed"; (* Fedora after F20? *) > "/var/lib/urandom/random-seed"; (* Debian *) > "/var/lib/misc/random-seed"; (* SuSE *) > + "/etc/random-seed"; (* CirrOS *) > ] in > List.iter ( > fun file -> > @@ -52,6 +53,8 @@ let rec set_random_seed (g : Guestfs.guestfs) root > Some "/var/lib/urandom/random-seed" > | "linux", ("opensuse"|"sles"|"suse-based") -> > Some "/var/lib/misc/random-seed" > + | "linux", "cirros" -> > + Some "/etc/random-seed" > | _ -> > None in > match file withACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Richard W.M. Jones
2015-Jul-24 14:02 UTC
Re: [Libguestfs] [PATCH] customize: password: improve unknown default crypto message
On Fri, Jul 24, 2015 at 03:26:45PM +0200, Pino Toscano wrote:> When warning that there is no known default password encryption for the > current guest, print its version in MAJOR.MINOR format if MAJOR is zero. > > Also, fix wrapping (and indentation) of the message. > --- > customize/password.ml | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/customize/password.ml b/customize/password.ml > index 111240e..7a050d6 100644 > --- a/customize/password.ml > +++ b/customize/password.ml > @@ -163,6 +163,13 @@ and default_crypto g root > | "ubuntu", _ -> `MD5 > > | _, _ -> > - warning (f_"password: using insecure md5 password encryption for > -guest of type %s version %d.\nIf this is incorrect, use --password-crypto option and file a bug.") distro major; > + let verstr > + let minor = g#inspect_get_minor_version root in > + match major, minor with > + | x, _ when x > 0 -> string_of_int x > + | 0, 0 -> "0" > + | x, y -> "0." ^ string_of_int y in > + warning (f_"password: using insecure md5 password encryption for guest of type %s version %s. > +If this is incorrect, use --password-crypto option and file a bug.") > + distro verstr; > `MD5Since this is basically a debugging message for us, wouldn't it be better to report the major and minor numbers directly, ie just print %d.%d instead of verstr? -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
Possibly Parallel Threads
- [PATCH] customize: random_seed: avoid one file checking for existing files
- Re: [PATCH] customize: password: improve unknown default crypto message
- Re: [PATCH] customize: random_seed: avoid one file checking for existing files
- [PATCH] inspect: recognize the Kali Linux distribution (RHBZ#1544227)
- [PATCH] customize, sysprep, v2v: handle Kali Linux as Debian