Blame 0201-spice-abort-on-invalid-streaming-cmdline-params.patch

c8dfc6
From 46851363e2aed89fc535803c8a23f6bed9934312 Mon Sep 17 00:00:00 2001
c8dfc6
From: Christophe Fergeau <cfergeau@redhat.com>
c8dfc6
Date: Mon, 13 Aug 2012 10:32:32 +0200
c8dfc6
Subject: [PATCH 201/215] spice: abort on invalid streaming cmdline params
c8dfc6
c8dfc6
When parsing its command line parameters, spice aborts when it
c8dfc6
finds unexpected values, except for the 'streaming-video' option.
c8dfc6
This happens because the parsing of the parameters for this option
c8dfc6
is done using the 'name2enum' helper, which does not error out
c8dfc6
on unknown values. Using the 'parse_name' helper makes sure we
c8dfc6
error out in this case. Looking at git history, the use of
c8dfc6
'name2enum' instead of 'parse_name' seems to have been an oversight,
c8dfc6
so let's change to that now.
c8dfc6
c8dfc6
Fixes rhbz#831708
c8dfc6
c8dfc6
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
c8dfc6
---
c8dfc6
 ui/spice-core.c | 3 ++-
c8dfc6
 1 file changed, 2 insertions(+), 1 deletion(-)
c8dfc6
c8dfc6
diff --git a/ui/spice-core.c b/ui/spice-core.c
c8dfc6
index 4fc48f8..bb4f585 100644
c8dfc6
--- a/ui/spice-core.c
c8dfc6
+++ b/ui/spice-core.c
c8dfc6
@@ -344,7 +344,8 @@ static const char *stream_video_names[] = {
c8dfc6
     [ SPICE_STREAM_VIDEO_FILTER ] = "filter",
c8dfc6
 };
c8dfc6
 #define parse_stream_video(_name) \
c8dfc6
-    name2enum(_name, stream_video_names, ARRAY_SIZE(stream_video_names))
c8dfc6
+    parse_name(_name, "stream video control", \
c8dfc6
+               stream_video_names, ARRAY_SIZE(stream_video_names))
c8dfc6
 
c8dfc6
 static const char *compression_names[] = {
c8dfc6
     [ SPICE_IMAGE_COMPRESS_OFF ]      = "off",
c8dfc6
-- 
c8dfc6
1.7.12
c8dfc6