[Spice-commits] Branch '0.8' - 4 commits - NEWS client/application.cpp client/cmd_line_parser.cpp client/cmd_line_parser.h client/controller.cpp configure.ac

Hans de Goede jwrdegoede at kemper.freedesktop.org
Wed Apr 20 04:37:19 PDT 2011


 NEWS                       |    9 +++++++++
 client/application.cpp     |   19 +++++++++++++++++--
 client/cmd_line_parser.cpp |    4 ++--
 client/cmd_line_parser.h   |    2 +-
 client/controller.cpp      |    2 +-
 configure.ac               |    2 +-
 6 files changed, 31 insertions(+), 7 deletions(-)

New commits:
commit 9a03fbcbe49fa9817529824999ce3c155c217289
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Wed Apr 20 10:51:32 2011 +0200

    Release 0.8.1

diff --git a/NEWS b/NEWS
index 4ff9345..e2cec29 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,12 @@
+Major changes in 0.8.1:
+=======================
+* client: Fix handling of --smartcard-db option
+* client: Add --version option
+* spicec-x11: Work around a bug in xsel
+* spicec-x11: Don't crash on apps sending bad atoms as TARGETS
+* server: Make copy paste support configurable
+* server: Various fixes to agent <-> client data handling
+
 Major changes in 0.8.0:
 =======================
 * client: exit nicely for --controller with no SPICE_XPI_SOCKET (rhbz#644292)
diff --git a/configure.ac b/configure.ac
index 810e92a..dffc975 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ AC_PREREQ([2.57])
 
 m4_define([SPICE_MAJOR], 0)
 m4_define([SPICE_MINOR], 8)
-m4_define([SPICE_MICRO], 0)
+m4_define([SPICE_MICRO], 1)
 
 AC_INIT(spice, [SPICE_MAJOR.SPICE_MINOR.SPICE_MICRO], [], spice)
 
commit e733aee0f2726e68736bf3d0dfb4545c6c786dd0
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Mon Apr 18 12:31:37 2011 +0200

    client: skip spaces in --host-subject
    
    This fixes fdo bug #32896:
    
    "Subject in certificates is stored in following format (values separated by
    comma and space):
    
    grep Subject: server-cert.pem | awk -F": " '{print $2}'
    O=REDHAT, CN=10.34.58.2
    
    While spicec expects that values in host subject are separated only by comma:
    
    spicec --host-subject "O=REDHAT,CN=10.34.58.2"
    "
    
    In this case, ignoring spaces make it much easier to directly copy and paste
    the subject line from certificates.

diff --git a/client/application.cpp b/client/application.cpp
index e7e2492..60c7dde 100644
--- a/client/application.cpp
+++ b/client/application.cpp
@@ -2001,7 +2001,14 @@ bool Application::set_host_cert_subject(const char* subject, const char* arg0)
                 _exit_code = SPICEC_ERROR_CODE_INVALID_ARG;
                 return false;
             }
-            entry_pair.first = entry.substr(0, value_pos);
+            size_t start_pos = entry.find_first_not_of(' ');
+            if ((start_pos == std::string::npos) || (start_pos == value_pos)) {
+                Platform::term_printf("%s: host_subject bad format: first part of assignment must be non empty in %s\n",
+                                      arg0, entry.c_str());
+                _exit_code = SPICEC_ERROR_CODE_INVALID_ARG;
+                return false;
+            }
+            entry_pair.first = entry.substr(start_pos, value_pos - start_pos);
             entry_pair.second = entry.substr(value_pos + 1);
             _host_auth_opt.host_subject.push_back(entry_pair);
             DBG(0, "subject entry: %s=%s", entry_pair.first.c_str(), entry_pair.second.c_str());
commit 1d61c0211e1c72c5d80c631f0543f2ad88ef4f3d
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Thu Apr 14 18:12:26 2011 +0200

    client: add --version cmdline option to spicec
    
    This fixes freedesktop bug #33907

diff --git a/client/application.cpp b/client/application.cpp
index a7c4e50..e7e2492 100644
--- a/client/application.cpp
+++ b/client/application.cpp
@@ -2183,7 +2183,8 @@ bool Application::process_cmd_line(int argc, char** argv, bool &full_screen)
     DisplaySetting display_setting;
 
     enum {
-        SPICE_OPT_HOST = CmdLineParser::OPTION_FIRST_AVAILABLE,
+        SPICE_OPT_VERSION = CmdLineParser::OPTION_FIRST_AVAILABLE,
+        SPICE_OPT_HOST,
         SPICE_OPT_PORT,
         SPICE_OPT_SPORT,
         SPICE_OPT_PASSWORD,
@@ -2224,6 +2225,7 @@ bool Application::process_cmd_line(int argc, char** argv, bool &full_screen)
 
     CmdLineParser parser("Spice client", false);
 
+    parser.add(SPICE_OPT_VERSION, "version", "spice client version", false);
     parser.add(SPICE_OPT_HOST, "host", "spice server address", "host", true, 'h');
     parser.add(SPICE_OPT_PORT, "port", "spice server port", "port", true, 'p');
     parser.add(SPICE_OPT_SPORT, "secure-port", "spice server secure port", "port", true, 's');
@@ -2286,6 +2288,12 @@ bool Application::process_cmd_line(int argc, char** argv, bool &full_screen)
     int op;
     while ((op = parser.get_option(&val)) != CmdLineParser::OPTION_DONE) {
         switch (op) {
+        case SPICE_OPT_VERSION: {
+            std::ostringstream os;
+            os << argv[0] << " "<< PACKAGE_VERSION << std::endl;
+            Platform::term_printf(os.str().c_str());
+            return false;
+        }
         case SPICE_OPT_HOST:
             host = val;
             break;
commit 4bcb62f9a1c1a855cbd709317fe222feb6730fb8
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Thu Apr 14 16:54:18 2011 +0200

    client: s/AVAILIBLE/AVAILABLE in CmdLineParser
    
    It was mispelt in a CmdLineParser enum.

diff --git a/client/application.cpp b/client/application.cpp
index 9bff1c5..a7c4e50 100644
--- a/client/application.cpp
+++ b/client/application.cpp
@@ -2183,7 +2183,7 @@ bool Application::process_cmd_line(int argc, char** argv, bool &full_screen)
     DisplaySetting display_setting;
 
     enum {
-        SPICE_OPT_HOST = CmdLineParser::OPTION_FIRST_AVILABLE,
+        SPICE_OPT_HOST = CmdLineParser::OPTION_FIRST_AVAILABLE,
         SPICE_OPT_PORT,
         SPICE_OPT_SPORT,
         SPICE_OPT_PASSWORD,
diff --git a/client/cmd_line_parser.cpp b/client/cmd_line_parser.cpp
index 7c396ba..f503c5c 100644
--- a/client/cmd_line_parser.cpp
+++ b/client/cmd_line_parser.cpp
@@ -112,7 +112,7 @@ void CmdLineParser::add_private(int id, const std::string& name, char short_name
 
 void CmdLineParser::add(int id, const std::string& name, const std::string& help, char short_name)
 {
-    if (id < OPTION_FIRST_AVILABLE) {
+    if (id < OPTION_FIRST_AVAILABLE) {
         THROW("invalid id");
     }
     add_private(id, name, short_name, NO_ARGUMENT, help, "");
@@ -121,7 +121,7 @@ void CmdLineParser::add(int id, const std::string& name, const std::string& help
 void CmdLineParser::add(int id, const std::string& name, const std::string& help,
                         const std::string& arg_name, bool reqired_arg, char short_name)
 {
-    if (id < OPTION_FIRST_AVILABLE) {
+    if (id < OPTION_FIRST_AVAILABLE) {
         THROW("invalid id");
     }
 
diff --git a/client/cmd_line_parser.h b/client/cmd_line_parser.h
index 0493df8..6e6c6d5 100644
--- a/client/cmd_line_parser.h
+++ b/client/cmd_line_parser.h
@@ -25,7 +25,7 @@ public:
         OPTION_ERROR = -1,
         OPTION_DONE = 0,
         OPTION_HELP = 256,
-        OPTION_FIRST_AVILABLE,
+        OPTION_FIRST_AVAILABLE,
     };
 
     CmdLineParser(std::string description, bool allow_positional_args);
diff --git a/client/controller.cpp b/client/controller.cpp
index c5722a1..42abe20 100644
--- a/client/controller.cpp
+++ b/client/controller.cpp
@@ -414,7 +414,7 @@ bool ControllerConnection::create_menu(char* resource)
 bool ControllerConnection::set_multi_val(uint32_t op, char* multi_val)
 {
     CmdLineParser parser("", false);
-    int id = CmdLineParser::OPTION_FIRST_AVILABLE;
+    int id = CmdLineParser::OPTION_FIRST_AVAILABLE;
     char* argv[] = {NULL, (char*)"--set", multi_val};
     char* val;
 


More information about the Spice-commits mailing list