Skip to content

Commit

Permalink
checking if address file exists before reading
Browse files Browse the repository at this point in the history
  • Loading branch information
schubi2 committed Jan 18, 2019
1 parent 33d8f20 commit 9c7722e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions package/yast2-network.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Jan 18 09:40:00 CET 2019 - schubi@suse.de

- AutoYaST write settings: Fixed crash while reading MAC address
(bsc#1121087).
- 4.1.31

-------------------------------------------------------------------
Wed Jan 16 09:23:11 UTC 2019 - mfilka@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-network.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-network
Version: 4.1.30
Version: 4.1.31
Release: 0
BuildArch: noarch

Expand Down
3 changes: 2 additions & 1 deletion src/modules/Lan.rb
Expand Up @@ -183,7 +183,8 @@ def isAnyInterfaceDown
to: "list <string>"
)
) do |devname|
mac = ::File.read("/sys/class/net/#{devname}/address").chomp
address_file = "/sys/class/net/#{devname}/address"
mac = ::File.read(address_file).chomp if ::File.file?(address_file)
Builtins.y2milestone("confname %1", mac)
if !Builtins.haskey(link_status, mac)
Builtins.y2error(
Expand Down

0 comments on commit 9c7722e

Please sign in to comment.