Skip to content

Commit

Permalink
Reporting an error if an currupted AY configuration file has been rea…
Browse files Browse the repository at this point in the history
…d (bsc#160975).
  • Loading branch information
schubi2 committed Aug 24, 2020
1 parent a85a44e commit b4c2160
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions package/autoyast2.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Aug 24 13:44:00 CEST 2020 - schubi@suse.de

- Reporting an error if an currupted AY configuration file has been
read (bsc#160975).
- 4.3.36

-------------------------------------------------------------------
Thu Aug 13 07:04:06 UTC 2020 - Michal Filka <mfilka@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/autoyast2.spec
Expand Up @@ -22,7 +22,7 @@
%endif

Name: autoyast2
Version: 4.3.35
Version: 4.3.36
Release: 0
Summary: YaST2 - Automated Installation
License: GPL-2.0-only
Expand Down
9 changes: 9 additions & 0 deletions src/modules/ProfileLocation.rb
Expand Up @@ -116,6 +116,15 @@ def Process
return false
end
tmp = Convert.to_string(SCR.Read(path(".target.string"), localfile))

unless tmp.valid_encoding?
# TRANSLATORS: %s is the filename
Report.Error(
format(_("AutoYaST file %s\nhas no valid encoding or is corrupted."), filename)
)
return false
end

l = Builtins.splitstring(tmp, "\n")
while !tmp.nil? && Ops.get(l, 0, "") == "-----BEGIN PGP MESSAGE-----"
Builtins.y2milestone("encrypted profile found")
Expand Down

0 comments on commit b4c2160

Please sign in to comment.