Hello community, here is the log from the commit of package yast2-ntp-client for openSUSE:Factory checked in at 2016-07-12 23:45:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-ntp-client (Old) and /work/SRC/openSUSE:Factory/.yast2-ntp-client.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-ntp-client" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-ntp-client/yast2-ntp-client.changes 2016-06-26 23:50:54.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-ntp-client.new/yast2-ntp-client.changes 2016-07-12 23:45:15.000000000 +0200 @@ -1,0 +2,7 @@ +Thu Jun 30 06:51:52 UTC 2016 - jreidinger@suse.com + +- Fix regression: crash when reading cron entry failed + ( discovered by sap-ha module ) (bsc#977610, bsc#987064) +- 3.1.27 + +------------------------------------------------------------------- Old: ---- yast2-ntp-client-3.1.26.tar.bz2 New: ---- yast2-ntp-client-3.1.27.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-ntp-client.spec ++++++ --- /var/tmp/diff_new_pack.B5M5sm/_old 2016-07-12 23:45:16.000000000 +0200 +++ /var/tmp/diff_new_pack.B5M5sm/_new 2016-07-12 23:45:16.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-ntp-client -Version: 3.1.26 +Version: 3.1.27 Release: 0 Summary: YaST2 - NTP Client Configuration License: GPL-2.0+ ++++++ yast2-ntp-client-3.1.26.tar.bz2 -> yast2-ntp-client-3.1.27.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ntp-client-3.1.26/package/yast2-ntp-client.changes new/yast2-ntp-client-3.1.27/package/yast2-ntp-client.changes --- old/yast2-ntp-client-3.1.26/package/yast2-ntp-client.changes 2016-06-14 10:02:34.000000000 +0200 +++ new/yast2-ntp-client-3.1.27/package/yast2-ntp-client.changes 2016-07-06 17:21:41.000000000 +0200 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Thu Jun 30 06:51:52 UTC 2016 - jreidinger@suse.com + +- Fix regression: crash when reading cron entry failed + ( discovered by sap-ha module ) (bsc#977610, bsc#987064) +- 3.1.27 + +------------------------------------------------------------------- Tue Jun 14 06:54:54 UTC 2016 - kanderssen@suse.com - Fix handling of NTP records without comments (bsc#977610) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ntp-client-3.1.26/package/yast2-ntp-client.spec new/yast2-ntp-client-3.1.27/package/yast2-ntp-client.spec --- old/yast2-ntp-client-3.1.26/package/yast2-ntp-client.spec 2016-06-14 10:02:34.000000000 +0200 +++ new/yast2-ntp-client-3.1.27/package/yast2-ntp-client.spec 2016-07-06 17:21:41.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-ntp-client -Version: 3.1.26 +Version: 3.1.27 Release: 0 Summary: YaST2 - NTP Client Configuration License: GPL-2.0+ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ntp-client-3.1.26/src/modules/NtpClient.rb new/yast2-ntp-client-3.1.27/src/modules/NtpClient.rb --- old/yast2-ntp-client-3.1.26/src/modules/NtpClient.rb 2016-06-14 10:02:34.000000000 +0200 +++ new/yast2-ntp-client-3.1.27/src/modules/NtpClient.rb 2016-07-06 17:21:41.000000000 +0200 @@ -423,7 +423,7 @@ def ReadSynchronization crontab = SCR.Read(path(".cron"), @cron_file, "") log.info("NTP Synchronization crontab entry: #{crontab}") - cron_entry = crontab.fetch(0, {}).fetch("events", []).fetch(0, {}) + cron_entry = (crontab || []).fetch(0, {}).fetch("events", []).fetch(0, {}) @synchronize_time = cron_entry["active"] == "1" sync_interval_entry = cron_entry.fetch("minute", "*/#{DEFAULT_SYNC_INTERVAL}") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ntp-client-3.1.26/test/ntp_client_test.rb new/yast2-ntp-client-3.1.27/test/ntp_client_test.rb --- old/yast2-ntp-client-3.1.26/test/ntp_client_test.rb 2016-06-14 10:02:34.000000000 +0200 +++ new/yast2-ntp-client-3.1.27/test/ntp_client_test.rb 2016-07-06 17:21:41.000000000 +0200 @@ -337,7 +337,9 @@ subject.ReadSynchronization end - context "when there is no cron entry" do + context "when cron file does not exist" do + let(:cron_entry) { nil } + it "sets synchronize_time as false" do subject.ReadSynchronization @@ -351,17 +353,33 @@ end end - context "when there is cron entry" do - let(:cron_entry) { [{ "events" => [{ "active" => "1", "minute" => "*/10" }] }] } + context "when cron file exists" do + context "when there is no cron entry" do + it "sets synchronize_time as false" do + subject.ReadSynchronization + + expect(subject.synchronize_time).to eql(false) + end + + it "sets sync interval with default value" do + subject.ReadSynchronization - it "sets synchronize time as true if first cron entry is valid" do - expect(subject.ReadSynchronization).to eql(true) + expect(subject.sync_interval).to eql(Yast::NtpClientClass::DEFAULT_SYNC_INTERVAL) + end end - it "sets sync_interval with cron minute interval" do - subject.ReadSynchronization + context "when there is cron entry" do + let(:cron_entry) { [{ "events" => [{ "active" => "1", "minute" => "*/10" }] }] } + + it "sets synchronize time as true if first cron entry is valid" do + expect(subject.ReadSynchronization).to eql(true) + end + + it "sets sync_interval with cron minute interval" do + subject.ReadSynchronization - expect(subject.sync_interval).to eql(10) + expect(subject.sync_interval).to eql(10) + end end end end