Skip to content

Commit

Permalink
Merge c7d2a5f into 8548311
Browse files Browse the repository at this point in the history
  • Loading branch information
dgdavid committed Sep 4, 2018
2 parents 8548311 + c7d2a5f commit 387a413
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions package/yast2-registration.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Sep 4 08:34:31 UTC 2018 - dgonzalez@suse.com

- Limit the registration code size to 512 characters (bsc#1098576)
- 4.1.2

-------------------------------------------------------------------
Fri Aug 31 10:12:16 UTC 2018 - lslezak@suse.cz

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


Name: yast2-registration
Version: 4.1.1
Version: 4.1.2
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
3 changes: 3 additions & 0 deletions src/lib/registration/ui/base_system_registration_dialog.rb
Expand Up @@ -65,6 +65,9 @@ def run
Yast::GetInstArgs.enable_next || Yast::Mode.normal
)

# Limit the reg_code InputField to 512 (bsc#1098576)
Yast::UI.ChangeWidget(:reg_code, :InputMaxLength, 512)

# Set default action
self.action = initial_action
set_focus
Expand Down
9 changes: 9 additions & 0 deletions test/base_system_registration_dialog_test.rb
Expand Up @@ -32,6 +32,7 @@
allow(Yast::Mode).to receive(:mode).and_return(mode)
allow(Registration::Registration).to receive(:is_registered?).and_return(registered?)
allow(Registration::UrlHelpers).to receive(:slp_discovery_feedback).and_return([])
allow(Yast::UI).to receive(:ChangeWidget)
end

context "when system is not registered" do
Expand All @@ -44,6 +45,14 @@
allow(Registration::Helpers).to receive(:reset_registration_status)
end

it "limits the reg_code InputField to 512" do
allow(subject).to receive(:event_loop).and_return(nil)

expect(Yast::UI).to receive(:ChangeWidget).with(:reg_code, :InputMaxLength, 512)

subject.run
end

context "when user enters a correct regcode" do
it "registers the base system with provided email and reg. code" do
expect(Yast::UI).to receive(:QueryWidget).with(:email, :Value)
Expand Down

0 comments on commit 387a413

Please sign in to comment.