Hello community, here is the log from the commit of package yast2-fcoe-client for openSUSE:Factory checked in at 2018-12-31 09:45:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-fcoe-client (Old) and /work/SRC/openSUSE:Factory/.yast2-fcoe-client.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-fcoe-client" Mon Dec 31 09:45:06 2018 rev:50 rq:660276 version:4.1.2 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-fcoe-client/yast2-fcoe-client.changes 2018-09-04 22:50:57.387929862 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-fcoe-client.new.28833/yast2-fcoe-client.changes 2018-12-31 09:45:08.622277802 +0100 @@ -1,0 +2,13 @@ +Thu Dec 20 08:54:28 UTC 2018 - Josef Reidinger <[email protected]> + +- always use absolute path to binaries (bsc#1118291) +- properly escape shell arguments (bsc#1118291) +- 4.1.2 + +------------------------------------------------------------------- +Sun Nov 25 14:04:13 UTC 2018 - Stasiek Michalski <[email protected]> + +- Provide icon with module (boo#1109310) +- 4.1.1 + +------------------------------------------------------------------- Old: ---- yast2-fcoe-client-4.1.0.tar.bz2 New: ---- yast2-fcoe-client-4.1.2.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-fcoe-client.spec ++++++ --- /var/tmp/diff_new_pack.DeH7R4/_old 2018-12-31 09:45:09.130277385 +0100 +++ /var/tmp/diff_new_pack.DeH7R4/_new 2018-12-31 09:45:09.134277382 +0100 @@ -17,7 +17,7 @@ Name: yast2-fcoe-client -Version: 4.1.0 +Version: 4.1.2 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -67,6 +67,7 @@ %dir %{yast_scrconfdir} %{yast_scrconfdir}/*.scr %doc %{yast_docdir} +%{yast_icondir} %license COPYING %changelog ++++++ yast2-fcoe-client-4.1.0.tar.bz2 -> yast2-fcoe-client-4.1.2.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-4.1.0/package/yast2-fcoe-client.changes new/yast2-fcoe-client-4.1.2/package/yast2-fcoe-client.changes --- old/yast2-fcoe-client-4.1.0/package/yast2-fcoe-client.changes 2018-08-23 18:02:43.000000000 +0200 +++ new/yast2-fcoe-client-4.1.2/package/yast2-fcoe-client.changes 2018-12-20 13:11:12.000000000 +0100 @@ -1,4 +1,17 @@ ------------------------------------------------------------------- +Thu Dec 20 08:54:28 UTC 2018 - Josef Reidinger <[email protected]> + +- always use absolute path to binaries (bsc#1118291) +- properly escape shell arguments (bsc#1118291) +- 4.1.2 + +------------------------------------------------------------------- +Sun Nov 25 14:04:13 UTC 2018 - Stasiek Michalski <[email protected]> + +- Provide icon with module (boo#1109310) +- 4.1.1 + +------------------------------------------------------------------- Wed Aug 22 07:28:35 UTC 2018 - [email protected] - Update calls to YaST2 systemd classes (related to fate#319428) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-4.1.0/package/yast2-fcoe-client.spec new/yast2-fcoe-client-4.1.2/package/yast2-fcoe-client.spec --- old/yast2-fcoe-client-4.1.0/package/yast2-fcoe-client.spec 2018-08-23 18:02:43.000000000 +0200 +++ new/yast2-fcoe-client-4.1.2/package/yast2-fcoe-client.spec 2018-12-20 13:11:12.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-fcoe-client -Version: 4.1.0 +Version: 4.1.2 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -66,6 +66,7 @@ %dir %{yast_scrconfdir} %{yast_scrconfdir}/*.scr %doc %{yast_docdir} +%{yast_icondir} %license COPYING %changelog diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-4.1.0/src/Makefile.am new/yast2-fcoe-client-4.1.2/src/Makefile.am --- old/yast2-fcoe-client-4.1.0/src/Makefile.am 2018-08-23 18:02:43.000000000 +0200 +++ new/yast2-fcoe-client-4.1.2/src/Makefile.am 2018-12-20 13:11:12.000000000 +0100 @@ -24,6 +24,13 @@ desktop_DATA = \ desktop/fcoe-client.desktop -EXTRA_DIST = $(module_DATA) $(client_DATA) $(ynclude_DATA) $(scrconf_DATA) $(desktop_DATA) +symbolicdir = @icondir@/hicolor/symbolic/apps +symbolic_DATA = \ + icons/hicolor/symbolic/apps/yast-fcoe-symbolic.svg +scalabledir = @icondir@/hicolor/scalable/apps +scalable_DATA = \ + icons/hicolor/scalable/apps/yast-fcoe.svg -include $(top_srcdir)/Makefile.am.common \ No newline at end of file +EXTRA_DIST = $(module_DATA) $(client_DATA) $(ynclude_DATA) $(scrconf_DATA) $(desktop_DATA) $(symbolic_DATA) $(scalable_DATA) + +include $(top_srcdir)/Makefile.am.common diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-4.1.0/src/clients/fcoe-client_auto.rb new/yast2-fcoe-client-4.1.2/src/clients/fcoe-client_auto.rb --- old/yast2-fcoe-client-4.1.0/src/clients/fcoe-client_auto.rb 2018-08-23 18:02:43.000000000 +0200 +++ new/yast2-fcoe-client-4.1.2/src/clients/fcoe-client_auto.rb 2018-12-20 13:11:12.000000000 +0100 @@ -23,18 +23,20 @@ # Package: Configuration of fcoe-client # Summary: Client for autoinstallation # Authors: Gabriele Mohr <[email protected]> -# -# -# This is a client for autoinstallation. It takes its arguments, -# goes through the configuration and return the setting. -# Does not do any changes to the configuration. - -# @param function to execute -# @param map/list of fcoe-client settings -# @return [Hash] edited settings, Summary or boolean on success depending on called function -# @example map mm = $[ "FAIL_DELAY" : "77" ]; -# @example map ret = WFM::CallFunction ("fcoe-client_auto", [ "Summary", mm ]); + +require "shellwords" + module Yast + # + # This is a client for autoinstallation. It takes its arguments, + # goes through the configuration and return the setting. + # Does not do any changes to the configuration. + + # @param function to execute + # @param map/list of fcoe-client settings + # @return [Hash] edited settings, Summary or boolean on success depending on called function + # @example map mm = $[ "FAIL_DELAY" : "77" ]; + # @example map ret = WFM::CallFunction ("fcoe-client_auto", [ "Summary", mm ]); class FcoeClientAutoClient < Client def main Yast.import "UI" @@ -153,9 +155,9 @@ dev_name = card["dev_name"] if card["fcoe_vlan"] == FcoeClient.NOT_CONFIGURED if card["auto_vlan"] == "yes" - command = "fipvlan -c -s -f '-fcoe' #{dev_name}" + command = "/usr/sbin/fipvlan -c -s -f '-fcoe' #{dev_name.shellescape}" else - command = "fipvlan -c -s #{dev_name}" + command = "/usr/sbin/fipvlan -c -s #{dev_name.shellescape}" end ifcfg_file = Builtins.sformat( @@ -167,29 +169,25 @@ # call 'ifup' for the interface (creates /proc/net/vlan/<vlan-interface>) if FileUtils.Exists(ifcfg_file) cmd_ifup = Builtins.sformat( - "ifup %1.%2", - Ops.get_string(card, "dev_name", ""), - Ops.get_string(card, "vlan_interface", "") + "/usr/sbin/ifup %1.%2", + Ops.get_string(card, "dev_name", "").shellescape, + Ops.get_string(card, "vlan_interface", "").shellescape ) Builtins.y2milestone("Executing command: %1", cmd_ifup) - output = Convert.to_map( - SCR.Execute(path(".target.bash_output"), cmd_ifup) - ) + output = SCR.Execute(path(".target.bash_output"), cmd_ifup) Builtins.y2milestone("Output: %1", output) if Ops.get_integer(output, "exit", 255) == 0 # start FCoE command = Builtins.sformat( - "fipvlan -s %1", - Ops.get_string(card, "dev_name", "") + "/usr/sbin/fipvlan -s %1", + Ops.get_string(card, "dev_name", "").shellescape ) end end Builtins.y2milestone("Executing command: %1", command) - output = Convert.to_map( - SCR.Execute(path(".target.bash_output"), command) - ) + output = SCR.Execute(path(".target.bash_output"), command) Builtins.y2milestone("Output: %1", output) if Ops.get_integer(output, "exit", 255) != 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-4.1.0/src/clients/fcoe-client_finish.rb new/yast2-fcoe-client-4.1.2/src/clients/fcoe-client_finish.rb --- old/yast2-fcoe-client-4.1.0/src/clients/fcoe-client_finish.rb 2018-08-23 18:02:43.000000000 +0200 +++ new/yast2-fcoe-client-4.1.2/src/clients/fcoe-client_finish.rb 2018-12-20 13:11:12.000000000 +0100 @@ -28,6 +28,8 @@ # Authors: # Gabriele Mohr <[email protected]> # +require "shellwords" + require "yast2/systemd/socket" module Yast @@ -76,21 +78,10 @@ if @netcards != [] Builtins.y2milestone("Copying files /etc/fcoe/* to destination") # copy fcoe config files to destdir + destdir = File.join(Installation.destdir, "etc/fcoe") WFM.Execute( path(".local.bash"), - Ops.add( - Ops.add( - Ops.add( - Ops.add( - "test -d /etc/fcoe/ && mkdir -p '", - String.Quote(Installation.destdir) - ), - "/etc/fcoe' && cp -a /etc/fcoe/* '" - ), - String.Quote(Installation.destdir) - ), - "/etc/fcoe/'" - ) + "/usr/bin/test -d /etc/fcoe/ && /usr/bin/mkdir -p #{destdir.shellescape} && /usr/bin/cp -a /etc/fcoe/* #{destdir.shellescape}" ) else Builtins.y2milestone("Nothing to do") @@ -111,9 +102,9 @@ Ops.get_string(card, "vlan_interface", "") ) command = Builtins.sformat( - "cp -a %1 '%2/etc/sysconfig/network'", - file_name, - String.Quote(Installation.destdir) + "/usr/bin/cp -a %1 %2/etc/sysconfig/network", + file_name.shellescape, + Installation.destdir.shellescape ) Builtins.y2milestone("Executing command: %1", command) WFM.Execute(path(".local.bash"), command) @@ -123,9 +114,9 @@ Ops.get_string(card, "dev_name", "") ) command = Builtins.sformat( - "cp -a %1 '%2/etc/sysconfig/network'", - file_name, - String.Quote(Installation.destdir) + "/usr/bin/cp -a %1 %2/etc/sysconfig/network", + file_name.shellescape, + Installation.destdir.shellescape ) Builtins.y2milestone("Executing command: %1", command) WFM.Execute(path(".local.bash"), command) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-4.1.0/src/clients/inst_fcoe-client.rb new/yast2-fcoe-client-4.1.2/src/clients/inst_fcoe-client.rb --- old/yast2-fcoe-client-4.1.0/src/clients/inst_fcoe-client.rb 2018-08-23 18:02:43.000000000 +0200 +++ new/yast2-fcoe-client-4.1.2/src/clients/inst_fcoe-client.rb 2018-12-20 13:11:12.000000000 +0100 @@ -59,7 +59,7 @@ Builtins.y2milestone("fcoe-client module started during installation") # create /etc/fcoe - SCR.Execute(path(".target.bash"), "mkdir -p /etc/fcoe") + SCR.Execute(path(".target.bash"), "/usr/bin/mkdir -p /etc/fcoe") # FcoeClient::CheckInstalledPackages() not needed in inst-sys # FcoeClient::DetectStartStatus() doesn't make sense in inst-sys diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-4.1.0/src/desktop/fcoe-client.desktop new/yast2-fcoe-client-4.1.2/src/desktop/fcoe-client.desktop --- old/yast2-fcoe-client-4.1.0/src/desktop/fcoe-client.desktop 2018-08-23 18:02:43.000000000 +0200 +++ new/yast2-fcoe-client-4.1.2/src/desktop/fcoe-client.desktop 2018-12-20 13:11:12.000000000 +0100 @@ -16,7 +16,7 @@ X-SuSE-YaST-AutoInstClonable=true X-SuSE-YaST-Keywords=fibre,channel,ethernet,network -Icon=fcoe +Icon=yast-fcoe Exec=/usr/bin/xdg-su -c '/sbin/yast2 fcoe-client' Name=FCoE Client Configuration diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-4.1.0/src/icons/hicolor/scalable/apps/yast-fcoe.svg new/yast2-fcoe-client-4.1.2/src/icons/hicolor/scalable/apps/yast-fcoe.svg --- old/yast2-fcoe-client-4.1.0/src/icons/hicolor/scalable/apps/yast-fcoe.svg 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-fcoe-client-4.1.2/src/icons/hicolor/scalable/apps/yast-fcoe.svg 2018-12-20 13:11:12.000000000 +0100 @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg version="1.1" viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<defs> +<linearGradient id="a"> +<stop stop-color="#1a5fb4" offset="0"/> +<stop stop-color="#1a5fb4" stop-opacity="0" offset="1"/> +</linearGradient> +<linearGradient id="k" x1="2" x2="30" y1="17" y2="17" gradientTransform="scale(4)" gradientUnits="userSpaceOnUse"> +<stop stop-color="#9a9996" offset="0"/> +<stop stop-color="#c0bfbc" offset=".035714"/> +<stop stop-color="#9a9996" offset=".071429"/> +<stop stop-color="#9a9996" offset=".92502"/> +<stop stop-color="#c0bfbc" offset=".96244"/> +<stop stop-color="#9a9996" offset="1"/> +</linearGradient> +<radialGradient id="j" cx="16" cy="15.5" r="10" gradientTransform="matrix(4,0,0,2.6,0,25.7)" gradientUnits="userSpaceOnUse"> +<stop stop-color="#3d3846" offset="0"/> +<stop stop-color="#241f31" offset="1"/> +</radialGradient> +<linearGradient id="l" x1="9" x2="9" y1="10" y2="12" gradientTransform="matrix(4,0,0,4,0,4)" gradientUnits="userSpaceOnUse"> +<stop stop-color="#e5a50a" offset="0"/> +<stop stop-color="#f6d32d" stop-opacity="0" offset="1"/> +</linearGradient> +<linearGradient id="i" x1="2" x2="30" y1="16" y2="16" gradientTransform="scale(4)" gradientUnits="userSpaceOnUse"> +<stop stop-color="#deddda" offset="0"/> +<stop stop-color="#f6f5f4" offset="1"/> +</linearGradient> +<linearGradient id="h" x1="8" x2="8" y1="13" y2="16" gradientTransform="scale(4)" gradientUnits="userSpaceOnUse" xlink:href="#a"/> +<linearGradient id="g" x1="8" x2="8" y1="13" y2="16" gradientTransform="matrix(4 0 0 4 40 0)" gradientUnits="userSpaceOnUse" xlink:href="#a"/> +<linearGradient id="c" x1="8" x2="8" y1="13" y2="16" gradientTransform="matrix(4,0,0,4,60,0)" gradientUnits="userSpaceOnUse" xlink:href="#a"/> +<linearGradient id="b" x1="8" x2="8" y1="13" y2="16" gradientTransform="matrix(4 0 0 4 20 0)" gradientUnits="userSpaceOnUse"> +<stop stop-color="#c64600" offset="0"/> +<stop stop-color="#c64600" stop-opacity="0" offset="1"/> +</linearGradient> +</defs> +<rect x="8" y="24" width="112" height="88" ry="8" fill="url(#k)"/> +<rect x="8" y="20" width="112" height="88" ry="8" fill="url(#i)"/> +<path d="m24 40v44h24v8h32v-8h24v-44z" fill="url(#j)"/> +<path d="m36 44v8h8v-8zm12 0v8h8v-8zm12 0v8h8v-8zm12 0v8h8v-8zm12 0v8h8v-8z" fill="url(#l)"/> +<rect x="44" y="16" width="20" height="44" ry="8" fill="url(#b)"/> +<rect x="22.072" y="88" width="12" height="8" ry="0" fill="#e5a50a"/> +<rect x="92" y="88" width="12" height="8" ry="0" fill="#26a269"/> +<rect x="24" y="28" width="20" height="32" ry="8" fill="url(#h)"/> +<rect x="44" y="16" width="20" height="20" ry="8" fill="#ff7800"/> +<rect x="24" y="28" width="20" height="20" ry="8" fill="#3584e4"/> +<rect x="64" y="28" width="20" height="32" ry="8" fill="url(#g)"/> +<rect x="64" y="28" width="20" height="20" ry="8" fill="#3584e4"/> +<rect x="84" y="28" width="20" height="32" ry="8" fill="url(#c)"/> +<rect x="84" y="28" width="20" height="20" ry="8" fill="#3584e4"/> +</svg> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-4.1.0/src/icons/hicolor/symbolic/apps/yast-fcoe-symbolic.svg new/yast2-fcoe-client-4.1.2/src/icons/hicolor/symbolic/apps/yast-fcoe-symbolic.svg --- old/yast2-fcoe-client-4.1.0/src/icons/hicolor/symbolic/apps/yast-fcoe-symbolic.svg 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-fcoe-client-4.1.2/src/icons/hicolor/symbolic/apps/yast-fcoe-symbolic.svg 2018-12-20 13:11:12.000000000 +0100 @@ -0,0 +1,3 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"> + <path d="M 7 0 L 7 6 L 9 6 L 9 0 L 7 0 z M 1 1 C 0.446 1 0 1.446 0 2 L 0 12 C 0 12.554 0.44604254 12.993134 1 13 L 4 13 L 4 14 C 4 14.554 4.446 15 5 15 L 10 15 L 10 13 L 6 13 L 6 11 L 2 11 L 2 3 L 6 3 L 6 1 L 1 1 z M 10 1 L 10 3 L 14 3 L 14 10 L 16 10 L 16 2 C 16 1.446 15.554 1 15 1 L 10 1 z M 3 4 L 3 6 L 5 6 L 5 4 L 3 4 z M 11 4 L 11 6 L 13 6 L 13 4 L 11 4 z M 11 11 L 11 16 L 16 16 L 16 11 L 11 11 z M 12 12 L 13 12 L 13 13 L 14 13 L 14 12 L 15 12 L 15 14 L 14 14 L 14 15 L 13 15 L 13 14 L 12 14 L 12 12 z " fill="#c0bfbc" /> +</svg> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-4.1.0/src/include/fcoe-client/complex.rb new/yast2-fcoe-client-4.1.2/src/include/fcoe-client/complex.rb --- old/yast2-fcoe-client-4.1.0/src/include/fcoe-client/complex.rb 2018-08-23 18:02:43.000000000 +0200 +++ new/yast2-fcoe-client-4.1.2/src/include/fcoe-client/complex.rb 2018-12-20 13:11:12.000000000 +0100 @@ -24,6 +24,9 @@ # Summary: Dialogs definitions # Authors: Gabriele Mohr <[email protected]> # + +require "shellwords" + module Yast module FcoeClientComplexInclude def initialize_fcoe_client_complex(include_target) @@ -393,9 +396,9 @@ end if card["auto_vlan"] == "yes" || vlan_interface == "0" - command = "fipvlan -c -s -f '-fcoe' #{dev_name}" + command = "/usr/sbin/fipvlan -c -s -f '-fcoe' #{dev_name.shellescape}" else - command = "fipvlan -c -s #{dev_name}" + command = "/usr/sbin/fipvlan -c -s #{dev_name.shellescape}" end output = {} @@ -420,9 +423,7 @@ # execute command, e.g. 'fipvlan -c -s eth3' Builtins.y2milestone("Executing command: %1", command) - output = Convert.to_map( - SCR.Execute(path(".target.bash_output"), command) - ) + output = SCR.Execute(path(".target.bash_output"), command) Builtins.y2milestone("Output: %1", output) if Ops.get_integer(output, "exit", 255) != 0 @@ -439,7 +440,7 @@ # if /etc/sysconfig/network/ifcfg-<if>.<vlan> already exists # call 'ifup' for the interface (creates /proc/net/vlan/<if>.<vlan>) if FileUtils.Exists(ifcfg_file) - cmd_ifup = Builtins.sformat("ifup %1.%2", dev_name, vlan_interface) + cmd_ifup = Builtins.sformat("/usr/sbin/ifup %1.%2", dev_name.shellescape, vlan_interface.shellescape) Builtins.y2milestone("Executing command: %1", cmd_ifup) output = Convert.to_map( SCR.Execute(path(".target.bash_output"), cmd_ifup) @@ -448,14 +449,12 @@ if Ops.get_integer(output, "exit", 255) == 0 # only start FCoE - command = Builtins.sformat("fipvlan -s %1", dev_name) + command = Builtins.sformat("/usr/sbin/fipvlan -s %1", dev_name.shellescape) end end Builtins.y2milestone("Executing command: %1", command) - output = Convert.to_map( - SCR.Execute(path(".target.bash_output"), command) - ) + output = SCR.Execute(path(".target.bash_output"), command) Builtins.y2milestone("Output: %1", output) if Ops.get_integer(output, "exit", 255) != 0 if !FcoeClient.TestMode @@ -505,7 +504,7 @@ # and removes the interface properly (tested on SP2 RC1) # TODO: Retest for SLES12 FcoeClient.AddRevertCommand( - Builtins.sformat("vconfig rem %1", fcoe_vlan_interface) + Builtins.sformat("/usr/sbin/vconfig rem %1", fcoe_vlan_interface.shellescape) ) else fcoe_vlan_interface = FcoeClient.NOT_CONFIGURED @@ -605,19 +604,17 @@ # call fcoeadm -d <fcoe_vlan> first (bnc #719443) command = Builtins.sformat( - "fcoeadm -d %1", - Ops.get_string(card, "cfg_device", "") + "/usr/sbin/fcoeadm -d %1", + Ops.get_string(card, "cfg_device", "").shellescape ) Builtins.y2milestone("Calling %1", command) - output = Convert.to_map( - SCR.Execute(path(".target.bash_output"), command) - ) + output = SCR.Execute(path(".target.bash_output"), command) Builtins.y2milestone("Output: %1", output) if Ops.get_integer(output, "exit", 255) == 0 || FcoeClient.TestMode command = Builtins.sformat( - "vconfig rem %1", - Ops.get_string(card, "fcoe_vlan", "") + "/usr/sbin/vconfig rem %1", + Ops.get_string(card, "fcoe_vlan", "").shellescape ) Builtins.y2milestone("Calling %1", command) output = Convert.to_map( @@ -652,13 +649,11 @@ if del_cfg command = Builtins.sformat( - "rm /etc/fcoe/cfg-%1", - Ops.get_string(card, "cfg_device", "") + "/usr/bin/rm /etc/fcoe/cfg-%1", + Ops.get_string(card, "cfg_device", "").shellescape ) Builtins.y2milestone("Calling %1", command) - output = Convert.to_map( - SCR.Execute(path(".target.bash_output"), command) - ) + output = SCR.Execute(path(".target.bash_output"), command) Builtins.y2milestone("Output: %1", output) else Builtins.y2milestone( @@ -671,8 +666,8 @@ if Ops.get_string(card, "vlan_interface", "") != "0" command = Builtins.sformat( - "rm /etc/sysconfig/network/ifcfg-%1", - Ops.get_string(card, "fcoe_vlan", "") + "/usr/bin/rm /etc/sysconfig/network/ifcfg-%1", + Ops.get_string(card, "fcoe_vlan", "").shellescape ) Builtins.y2milestone("Calling %1", command) output = Convert.to_map( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-4.1.0/src/modules/FcoeClient.rb new/yast2-fcoe-client-4.1.2/src/modules/FcoeClient.rb --- old/yast2-fcoe-client-4.1.0/src/modules/FcoeClient.rb 2018-08-23 18:02:43.000000000 +0200 +++ new/yast2-fcoe-client-4.1.2/src/modules/FcoeClient.rb 2018-12-20 13:11:12.000000000 +0100 @@ -27,6 +27,9 @@ # # Representation of the configuration of fcoe-client. # Input and output routines. + +require "shellwords" + require "yast" require "yast2/systemd/socket" @@ -100,17 +103,6 @@ # return boolean return true if abort @AbortFunction = fun_ref(method(:Modified), "boolean ()") - # from IscsiClientLib.ycp (line 53) - reading output - # - # string from_bios = ((map<string, any>)SCR::Execute(.target.bash_output, "iscsiadm -m fw"))["stdout"]:""; - # foreach(string row, splitstring(from_bios, "\n"), { - # list<string> key_val=splitstring(row, "="); - # // if (size(key_val[0]:"")>0) ibft[key_val[0]:""] = key_val[1]:""; - # string kv = String::CutBlanks(key_val[0]:""); - # if (size(kv) > 0) ibft[kv] = String::CutBlanks(key_val[1]:""); - # }); - - # Define all the variables necessary to hold @current_card = 0 # currently selected card, means row in list of cards @@ -461,15 +453,13 @@ def GetFcoeInfo(net_devices) # Add option -u (or --link_up): don't shut down interfaces # to be able to detect DCB state afterwards (see bnc #737683) - vlan_cmd = "LANG=POSIX fipvlan -u" + vlan_cmd = "LANG=POSIX /usr/sbin/fipvlan -u" if !Mode.autoinst - vlan_cmd = Ops.add(Ops.add(vlan_cmd, " -l "), @number_of_retries) + vlan_cmd << " -l #{@number_of_retries.to_s.shellescape}" end # reduce number of retries - Builtins.foreach( - Convert.convert(net_devices, :from => "list", :to => "list <string>") - ) { |dev| vlan_cmd = Ops.add(Ops.add(vlan_cmd, " "), dev) } + Builtins.foreach(net_devices) { |dev| vlan_cmd << " #{dev.shellescape}" } # call fipvlan command for all interfaces (saves time because is executed in parallel) Builtins.y2milestone("Executing command: %1", vlan_cmd) @@ -590,9 +580,9 @@ end command = Builtins.sformat( - "sed -n 's/\\([^ ]*\\) *.*%1*.*%2/\\1/p' /proc/net/vlan/config", - vlan_interface, - interface + "/usr/bin/sed -n 's/\\([^ ]*\\) *.*'%1'*.*'%2'/\\1/p' /proc/net/vlan/config", + vlan_interface.shellescape, + interface.shellescape ) Builtins.y2milestone("Executing command: %1", command) @@ -672,7 +662,7 @@ file_exists = SCR.Write(path(".target.string"), file_name, content) if file_exists - AddRevertCommand(Builtins.sformat("rm %1", file_name)) + AddRevertCommand(Builtins.sformat("/usr/bin/rm %1", file_name.shellescape)) # fill status map status_map = { "FCOE_ENABLE" => netcard["fcoe_enable"] || "yes", @@ -753,10 +743,10 @@ # 'lldpad' must be started to be able to use 'dcbtool' # -> is started in ServiceStatus() ( called in Read() before DetectNetworkCards() ) - command = Builtins.sformat("LANG=POSIX dcbtool gc %1 dcb", netcard) + command = Builtins.sformat("LANG=POSIX /usr/sbin/dcbtool gc %1 dcb", netcard.shellescape) Builtins.y2milestone("Executing command: %1", command) - output = Convert.to_map(SCR.Execute(path(".target.bash_output"), command)) + output = SCR.Execute(path(".target.bash_output"), command) Builtins.y2milestone("Output: %1", output) status = "" @@ -1353,13 +1343,11 @@ if Ops.get_string(card, "dcb_required", "no") == "yes" # enable DCB on the interface command = Builtins.sformat( - "dcbtool sc %1 dcb on", - Ops.get_string(card, "dev_name", "") + "/usr/sbin/dcbtool sc %1 dcb on", + Ops.get_string(card, "dev_name", "").shellescape ) Builtins.y2milestone("Executing command: %1", command) - output = Convert.to_map( - SCR.Execute(path(".target.bash_output"), command) - ) + output = SCR.Execute(path(".target.bash_output"), command) Builtins.y2milestone("Output: %1", output) if Ops.get_integer(output, "exit", 255) != 0 # only warning, not necessarily an error @@ -1367,14 +1355,12 @@ end # enable App:FCoE on the interface command = Builtins.sformat( - "dcbtool sc %1 app:0 e:1 a:1 w:1", - Ops.get_string(card, "dev_name", "") + "/usr/sbin/dcbtool sc %1 app:0 e:1 a:1 w:1", + Ops.get_string(card, "dev_name", "").shellescape ) Builtins.y2milestone("Executing command: %1", command) - output = Convert.to_map( - SCR.Execute(path(".target.bash_output"), command) - ) + output = SCR.Execute(path(".target.bash_output"), command) Builtins.y2milestone("Output: %1", output) if Ops.get_integer(output, "exit", 255) != 0 # only warning, not necessarily an error diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-4.1.0/test/Makefile.am new/yast2-fcoe-client-4.1.2/test/Makefile.am --- old/yast2-fcoe-client-4.1.0/test/Makefile.am 2018-08-23 18:02:43.000000000 +0200 +++ new/yast2-fcoe-client-4.1.2/test/Makefile.am 2018-12-20 13:11:12.000000000 +0100 @@ -1,5 +1,6 @@ TESTS = \ fcoe_client_write_spec.rb \ + fcoe_client_complex_include_test.rb \ DetectNetworkCards_spec.rb \ GetVlanInterfaces_spec.rb diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-4.1.0/test/fcoe_client_complex_include_test.rb new/yast2-fcoe-client-4.1.2/test/fcoe_client_complex_include_test.rb --- old/yast2-fcoe-client-4.1.0/test/fcoe_client_complex_include_test.rb 2018-08-23 18:02:43.000000000 +0200 +++ new/yast2-fcoe-client-4.1.2/test/fcoe_client_complex_include_test.rb 2018-12-20 13:11:12.000000000 +0100 @@ -2,6 +2,7 @@ require_relative "test_helper" Yast.import "Popup" +Yast.import "FcoeClient" class ComplexIncludeTest < Yast::Module def initialize @@ -34,7 +35,7 @@ it "smokes not" do expect(Yast::SCR) .to receive(:Execute) - .with(path(".target.bash_output"), "fipvlan -c -s eth9") + .with(path(".target.bash_output"), "/usr/sbin/fipvlan -c -s eth9") .and_return({"exit" => 0}) expect(Yast::FcoeClient).to receive(:GetFcoeVlanInterface).and_return("eth9.500") expect { subject.HandleInterfacesDialog(nil, event) }.to_not raise_error
