Bug 791485

Summary: rpm aaa_base 12.2-2.14.1 overwrites /etc/adjtime
Product: [openSUSE] openSUSE 12.2 Reporter: Giacomo Comes <comes>
Component: BasesystemAssignee: Ruediger Oertel <ro>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: forgotten_gp-dpinp5x, wbauer, werner
Version: Final   
Target Milestone: ---   
Hardware: PC   
OS: openSUSE 12.2   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: change /etc/adjtime only if $HWCLOCK is set

Description Giacomo Comes 2012-11-27 15:19:03 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0

last aaa_base update (12.2-2.14.1) overwrites the content of /etc/adjtime

To test the bug do:
Run: 'yast timezone' and uncheck Hardware Clock Set to UTC
verify that /etc/adjtime contains the line LOCAL.
Update to the latest aaa_base: zypper in --force aaa_base
Now check the content of /etc/adjtime
Instead of LOCAL you will find UTC.

Reproducible: Always

Steps to Reproduce:
1.set system time to LOCAL instead of UTC
2.update to the latest aaa_base
3.
Actual Results:  
system time is set to UTC

Expected Results:  
system time should remain as it was (LOCAL)
Comment 1 Wolfgang Bauer 2012-12-04 15:54:44 UTC
I encountered the same problem.

Every reinstallation of aaa_base (doesn't matter if from oss or update repo) changes the last line in /etc/adjtime from LOCAL to UTC.

This is caused by the following lines in the aaa_base.post script (starting at line 50):
    case "$HWCLOCK" in
    *-l*) sed -ri 's@^UTC$@LOCAL@' /etc/adjtime ;;
    *)	  sed -ri 's@^LOCAL$@UTC@' /etc/adjtime ;;
    esac

If $HWCLOCK is empty (which it always is because right before that HWCLOCK is removed from /etc/sysconfig/clock), the second case * matches and LOCAL will be replaced with UTC.

AFAICS the aaa_base package in Factory also contains this bug.
Comment 2 Arvin Schnell 2013-01-07 09:16:53 UTC
*** Bug 796691 has been marked as a duplicate of this bug. ***
Comment 3 Wolfgang Bauer 2013-01-29 15:27:25 UTC
Created attachment 522463 [details]
change /etc/adjtime only if $HWCLOCK is set

This bug is still there in openSUSE 12.3 Beta 1.

I have attached a patch that fixes this issue.

Could someone please apply this, or should I create a submit request against Base:System?
Comment 4 Ruediger Oertel 2013-02-06 11:42:11 UTC
werner: as you have been working on this ... any statement ?
Comment 5 Dr. Werner Fink 2013-02-06 12:24:57 UTC
The patch is correct, added with submit request #151456
Comment 6 Bernhard Wiedemann 2013-02-06 13:00:07 UTC
This is an autogenerated message for OBS integration:
This bug (791485) was mentioned in
https://build.opensuse.org/request/show/151456 Factory / aaa_base
Comment 7 Ruediger Oertel 2013-02-06 13:58:32 UTC
closing bug, thanks
Comment 8 Wolfgang Bauer 2013-02-08 15:18:00 UTC
Thank you!

But since this bug was reported against 12.2 and it is not fixed there, I am going to reopen this.

Could you please provide an online update with this fix?
Comment 9 Wolfgang Bauer 2013-05-27 17:02:51 UTC
Well, since nobody seems to care about this (for 12.2, that is), I am willing to prepare the online update.

@Mr Maintenance: Is it ok if I submit a fixed package to openSUSE:12.2:Update?
Comment 10 Benjamin Brunner 2013-05-28 08:50:03 UTC
Wolfgang, thanks for your efforts! Could you open a maintenancerequest with the updated package, please?
Comment 11 Wolfgang Bauer 2013-05-28 09:44:13 UTC
Done, MR#176837
Comment 12 Bernhard Wiedemann 2013-05-28 10:00:36 UTC
This is an autogenerated message for OBS integration:
This bug (791485) was mentioned in
https://build.opensuse.org/request/show/176835 Maintenance / aaa_base
https://build.opensuse.org/request/show/176837 Maintenance /
Comment 13 Benjamin Brunner 2013-06-05 03:56:45 UTC
Update released for openSUSE 12.2. Resolved fixed.
Comment 14 Swamp Workflow Management 2013-06-05 04:04:44 UTC
openSUSE-RU-2013:0863-1: An update that has one recommended fix can now be installed.

Category: recommended (low)
Bug References: 791485
CVE References: 
Sources used:
openSUSE 12.2 (src):    aaa_base-12.2-2.18.1