Hello community,

here is the log from the commit of package kdump for openSUSE:Factory checked 
in at 2013-12-08 19:27:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kdump (Old)
 and      /work/SRC/openSUSE:Factory/.kdump.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kdump"

Changes:
--------
--- /work/SRC/openSUSE:Factory/kdump/kdump.changes      2013-09-13 
14:46:38.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.kdump.new/kdump.changes 2013-12-08 
19:27:18.000000000 +0100
@@ -1,0 +2,7 @@
+Fri Dec  6 17:25:46 UTC 2013 - ptesa...@suse.cz
+
+- Update to 0.8.6
+  o IPv6 support (FATE 316563) 
+  o unmount filesystems before rebooting kdump environment
+
+-------------------------------------------------------------------

Old:
----
  kdump-0.8.5-rpmlintrc
  kdump-0.8.5.tar.bz2

New:
----
  kdump-0.8.6-rpmlintrc
  kdump-0.8.6.tar.bz2

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

Other differences:
------------------
++++++ kdump.spec ++++++
--- /var/tmp/diff_new_pack.RCWtxT/_old  2013-12-08 19:27:19.000000000 +0100
+++ /var/tmp/diff_new_pack.RCWtxT/_new  2013-12-08 19:27:19.000000000 +0100
@@ -19,7 +19,7 @@
 Url:            http://freehg.org/u/bwalle/kdump/
 
 Name:           kdump
-Version:        0.8.5
+Version:        0.8.6
 Release:        0
 Requires:       curl
 Requires:       makedumpfile

++++++ kdump-0.8.5-rpmlintrc -> kdump-0.8.6-rpmlintrc ++++++

++++++ kdump-0.8.5.tar.bz2 -> kdump-0.8.6.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdump-0.8.5/.hg_archival.txt 
new/kdump-0.8.6/.hg_archival.txt
--- old/kdump-0.8.5/.hg_archival.txt    2013-09-13 12:19:10.000000000 +0200
+++ new/kdump-0.8.6/.hg_archival.txt    2013-12-06 18:24:17.000000000 +0100
@@ -1,5 +1,5 @@
 repo: bc186d1ee81e4dfdc5721d6a5743a6ed8b3cc457
-node: ecda86e4831541c15802920b6626f0bb3ab32dca
+node: be65702c890d4ae0f2fc35443c8aff70da0e2714
 branch: default
-latesttag: v0.8.4
-latesttagdistance: 42
+latesttag: v0.8.6
+latesttagdistance: 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdump-0.8.5/.hgtags new/kdump-0.8.6/.hgtags
--- old/kdump-0.8.5/.hgtags     2013-09-13 12:19:10.000000000 +0200
+++ new/kdump-0.8.6/.hgtags     2013-12-06 18:24:17.000000000 +0100
@@ -20,3 +20,5 @@
 d441f2ef4f58d9c85bbb3a79a1994bda61f369a5 v0.8.2
 136fd1ff12ab582149ff06a8d983b414fa3d770c v0.8.3
 a87bf22c9242118de2f7bbf9588923026e40df98 v0.8.4
+ecda86e4831541c15802920b6626f0bb3ab32dca v0.8.5
+1c7dcec40d533dc7642ee39a96030711cac8d8cc v0.8.6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdump-0.8.5/CMakeLists.txt 
new/kdump-0.8.6/CMakeLists.txt
--- old/kdump-0.8.5/CMakeLists.txt      2013-09-13 12:19:10.000000000 +0200
+++ new/kdump-0.8.6/CMakeLists.txt      2013-12-06 18:24:17.000000000 +0100
@@ -26,7 +26,7 @@
 
 cmake_minimum_required(VERSION 2.6.2)
 set (PACKAGE_STRING "kdump")
-set (PACKAGE_VERSION "0.8.5")
+set (PACKAGE_VERSION "0.8.6")
 
 include_directories("${PROJECT_BINARY_DIR}")
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdump-0.8.5/NEWS new/kdump-0.8.6/NEWS
--- old/kdump-0.8.5/NEWS        2013-09-13 12:19:10.000000000 +0200
+++ new/kdump-0.8.6/NEWS        2013-12-06 18:24:17.000000000 +0100
@@ -1,3 +1,8 @@
+0.8.6
+-----
+  * Support for IPv6 targets
+  * Unmount all filesystems before rebooting in the kdump environment
+
 0.8.5
 -----
   * Always use /proc/mounts instead of /etc/mtab.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdump-0.8.5/init/boot-kdump.sh 
new/kdump-0.8.6/init/boot-kdump.sh
--- old/kdump-0.8.5/init/boot-kdump.sh  2013-09-13 12:19:10.000000000 +0200
+++ new/kdump-0.8.6/init/boot-kdump.sh  2013-12-06 18:24:17.000000000 +0100
@@ -49,6 +49,7 @@
         test -f $FADUMP_RELEASE_MEM && echo 1 > $FADUMP_RELEASE_MEM
     elif [ $KDUMP_IMMEDIATE_REBOOT = "yes" \
             -o "$KDUMP_IMMEDIATE_REBOOT" = "YES" ] ; then
+        umount -a
         reboot -f
     else
         echo
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdump-0.8.5/init/mkdumprd 
new/kdump-0.8.6/init/mkdumprd
--- old/kdump-0.8.5/init/mkdumprd       2013-09-13 12:19:10.000000000 +0200
+++ new/kdump-0.8.6/init/mkdumprd       2013-12-06 18:24:17.000000000 +0100
@@ -126,7 +126,7 @@
 # check if we need to regenerate it?
 if (( ! $FORCE )) ; then
     if [ -f "$INITRD" ] && \
-            [ "$CONFIG" -ot "$INITRD" ] && \
+            [ "$KDUMP_CONFIG" -ot "$INITRD" ] && \
             [ /root/.ssh/id_dsa.pub -ot "$INITRD" ] && \
             [ /root/.ssh/id_dsa -ot "$INITRD" ] && \
             [ "$KERNEL" -ot "$INITRD" ] ; then
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdump-0.8.5/init/setup-kdump.sh 
new/kdump-0.8.6/init/setup-kdump.sh
--- old/kdump-0.8.5/init/setup-kdump.sh 2013-09-13 12:19:10.000000000 +0200
+++ new/kdump-0.8.6/init/setup-kdump.sh 2013-12-06 18:24:17.000000000 +0100
@@ -75,21 +75,33 @@
 source "$CONFIG"
 
 #
-# replace the KDUMP_SAVEDIR with the resolved path
-if [ "$kdump_protocol" = "file" ] ; then
-    KDUMP_SAVEDIR="file://$kdump_path"
-fi
+# Special handling for some protocols
+KDUMP_SAVEDIR=
+kdump_over_ssh=
+local i=0
+while [ $i -le $kdump_max ] ; do
+    protocol="${kdump_Protocol[i]}"
+
+    # replace original path with resolved path
+    test -z "$KDUMP_SAVEDIR" || KDUMP_SAVEDIR="$KDUMP_SAVEDIR "
+    if [ "$protocol" = "file" ] ; then
+        KDUMP_SAVEDIR="${KDUMP_SAVEDIR}file://${kdump_Realpath[i]}"
+    else
+        KDUMP_SAVEDIR="${KDUMP_SAVEDIR}${kdump_URL[i]}"
+    fi
 
-#
-# get the host key, if needed
-if [ "$kdump_protocol" = "sftp" -a -z "$KDUMP_HOST_KEY" ] ; then
-    KDUMP_HOST_KEY=$(ssh-keygen -F "$kdump_host" 2>/dev/null | \
-                     awk '/^[^#]/ { if (NF==3) { print $3; exit } }')
-    if [ -z "$KDUMP_HOST_KEY" ] ; then
-        echo "WARNING: target SSH host key not found. " \
-             "Man-in-the-middle attack is possible." >&2
+    #
+    # get the host key, if needed
+    if [ "$protocol" = "sftp" ] ; then
+        kdump_over_ssh=yes
+        if [ -z "$KDUMP_HOST_KEY" ] ; then
+            KDUMP_HOST_KEY=$(ssh-keygen -F "$kdump_Host" 2>/dev/null | \
+                             awk '/^[^#]/ { if (NF==3) { print $3; exit } }')
+        fi
     fi
-fi
+
+    i=$((i+1))
+done
 
 #
 # copy the configuration file, modifying:
@@ -120,7 +132,11 @@
 #
 # copy public and private key if needed
 #
-if [ "$kdump_protocol" = "sftp" ] ; then
+if [ -n "$kdump_over_ssh" ] ; then
+    if [ -z "$KDUMP_HOST_KEY" ] ; then
+        echo "WARNING: target SSH host key not found. " \
+             "Man-in-the-middle attack is possible." >&2
+    fi
     if [ -f /root/.ssh/id_dsa ] && [ -f /root/.ssh/id_dsa.pub ] ; then
         mkdir -p ${tmp_mnt}/.ssh
         cp /root/.ssh/id_dsa ${tmp_mnt}/.ssh
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdump-0.8.5/init/setup-kdumpfs.sh 
new/kdump-0.8.6/init/setup-kdumpfs.sh
--- old/kdump-0.8.5/init/setup-kdumpfs.sh       2013-09-13 12:19:10.000000000 
+0200
+++ new/kdump-0.8.6/init/setup-kdumpfs.sh       2013-12-06 18:24:17.000000000 
+0100
@@ -282,7 +282,6 @@
 #
 kdump_max=0
 eval "$( kdumptool print_target | \
-    egrep '^(Protocol:|Realpath:|$)' | \
     sed -e "s/'/'\\\\''/g" \
        -e 's/^$/max=$((kdump_max+1))'\''/' \
        -e 's/^/kdump_/' \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdump-0.8.5/kdumptool/socket.cc 
new/kdump-0.8.6/kdumptool/socket.cc
--- old/kdump-0.8.5/kdumptool/socket.cc 2013-09-13 12:19:10.000000000 +0200
+++ new/kdump-0.8.6/kdumptool/socket.cc 2013-12-06 18:24:17.000000000 +0100
@@ -24,6 +24,7 @@
 #include <unistd.h>
 #include <cerrno>
 #include <cstring>
+#include <sstream>
 
 #include "global.h"
 #include "socket.h"
@@ -33,11 +34,21 @@
 
 //{{{ Socket 
-------------------------------------------------------------------
 
-Socket::Socket(const char *address, int port, Socket::Type type)
+Socket::Socket(const char *address, int port,
+              Socket::SocketType socketType, Socket::Family family)
     throw ()
-    : m_currentFd(-1), m_hostname(address), m_port(port), 
m_connectionType(type)
+    : m_currentFd(-1), m_port(port),
+      m_socketType(socketType), m_family(family)
 {
-    Debug::debug()->trace("Socket(%s, %d, %d)", address, port, type);
+    Debug::debug()->trace("Socket(%s, %d, %d, %d)",
+                         address, port, socketType, family);
+
+    // Handle literal IPv6 addresses enclosed in brackets
+    size_t addrlen = strlen(address);
+    if (addrlen >= 2 && address[0] == '[' && address[addrlen-1] == ']')
+       m_hostname.assign(address + 1, addrlen - 2);
+    else
+       m_hostname.assign(address);
 }
 
 // 
-----------------------------------------------------------------------------
@@ -49,49 +60,77 @@
 }
 
 // 
-----------------------------------------------------------------------------
+static int systemFamily(enum Socket::Family family)
+{
+    switch (family) {
+    case Socket::SF_IPv4:
+        return AF_INET;
+
+    case Socket::SF_IPv6:
+        return AF_INET6;
+
+    case Socket::SF_ANY:
+    default:
+        return AF_UNSPEC;
+    }
+}
+
+// 
-----------------------------------------------------------------------------
+static int systemSocketType(enum Socket::SocketType socketType)
+{
+    switch (socketType) {
+    case Socket::ST_UDP:
+        return SOCK_DGRAM;
+
+    case Socket::ST_TCP:
+    default:
+        return SOCK_STREAM;
+    }
+}
+
+// 
-----------------------------------------------------------------------------
 int Socket::connect()
     throw (KError)
 {
-    struct in_addr inaddr;
-    struct sockaddr_in addr;
-    struct hostent *machine;
+    struct addrinfo hints, *res, *aip;
+    int n;
 
     Debug::debug()->trace("Socket::connect()");
 
-    int ret = inet_aton(m_hostname.c_str(), &inaddr);
-    if (ret) {
-        Debug::debug()->trace("Socket::connect(): Using numerical IP address");
-       memcpy(&addr.sin_addr, &inaddr, sizeof(addr.sin_addr));
-    } else {
-        Debug::debug()->trace("Socket::connect(): Using gethostbyname()");
-        machine = gethostbyname(m_hostname.c_str());
-        if (!machine)
-            throw KNetError("gethostbyname() failed for "+ m_hostname +".",
-                h_errno);
-       memcpy(&addr.sin_addr, machine->h_addr_list[0], sizeof(addr.sin_addr));
-    }
+    memset(&hints, 0, sizeof(struct addrinfo));
+    hints.ai_family = systemFamily(m_family);
+    hints.ai_socktype = systemSocketType(m_socketType);
+
+    std::ostringstream service;
+    service << m_port;
+    n = getaddrinfo(m_hostname.c_str(), service.str().c_str(), &hints, &res);
+    if (n < 0)
+        throw KError("getaddrinfo() failed for " + m_hostname + ".");
+
+    for (aip = res; aip; aip = aip->ai_next) {
+        Debug::debug()->trace("Socket::connect(): socket(%d, %d, %d)",
+                              aip->ai_family, aip->ai_socktype,
+                              aip->ai_protocol);
+
+        m_currentFd = socket(aip->ai_family, aip->ai_socktype,
+                             aip->ai_protocol);
+        if (m_currentFd < 0) {
+            Debug::debug()->dbg("socket() failed.");
+            continue;
+        }
 
-    addr.sin_family = AF_INET;
-    addr.sin_port = htons(m_port);
+        if (::connect(m_currentFd, res->ai_addr, res->ai_addrlen) == 0)
+            break;
 
-    // UDP or TCP ?
-    int type = m_connectionType == Socket::ST_TCP
-        ? SOCK_STREAM
-        : SOCK_DGRAM;
-
-    Debug::debug()->trace("Socket::connect(): socket(%d, %d, 0)",
-        PF_INET, type);
-
-    m_currentFd = socket(PF_INET, type, 0);
-    if (m_currentFd < 0)
-        KSystemError("socket() failed for " + m_hostname + ".", errno);
-
-    int err = ::connect(m_currentFd, (struct sockaddr *)&addr, sizeof(addr));
-    if (err != 0) {
+        Debug::debug()->dbg("connect() failed.");
         close();
-        throw KSystemError("connect() failed for " + m_hostname + ".", errno);
     }
 
+    freeaddrinfo(res);
+
+    if (!aip)
+        throw KError("connect() failed for " + m_hostname + ".");
+
     return m_currentFd;
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdump-0.8.5/kdumptool/socket.h 
new/kdump-0.8.6/kdumptool/socket.h
--- old/kdump-0.8.5/kdumptool/socket.h  2013-09-13 12:19:10.000000000 +0200
+++ new/kdump-0.8.6/kdumptool/socket.h  2013-12-06 18:24:17.000000000 +0100
@@ -29,18 +29,27 @@
 //{{{ Socket 
-------------------------------------------------------------------
 
 /**
- * Represents a socket (IPv4).
+ * Represents a socket (IPv4 or IPv6).
  */
 class Socket {
 
     public:
         /**
-         * The type of the socket. Currently, IPv4/TCP and IPv4/UDP are
-         * supported.
+         * The type of the socket. Currently, all combinations of
+         * TCP and UDP over IPv4 or IPv6 are supported.
          */
-        enum Type {
-            ST_TCP,     /**< IPv4 and TCP */
-            ST_UCP      /**< IPv4 and UDP */
+        enum SocketType {
+            ST_TCP,             /**< TCP connections */
+            ST_UDP,             /**< UDP connections */
+        };
+
+        /**
+         * The protocol family.
+         */
+        enum Family {
+            SF_ANY,             /**< Any protocol */
+            SF_IPv4,            /**< IPv4 only */
+            SF_IPv6,            /**< IPv6 only */
         };
 
         /**
@@ -59,7 +68,8 @@
          * @param[in] port the port to connect
          * @param[in] type the socket type
          */
-        Socket(const char *address, int port, Type type)
+        Socket(const char *address, int port,
+               SocketType socketType, Family family = SF_ANY)
         throw ();
 
         /**
@@ -97,7 +107,8 @@
         int m_currentFd;
         std::string m_hostname;
         int m_port;
-        Type m_connectionType;
+        SocketType m_socketType;
+        Family m_family;
 };
 
 //}}}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdump-0.8.5/kdumptool/urlparser.cc 
new/kdump-0.8.6/kdumptool/urlparser.cc
--- old/kdump-0.8.5/kdumptool/urlparser.cc      2013-09-13 12:19:10.000000000 
+0200
+++ new/kdump-0.8.6/kdumptool/urlparser.cc      2013-12-06 18:24:17.000000000 
+0100
@@ -180,8 +180,15 @@
             m_username = userpass;
     }
 
-    // and separate host and port
+    // look for a literal IPv6 addresses
     string::size_type last_colon = hostport.rfind(':');
+    if (hostport[0] == '[') {
+        string::size_type bracket = hostport.find(']');
+        if (bracket != string::npos && bracket > last_colon)
+            last_colon = string::npos;
+    }
+
+    // and separate host and port
     if (last_colon != string::npos) {
         m_hostname = hostport.substr(0, last_colon);
         string portstr = hostport.substr(last_colon+1);
@@ -205,6 +212,11 @@
     m_hostname = partUrl.substr(0, first_slash);
 
     string::size_type last_colon = m_hostname.rfind(':');
+    if (m_hostname[0] == '[') {
+        string::size_type bracket = m_hostname.find(']');
+        if (bracket != string::npos && bracket > last_colon)
+            last_colon = string::npos;
+    }
     if (last_colon != string::npos) {
         string hostport = m_hostname;
         m_hostname = hostport.substr(0, last_colon);

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to