Hello community,
here is the log from the commit of package yast2-registration for
openSUSE:Factory checked in at 2018-11-01 18:57:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-registration (Old)
and /work/SRC/openSUSE:Factory/.yast2-registration.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-registration"
Thu Nov 1 18:57:17 2018 rev:23 rq:642404 version:4.1.5
Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-registration/yast2-registration.changes
2018-09-04 22:51:43.312087421 +0200
+++
/work/SRC/openSUSE:Factory/.yast2-registration.new/yast2-registration.changes
2018-11-01 18:57:22.529979362 +0100
@@ -1,0 +2,29 @@
+Tue Oct 16 15:35:43 CEST 2018 - [email protected]
+
+- Added license file to spec.
+
+-------------------------------------------------------------------
+Fri Oct 12 10:41:27 CEST 2018 - [email protected]
+
+- Added tags full_system_media_name and full_system_download_url
+ in control.xml which describe the location for the
+ "all-packages" medium. This information will be shown if the
+ registration has been scipped by the user. No hint will be shown
+ if these tags have not been defined. (fate#325834)
+- 4.1.5
+
+-------------------------------------------------------------------
+Thu Oct 11 14:55:15 UTC 2018 - [email protected]
+
+- CRLF control characters cannot be included in the registration
+ code, added validation check (bsc#1111419)
+- 4.1.4
+
+-------------------------------------------------------------------
+Mon Sep 17 08:54:19 UTC 2018 - [email protected]
+
+- Suggest downloading the "SLE-15-SP1-Packages" medium instead of
+ the old "SLE-15-Packages" (bsc#1108620)
+- 4.1.3
+
+-------------------------------------------------------------------
Old:
----
yast2-registration-4.1.2.tar.bz2
New:
----
yast2-registration-4.1.5.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-registration.spec ++++++
--- /var/tmp/diff_new_pack.eUamNU/_old 2018-11-01 18:57:22.901979397 +0100
+++ /var/tmp/diff_new_pack.eUamNU/_new 2018-11-01 18:57:22.905979398 +0100
@@ -17,7 +17,7 @@
Name: yast2-registration
-Version: 4.1.2
+Version: 4.1.5
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -99,5 +99,6 @@
%{yast_libdir}/yast
%{yast_libdir}/yast/suse_connect.rb
%doc %{yast_docdir}
+%license COPYING
%changelog
++++++ yast2-registration-4.1.2.tar.bz2 -> yast2-registration-4.1.5.tar.bz2
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-registration-4.1.2/package/yast2-registration.changes
new/yast2-registration-4.1.5/package/yast2-registration.changes
--- old/yast2-registration-4.1.2/package/yast2-registration.changes
2018-09-04 12:42:19.000000000 +0200
+++ new/yast2-registration-4.1.5/package/yast2-registration.changes
2018-10-16 17:43:09.000000000 +0200
@@ -1,4 +1,33 @@
-------------------------------------------------------------------
+Tue Oct 16 15:35:43 CEST 2018 - [email protected]
+
+- Added license file to spec.
+
+-------------------------------------------------------------------
+Fri Oct 12 10:41:27 CEST 2018 - [email protected]
+
+- Added tags full_system_media_name and full_system_download_url
+ in control.xml which describe the location for the
+ "all-packages" medium. This information will be shown if the
+ registration has been scipped by the user. No hint will be shown
+ if these tags have not been defined. (fate#325834)
+- 4.1.5
+
+-------------------------------------------------------------------
+Thu Oct 11 14:55:15 UTC 2018 - [email protected]
+
+- CRLF control characters cannot be included in the registration
+ code, added validation check (bsc#1111419)
+- 4.1.4
+
+-------------------------------------------------------------------
+Mon Sep 17 08:54:19 UTC 2018 - [email protected]
+
+- Suggest downloading the "SLE-15-SP1-Packages" medium instead of
+ the old "SLE-15-Packages" (bsc#1108620)
+- 4.1.3
+
+-------------------------------------------------------------------
Tue Sep 4 08:34:31 UTC 2018 - [email protected]
- Limit the registration code size to 512 characters (bsc#1098576)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-registration-4.1.2/package/yast2-registration.spec
new/yast2-registration-4.1.5/package/yast2-registration.spec
--- old/yast2-registration-4.1.2/package/yast2-registration.spec
2018-09-04 12:42:19.000000000 +0200
+++ new/yast2-registration-4.1.5/package/yast2-registration.spec
2018-10-16 17:43:09.000000000 +0200
@@ -17,7 +17,7 @@
Name: yast2-registration
-Version: 4.1.2
+Version: 4.1.5
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -100,5 +100,6 @@
%{yast_libdir}/yast
%{yast_libdir}/yast/suse_connect.rb
%doc %{yast_docdir}
+%license COPYING
%changelog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-registration-4.1.2/src/lib/registration/ui/base_system_registration_dialog.rb
new/yast2-registration-4.1.5/src/lib/registration/ui/base_system_registration_dialog.rb
---
old/yast2-registration-4.1.2/src/lib/registration/ui/base_system_registration_dialog.rb
2018-09-04 12:42:19.000000000 +0200
+++
new/yast2-registration-4.1.5/src/lib/registration/ui/base_system_registration_dialog.rb
2018-10-16 17:43:09.000000000 +0200
@@ -31,6 +31,7 @@
Yast.import "Wizard"
Yast.import "Popup"
Yast.import "Report"
+ Yast.import "ProductFeatures"
WIDGETS = {
register_scc: [:email, :reg_code],
@@ -361,17 +362,32 @@
#
# @return [Boolean] true when skipping has been confirmed
def show_skipping_warning
+ media_name = ProductFeatures.GetStringFeature(
+ "globals",
+ "full_system_media_name"
+ )
+ download_url = ProductFeatures.GetStringFeature(
+ "globals",
+ "full_system_download_url"
+ )
+
+ warning = _("Without registration, update channels will not be\n" \
+ "configured. This disables updates and security fixes.")
+
# Popup question: confirm skipping the registration
# TRANSLATORS:
# %{media_name} is the media name (e.g. SLE-15-Packages),
# %{download_url} is an URL link (e.g. https://download.suse.com)
- warning = _("Without registration, update channels will not be\n" \
- "configured. This disables updates and security fixes.\n\n" \
- "A full system can be installed using the\n" \
- "%{media_name} media from %{download_url}.\n" \
- "Without these media only a minimum system is available\n" \
- "in this installation.") %
- { media_name: "SLE-15-Packages", download_url:
"https://download.suse.com" }
+ if !media_name.empty? && # cannot be nil
+ !download_url.empty? # cannot be nil
+ warning += "\n\n" +
+ _("A full system can be installed using the\n" \
+ "%{media_name} media from %{download_url}.\n" \
+ "Without these media only a minimum system is available\n" \
+ "in this installation.") %
+ { media_name: media_name, download_url: download_url }
+ end
+
Yast::Popup.Warning(warning)
end
@@ -548,6 +564,19 @@
end
end
+ def validate_register_scc
+ reg_code = Yast::UI.QueryWidget(:reg_code, :Value)
+
+ # no CR or LF control characters, they cannot be used in HTTP header
fields
+ if reg_code.include?("\n") || reg_code.include?("\r")
+ # TRANSLATORS: error message, the entered registration code is not
valid.
+ Yast::Report.Error(_("Invalid registration code.\nCRLF characters
are not allowed."))
+ false
+ else
+ true
+ end
+ end
+
VALID_CUSTOM_URL_SCHEMES = ["http", "https"].freeze
# Determine whether an URL is valid and suitable to be used as local SMT
server
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-registration-4.1.2/test/base_system_registration_dialog_test.rb
new/yast2-registration-4.1.5/test/base_system_registration_dialog_test.rb
--- old/yast2-registration-4.1.2/test/base_system_registration_dialog_test.rb
2018-09-04 12:42:19.000000000 +0200
+++ new/yast2-registration-4.1.5/test/base_system_registration_dialog_test.rb
2018-10-16 17:43:09.000000000 +0200
@@ -57,7 +57,7 @@
it "registers the base system with provided email and reg. code" do
expect(Yast::UI).to receive(:QueryWidget).with(:email, :Value)
.and_return(email)
- expect(Yast::UI).to receive(:QueryWidget).with(:reg_code, :Value)
+ allow(Yast::UI).to receive(:QueryWidget).with(:reg_code, :Value)
.and_return(reg_code)
expect(Yast::UI).to receive(:UserInput).and_return(:next)
@@ -81,7 +81,7 @@
it "does not register the system" do
expect(Yast::UI).to receive(:QueryWidget).with(:email, :Value)
.and_return(email)
- expect(Yast::UI).to receive(:QueryWidget).with(:reg_code, :Value)
+ allow(Yast::UI).to receive(:QueryWidget).with(:reg_code, :Value)
.and_return(reg_code)
expect(Yast::UI).to receive(:UserInput).and_return(:next, :abort)
expect(Registration::UI::AbortConfirmation).to
receive(:run).and_return(true)
@@ -99,6 +99,22 @@
end
end
+ context "when user enters an invalid regcode" do
+ # include CRLF characters which are not allowed
+ let(:reg_code) { "\nmy-reg-code\r" }
+ it "displays error popup and does not register the system" do
+ allow(Yast::UI).to receive(:QueryWidget).with(:reg_code, :Value)
+ .and_return(reg_code)
+ allow(Yast::UI).to receive(:UserInput).and_return(:next, :abort)
+ allow(Registration::UI::AbortConfirmation).to
receive(:run).and_return(true)
+
+ expect(Yast::Report).to receive(:Error).with(/Invalid registration
code/)
+ expect(registration_ui).to_not
receive(:register_system_and_base_product)
+
+ subject.run
+ end
+ end
+
context "when user sets a registration URL through regurl= parameter" do
let(:regurl) { "https://example.suse.net" }
@@ -109,7 +125,7 @@
it "uses the given URL to register the system" do
expect(Yast::UI).to receive(:QueryWidget).with(:email, :Value)
.and_return(email)
- expect(Yast::UI).to receive(:QueryWidget).with(:reg_code, :Value)
+ allow(Yast::UI).to receive(:QueryWidget).with(:reg_code, :Value)
.and_return(reg_code)
expect(Yast::UI).to receive(:UserInput).and_return(:next)
@@ -163,12 +179,41 @@
end
context "when user skips registration" do
- it "does not try to register the system and close the dialog" do
+ before do
allow(Yast::UI).to
receive(:UserInput).and_return(:skip_registration, :next)
+ end
+
+ it "does not try to register the system and close the dialog" do
expect(Yast::Popup).to receive(:Warning).with(/Without registration/)
.and_return(true)
expect(subject.run).to eq(:skip)
end
+
+ context "when full_system_media_name and full_system_download_url" \
+ " is defined in control.xml" do
+ it "reports the media name and the regarding download url to the
user" do
+ expect(Yast::ProductFeatures).to receive(:GetStringFeature)
+ .with("globals",
"full_system_media_name").and_return("SLE-15-Packages")
+ expect(Yast::ProductFeatures).to receive(:GetStringFeature)
+ .with("globals",
"full_system_download_url").and_return("https://download.suse.com")
+ expect(Yast::Popup).to
receive(:Warning).with(/SLE-15-Packages.*download.suse.com/)
+ expect(subject.run).to eq(:skip)
+ end
+ end
+
+ context "when full_system_media_name and full_system_download_url" \
+ " is NOT defined in control.xml" do
+ it "does not mention any media information" do
+ expect(Yast::ProductFeatures).to receive(:GetStringFeature)
+ .with("globals", "full_system_media_name").and_return("")
+ expect(Yast::ProductFeatures).to receive(:GetStringFeature)
+ .with("globals", "full_system_download_url").and_return("")
+ expect(Yast::Popup).to receive(:Warning).with(/Without
registration/)
+ .and_return(true)
+ expect(Yast::Popup).not_to receive(:Warning).with(/Without these
media only/)
+ expect(subject.run).to eq(:skip)
+ end
+ end
end
end