Description of problem: Using the properties dialog it is possible to set a date of when a user's account is due to expire, this date is not stored as date input + 1. Version-Release number of selected component (if applicable): 1.2.60 How reproducible: Every time Steps to Reproduce: 1.As a none root user open the system-config-user utility - enter root password when prompted. 2.Select any user from the list, in my case the user is called ray. 3.Click the properties button and select the 'Account Info' tab. 4.Check the 'Enable account expiration' checkbox. 5.Enter the date as 2008 03 29 and press OK. 6.Re-open the properties dialog and navigate to the 'Account Info' tab. Actual results: The date gets re-displayed as 2008 03 30. Expected results: The date should be re-displayed as entered. i.e. 2008 03 29 Additional info: Every time you re-open the properties dialog and press ok the date increments by one.
I couldn't reproduce this on system-config-users-1.2.61. Would you please check this with the version from updates-testing? Thanks.
I have installed system-config-users-1.2.61 from the update-testing repo. I did this using the following command: yum --enablerepo=updates-testing install system-config-users This installed version 1.2.61-1.fc7, I followed the steps above and the date was still incremented by one everytime I re-opened the properties dialog. I have recorded my actions into an avi file, accessible from: http://homepage.ntlworld.com/ray.hammond/fedora/fedora7/Fedora-Bug-251760.avi Hope it helps. Also could the problem be related to my timezone? I am currenlty in Bristish Summer Time (BST)
Hmm, I can't see the video either, but that may be a problem here. I don't think the timezone is a problem, I'm in CEST (UTC+2) now, but setting TZ=Europe/London and running s-c-users didn't result in what you described. - Are all other packages on the system updated? - After setting the expiration date to 2008-03-29, what is the 8th (second to last) field in /etc/shadow for that user?
Sorry about the video, only works in MS Media player (whoops!). . I have installed FC7 again and performed a full yum update. ("yum update -y") I now have version 1.2.60 of system-config-users. By default /etc/shadow contains the following: rhh:$1$/QBT94Ih$P6YV1/Nh7VJZqyWtWP6mY0:13733:0:99999:7::: After following the steps 1 to 5 /etc/shadow contains: rhh:$1$/QBT94Ih$P6YV1/Nh7VJZqyWtWP6mY0:13733:0:99999:7::14698: After re-opening the properties dialog and pressing OK /etc/shadow contains the following: rhh:$1$/QBT94Ih$P6YV1/Nh7VJZqyWtWP6mY0:13733:0:99999:7::14699: After a little bit of digging I've traced my problem to: /usr/share/system-config-users/userProperties.py This file is shipped with the system-config-users rpm (you certainly know that already). Line 219, the ‘if’ statement, which is related to the expiration setting and its nested statements are as follows: if int(expire[0]) != -1: self.accountExpireCheck.set_active(True) days = int(self.userEnt.get(libuser.SHADOWEXPIRE)[0] +1) tmp = days * int(secondsPerDay) age = time.localtime(tmp) year = str(age[0]) month = str(age[1]) day = str(age[2]) self.accountMonthEntry.set_text(month) self.accountDayEntry.set_text(day) self.accountYearEntry.set_text(year) Check out the following line (extracted from above). days = int(self.userEnt.get(libuser.SHADOWEXPIRE)[0] +1) Why plus one? If I put the following line in ‘print days’, after the offending line, sure enough the debug shows that the days variable is increased by one every time. I then removed the plus one section of code i.e. days = int(self.userEnt.get(libuser.SHADOWEXPIRE)[0]) The ‘days’ variable remained the same (correct value) in the /etc/shadow file and utility. Hope that helps a little.
Oh. That's some scary code you've dug up there. I can now reproduce the problem and it is indeed dependent on the timezone that's set. It's kind of a rounding error where it (hah!) sometimes subtracts 1 from the calculated number of days when storing and sometimes not. When loading the value (which is "days since beginning of the epoch", i.e. since 1970-01-01), it is incremented by 1, compensating for the subtraction that happened -- or not.
system-config-users-1.2.64 keeps the expiration date stable, it should hit updates-testing soon.
system-config-users-1.2.64-1.fc7 has been pushed to the Fedora 7 testing repository. If problems still persist, please make note of it in this bug report.
system-config-users-1.2.64-1.fc7 has been pushed to the Fedora 7 stable repository. If problems still persist, please make note of it in this bug report.