Skip to content

Commit

Permalink
Merge pull request #528 from mchf/bnc1017716-internal-error
Browse files Browse the repository at this point in the history
Do not cache ifcfgs with emtpy device name part
  • Loading branch information
mchf committed Jan 5, 2017
2 parents 75a9162 + f86749b commit 5fca6fb
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions library/network/src/modules/NetworkInterfaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ def get_devices(devregex = "[~]")
devices = SCR.Dir(path(".network.section")) || []

devices.select! { |file| file !~ /#{devregex}/ } unless devregex.nil? && devregex.empty?
devices.delete_if(&:empty?)

log.debug "devices=#{devices}"
devices
Expand Down
2 changes: 2 additions & 0 deletions library/network/test/data/etc/sysconfig/network/ifcfg-
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
STARTMODE="auto"
BOOTPROTO="dhcp"
8 changes: 8 additions & 0 deletions library/network/test/network_interfaces_helpers_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ module Yast
expect(subject.get_devices("")).to eql devices
end

it "does not crash with exception" do
expect { subject.get_devices }.not_to raise_error
end

it "doesn't carry empty strings" do
expect(subject.get_devices).not_to include ""
end

end

describe "#canonicalize_config" do
Expand Down
10 changes: 10 additions & 0 deletions package/yast2.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Thu Jan 5 11:35:23 UTC 2017 - mfilka@suse.com

- bnc#1017716
- do not cache ifcfg files with empty device name part (ifcfg-).
Such file cannot be mapped to any existing device and providing
empty device name could lead to unexpected crashes in other
parts of yast.
- 3.2.11

-------------------------------------------------------------------
Thu Jan 5 08:06:25 UTC 2017 - lslezak@suse.cz

Expand Down
2 changes: 1 addition & 1 deletion package/yast2.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2
Version: 3.2.10
Version: 3.2.11
Release: 0
Summary: YaST2 - Main Package
License: GPL-2.0
Expand Down

0 comments on commit 5fca6fb

Please sign in to comment.