Hello community,

here is the log from the commit of package libssh for openSUSE:Factory checked 
in at 2013-07-27 15:47:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libssh (Old)
 and      /work/SRC/openSUSE:Factory/.libssh.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libssh"

Changes:
--------
--- /work/SRC/openSUSE:Factory/libssh/libssh.changes    2013-03-08 
09:22:04.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.libssh.new/libssh.changes       2013-07-27 
15:47:30.000000000 +0200
@@ -1,0 +2,8 @@
+Thu Jul 25 19:56:12 UTC 2013 - [email protected]
+
+- Add fix-proxycomand-parsing1.diff: fix ProxyCommand parsing in 
+  libssh (upstream libssh bug 103)
+- Add fix-proxy-command-none.diff: fix ProxyCommand when it is
+  "none" (upstream libssh bug 103)
+
+-------------------------------------------------------------------

New:
----
  fix-proxy-command-none.diff
  fix-proxycomand-parsing1.diff

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libssh.spec ++++++
--- /var/tmp/diff_new_pack.X7T4KU/_old  2013-07-27 15:47:31.000000000 +0200
+++ /var/tmp/diff_new_pack.X7T4KU/_new  2013-07-27 15:47:31.000000000 +0200
@@ -31,6 +31,10 @@
 Group:          System/Libraries
 Source0:        %{name}-%{version}.tar.bz2
 Patch1:         remove-pedantic-errors.diff
+#PATCH-FIX-UPSTREAM: Parse ProxyCommand correctly (libssh bug 103)
+Patch2:         fix-proxycomand-parsing1.diff
+#PATCH-FIX-UPSTREAM: Parse ProxyCommand when it is "none" (libssh bug 103)
+Patch3:         fix-proxy-command-none.diff
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description
@@ -81,6 +85,8 @@
 %prep
 %setup -q
 %patch -P 1 -p1
+%patch2 -p1
+%patch3 -p1
 
 %build
 if test ! -e "build"; then

++++++ fix-proxy-command-none.diff ++++++
diff -rupN a/src/options.c b/src/options.c 
--- a/options.c 2013-01-22 11:38:30.000000000 +0100
+++ b/src/options.c     2013-07-15 09:45:28.000000000 +0200
@@ -655,11 +655,15 @@ int ssh_options_set(ssh_session session,
         return -1;
       } else {
         SAFE_FREE(session->ProxyCommand);
-        q = strdup(value);
-        if (q == NULL) {
-            return -1;
+               /* Setting the command to 'none' disables this option. */
+               rc = strcasecmp(value, "none");
+               if (rc != 0) {
+                       q = strdup(value);
+                       if (q == NULL) {
+                               return -1;
+                       }
+                       session->ProxyCommand = q;
         }
-        session->ProxyCommand = q;
       }
       break;
     default:
--- a/tests/unittests/torture_options.c.orig    2013-07-25 22:06:19.016024956 
+0200
+++ b/tests/unittests/torture_options.c 2013-07-25 22:11:28.941507282 +0200
@@ -119,6 +119,24 @@
     assert_string_equal(session->identity->root->next->data, "identity1");
 }
 
+static void torture_options_proxycommand(void **state) {
+    ssh_session session = *state;
+    int rc;
+
+    /* Enable ProxyCommand */
+    rc = ssh_options_set(session, SSH_OPTIONS_PROXYCOMMAND, "ssh -q -A -X -W 
%h:%p JUMPHOST");
+    assert_int_equal(rc, 0);
+
+    assert_string_equal(session->opts.ProxyCommand, "ssh -q -A -X -W %h:%p 
JUMPHOST");
+
+    /* Disable ProxyCommand */
+    rc = ssh_options_set(session, SSH_OPTIONS_PROXYCOMMAND, "none");
+    assert_int_equal(rc, 0);
+
+    assert_null(session->opts.ProxyCommand);
+}
+
+
 int torture_run_tests(void) {
     int rc;
     const UnitTest tests[] = {
++++++ fix-proxycomand-parsing1.diff ++++++
>From fcf8af20f81f196cff69a32d7a38a0e193e07d54 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <[email protected]>
Date: Sun, 02 Jun 2013 17:06:33 +0000
Subject: BUG 103: Fix ProxyCommand parsing.

---
diff --git a/src/config.c b/src/config.c
index cb98a60..632a50b 100644
--- a/src/config.c
+++ b/src/config.c
@@ -82,7 +82,7 @@ static enum ssh_config_opcode_e ssh_config_get_opcode(char 
*keyword) {
   return SOC_UNSUPPORTED;
 }
 
-static char *ssh_config_get_token(char **str) {
+static char *ssh_config_get_cmd(char **str) {
   register char *c;
   char *r;
 
@@ -103,6 +103,25 @@ static char *ssh_config_get_token(char **str) {
   }
 
   for (r = c; *c; c++) {
+    if (*c == '\n') {
+      *c = '\0';
+      goto out;
+    }
+  }
+
+out:
+  *str = c + 1;
+
+  return r;
+}
+
+static char *ssh_config_get_token(char **str) {
+  register char *c;
+  char *r;
+
+  c = ssh_config_get_cmd(str);
+
+  for (r = c; *c; c++) {
     if (isblank(*c)) {
       *c = '\0';
       goto out;
@@ -299,7 +318,7 @@ static int ssh_config_parse_line(ssh_session session, const 
char *line,
       }
       break;
     case SOC_PROXYCOMMAND:
-      p = ssh_config_get_str(&s, NULL);
+      p = ssh_config_get_cmd(&s);
       if (p && *parsing) {
         ssh_options_set(session, SSH_OPTIONS_PROXYCOMMAND, p);
       }
--
cgit v0.9.1
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to