[ovs-dev] [PATCH] ovs-ctl: Properly handle shell quoting inos-release.

Ben Pfaff blp at ovn.org
Mon Aug 15 00:38:08 UTC 2016


On Sun, Aug 14, 2016 at 06:57:54PM -0500, Ryan Moats wrote:
> "dev" <dev-bounces at openvswitch.org> wrote on 08/14/2016 02:39:56 PM:
> 
> > From: Ben Pfaff <blp at ovn.org>
> > To: dev at openvswitch.org
> > Cc: Matthew Mulsow/Austin/IBM at IBMUS, Ben Pfaff <blp at ovn.org>
> > Date: 08/14/2016 02:40 PM
> > Subject: [ovs-dev] [PATCH] ovs-ctl: Properly handle shell quoting in
> > os-release.
> > Sent by: "dev" <dev-bounces at openvswitch.org>
> >
> > Until now, this code did not strip "" or '' from variable assignments in
> > os-release.  This fixes the problem.
> >
> > CC: Matt Mulsow <mamulsow at us.ibm.com>
> > Fixes: c60d6b096436 ("ovs-ctl: support populating system info from /
> > etc/os-release")
> > Signed-off-by: Ben Pfaff <blp at ovn.org>
> > ---
> > I have not tested this.
> >
> >  utilities/ovs-ctl.in | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
> > index ff3eaf2..dc275f8 100755
> > --- a/utilities/ovs-ctl.in
> > +++ b/utilities/ovs-ctl.in
> > @@ -523,8 +523,8 @@ set_defaults () {
> >          SYSTEM_TYPE=`cat $type_file`
> >          SYSTEM_VERSION=`cat $version_file`
> >      elif test -e "@sysconfdir@/os-release"; then
> > -        SYSTEM_TYPE=`awk -F= '/^ID=/{print $2}' @sysconfdir@/os-release`
> > -        SYSTEM_VERSION=`awk -F= '/^VERSION_ID=/{print $2}'
> > @sysconfdir@/os-release`
> > +        SYSTEM_TYPE=`. '@sysconfdir@/os-release' && echo "$ID"`
> > +        SYSTEM_VERSION=`. '@sysconfdir@/os-release' && echo
> "$VERSION_ID"`
> >      elif (lsb_release --id) >/dev/null 2>&1; then
> >          SYSTEM_TYPE=`lsb_release --id -s`
> >          system_release=`lsb_release --release -s`
> > --
> > 2.1.3
> 
> I've not seen this problem in our tests, but I have seen in it our wild,
> so...
> 
> Acked-by: Ryan Moats <rmoats at us.ibm.com>

I should have included:

    Requested-by: Matt Mulsow <mamulsow at us.ibm.com>
    Requested-at: https://github.com/openvswitch/ovs/pull/148

Anyway, I added those and applied this, thanks for the review.



More information about the dev mailing list