Re: [Libguestfs] [PATCH] mllib: hostname: replace the hostname on Debian also in /etc/hosts (RHBZ#953907).

2014-02-13 Thread Pino Toscano
On Thursday 13 February 2014 13:33:16 Richard W.M. Jones wrote: > On Thu, Feb 13, 2014 at 02:15:31PM +0100, Pino Toscano wrote: > > +let expr = "/files/etc/hosts/*[label() != '#comment']/*[label() > > != 'ipaddr'][. = '" ^ oldhost ^ "']" in > Quoting? If oldhost contains a ' character + some A

Re: [Libguestfs] [PATCH] mllib: hostname: replace the hostname on Debian also in /etc/hosts (RHBZ#953907).

2014-02-13 Thread Richard W.M. Jones
On Thu, Feb 13, 2014 at 02:15:31PM +0100, Pino Toscano wrote: > +let expr = "/files/etc/hosts/*[label() != '#comment']/*[label() != > 'ipaddr'][. = '" ^ oldhost ^ "']" in Quoting? If oldhost contains a ' character + some Augeas code, this might be exploitable. I thought it might be possible

[Libguestfs] [PATCH] mllib: hostname: replace the hostname on Debian also in /etc/hosts (RHBZ#953907).

2014-02-13 Thread Pino Toscano
In Debian/Ubuntu systems, read the previous hostname from /etc/hostname before replacing it, and replace it in /etc/hosts with the new hostname. --- mllib/hostname.ml | 27 +++ 1 file changed, 27 insertions(+) diff --git a/mllib/hostname.ml b/mllib/hostname.ml index fce16f