Hello community,

here is the log from the commit of package yast2-drbd for openSUSE:Factory 
checked in at 2016-05-31 12:25:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-drbd (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-drbd.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-drbd"

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-drbd/yast2-drbd.changes    2016-04-22 
16:26:02.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-drbd.new/yast2-drbd.changes       
2016-05-31 12:25:33.000000000 +0200
@@ -1,0 +2,6 @@
+Tue May 31 04:42:58 UTC 2016 - nw...@suse.com
+
+- bsc#981779, add IP validation check of resource.
+- Version 3.1.22
+
+-------------------------------------------------------------------

Old:
----
  yast2-drbd-3.1.21.tar.bz2

New:
----
  yast2-drbd-3.1.22.tar.bz2

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

Other differences:
------------------
++++++ yast2-drbd.spec ++++++
--- /var/tmp/diff_new_pack.SQkuMN/_old  2016-05-31 12:25:34.000000000 +0200
+++ /var/tmp/diff_new_pack.SQkuMN/_new  2016-05-31 12:25:34.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-drbd
-Version:        3.1.21
+Version:        3.1.22
 Release:        0
 
 %define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services

++++++ yast2-drbd-3.1.21.tar.bz2 -> yast2-drbd-3.1.22.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-drbd-3.1.21/package/yast2-drbd.changes 
new/yast2-drbd-3.1.22/package/yast2-drbd.changes
--- old/yast2-drbd-3.1.21/package/yast2-drbd.changes    2016-04-21 
11:10:19.000000000 +0200
+++ new/yast2-drbd-3.1.22/package/yast2-drbd.changes    2016-05-31 
07:41:15.000000000 +0200
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Tue May 31 04:42:58 UTC 2016 - nw...@suse.com
+
+- bsc#981779, add IP validation check of resource.
+- Version 3.1.22
+
+-------------------------------------------------------------------
 Thu Apr 21 09:05:07 UTC 2016 - nw...@suse.com
 
 - bsc#976562, fix error when using hyphen in node name.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-drbd-3.1.21/package/yast2-drbd.spec 
new/yast2-drbd-3.1.22/package/yast2-drbd.spec
--- old/yast2-drbd-3.1.21/package/yast2-drbd.spec       2016-04-21 
11:10:19.000000000 +0200
+++ new/yast2-drbd-3.1.22/package/yast2-drbd.spec       2016-05-31 
07:41:15.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package yast2-drbd
 #
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-drbd
-Version:        3.1.21
+Version:        3.1.22
 Release:        0
 
 %define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-drbd-3.1.21/src/include/drbd/helps.rb 
new/yast2-drbd-3.1.22/src/include/drbd/helps.rb
--- old/yast2-drbd-3.1.21/src/include/drbd/helps.rb     2016-04-21 
11:10:19.000000000 +0200
+++ new/yast2-drbd-3.1.22/src/include/drbd/helps.rb     2016-05-31 
07:41:15.000000000 +0200
@@ -75,7 +75,7 @@
           _(
             "\n" +
               "\t\t<p>\"Name\" is mandatory and must match the Linux host name 
(uname -n) of one of the nodes. Should not include \".\" in hostname.</p>\n" +
-              "\t\t<p>\"Address:Port\": A resource needs one IP address per 
device, which is used to wait for incoming connections from the partner device 
to reach the device. Each DRBD resource needs a TCP port which is used to 
connect to the node's partner device.</p>\n" +
+              "\t\t<p>\"Address:Port\": A resource needs one IP address per 
device, which is used to wait for incoming connections from the partner device 
to reach the device. Each DRBD resource needs a TCP port which is used to 
connect to the node's partner device. For IPv6, the actual address that follows 
the ipv6 keyword must be placed inside brackets: ipv6 
[2001:1945:fc03:abcd::1]:7788</p>\n" +
               "\t\t<p>\"Device\": The name of the block device node of the 
resource being described. You must use this device with your application (file 
system) and you must not use the low level block device which is specified with 
the disk parameter,following its minor number. Otherwise, you may omit the 
name, or the word minor and its number. If you omit the name a default of 
/dev/drbd'minor number' will be used.\n" +
               "\t\tLike: '/dev/drbd{service} minor {minor drbd number 
[0...255]}' or '/dev/drbd{minor drbd number [0...255]}'</p>\n" +
               "\t\t<p>\"Disk\":  DRBD uses this block device to actually store 
and retrieve the data.  Never access such a device while DRBD is running on top 
of  it.</p>\n" +
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-drbd-3.1.21/src/include/drbd/resource_conf.rb 
new/yast2-drbd-3.1.22/src/include/drbd/resource_conf.rb
--- old/yast2-drbd-3.1.21/src/include/drbd/resource_conf.rb     2016-04-21 
11:10:19.000000000 +0200
+++ new/yast2-drbd-3.1.22/src/include/drbd/resource_conf.rb     2016-05-31 
07:41:15.000000000 +0200
@@ -13,6 +13,7 @@
       Yast.import "Label"
       Yast.import "Wizard"
       Yast.import "Service"
+      Yast.import "IP"
       Yast.import "Drbd"
 
       Yast.include include_target, "drbd/helps.rb"
@@ -623,6 +624,47 @@
       deep_copy(res_config)
     end
 
+    def ValidIPaddress
+      addressField = Convert.to_string(UI.QueryWidget(Id(:n_addr), :Value))
+
+      if addressField.include?("ipv6")
+        # eg. ipv6 [fd01:2345:6789:abcd::1]:7800
+        if ! (addressField.include?("[") and addressField.include?("]"))
+          Popup.Warning(_("IPv6 address must be placed inside brackets."))
+          return false
+        end
+
+        # IPv6 should including port
+        if addressField.split("]")[1] and 
addressField.split("]")[1].include?(":")
+          ip = addressField.split("]")[0].split("[")[1]
+        else
+          Popup.Warning(_("IP/port should use 'addr:port' combination."))
+          return false
+        end
+      else
+        if ! addressField.include?(":")
+          Popup.Warning(_("IP/port should use 'addr:port' combination."))
+          return false
+        end
+
+        ip = addressField.split(":")[0]
+      end
+
+      if IP.Check(ip) != true
+        Popup.Message(_("Please enter a valid IP address."))
+        return false
+      end
+
+      # Checking the port is number
+      if addressField.split(":").size == 1 or
+         addressField.split(":")[-1].to_i == 0
+        Popup.Message(_("Please enter a valid port number."))
+        return false
+      end
+
+      true
+    end
+
     def ResDialog(resname)
       current = 0
       ret = nil
@@ -711,6 +753,12 @@
             end
           end
 
+          if ! ValidIPaddress()
+              invalid = true
+              ret = nil
+              next
+          end
+
           if ret == :ok
             if node_list.size < 2
               Popup.Warning(_("Please configure at least two nodes."))


Reply via email to