Bug 158334

Summary: WinSync Console: Handling of logonHours and accountExpires incorrect.
Product: Red Hat Directory Server Reporter: Thomas E Lackey <tlackey>
Component: UI - ConfigurationAssignee: Rich Megginson <rmeggins>
Status: CLOSED CURRENTRELEASE QA Contact: Chandrasekar Kannan <ckannan>
Severity: medium Docs Contact:
Priority: low    
Version: 7.1CC: benl, dlackey, jgalipea, nhosoi, rmeggins
Target Milestone: DS8.1   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 8.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-29 22:57:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 249650, 493682    
Attachments:
Description Flags
diffs
none
never expires
none
expires with date
none
ADUtil.java
none
fixed diffs
none
more fixed diffs
none
new ADUtil.java
none
cvs commit log none

Description Thomas E Lackey 2005-05-20 16:53:56 UTC
Description of problem:

The handling of the logonHours and accountExpires attributes by the console is
incorrect.  David took a look, and assuming I relay this accurately, the console
is basing its time calculations off time_t while AD and the NT4 sync service
expect dates referenced off FILETIME.

How reproducible:
Always.

Steps to Reproduce:
1. Configure WinSync
2. Create a user and adjust their logon hours and account expiration on the
Windows side.
3. Open the DS console and use the wizards to view the values.  They will be
incorrect.
4. Change the values in the DS console.
5. Open the users in the Windows side and view those values.  They will be now
be incorrect.
  
Actual results:
The times input using the console are not accurate.

Expected results:
The times should match.

Additional info:
This is a problem in the way the console calculates the value and not a problem
in the DS's handling of the attributes.

Comment 1 Rich Megginson 2005-05-20 17:57:55 UTC
FILETIME is in 100's of nanoseconds since 1/1/1601.

Comment 7 Rich Megginson 2008-12-11 02:03:57 UTC
Created attachment 326572 [details]
diffs

Comment 8 Rich Megginson 2008-12-11 02:04:31 UTC
Created attachment 326573 [details]
never expires

Comment 9 Rich Megginson 2008-12-11 02:04:54 UTC
Created attachment 326574 [details]
expires with date

Comment 10 Rich Megginson 2008-12-11 02:08:10 UTC
Created attachment 326575 [details]
ADUtil.java

Comment 11 Rich Megginson 2008-12-16 20:46:04 UTC
Created attachment 327161 [details]
fixed diffs

Comment 12 Rich Megginson 2008-12-16 23:18:15 UTC
Created attachment 327182 [details]
more fixed diffs

Comment 13 Rich Megginson 2008-12-16 23:18:45 UTC
Created attachment 327183 [details]
new ADUtil.java

Comment 14 Rich Megginson 2008-12-16 23:32:40 UTC
Created attachment 327184 [details]
cvs commit log

Reviewed by: nhosoi (Thanks!)
Files: new file ADUtil.java
Fix Description: Added code to convert from Windows FILETIME to Java
time.  Added special handling for the "Never Expires" value, which can
be the very large value or 0.  The console now displays "Never Expires"
or the actual human readable value for the time.
As far as Logon Hours, it's just really messed up.  I will open another
bug for that.
https://bugzilla.redhat.com/attachment.cgi?id=326573 - never expires
https://bugzilla.redhat.com/attachment.cgi?id=326574 - expires with date
Platforms tested: RHEL5
Flag Day: no
Doc impact: yes

Comment 15 Jenny Severance 2009-02-27 15:19:27 UTC
I'm not sure what was really fixed here.  Can you be more specific?  It still seems pretty screwed up.  Thanks Jenny

Comment 16 Rich Megginson 2009-02-27 17:02:59 UTC
(In reply to comment #15)
> I'm not sure what was really fixed here.  Can you be more specific?  It still
> seems pretty screwed up.  Thanks Jenny

Account Expires handling should be correct now.  Logon Hours is still messed up - there is another bug for that (for a later release, not for this one).  So I guess for this bug, just verify that Account Expires is handled correctly.

Comment 17 Jenny Severance 2009-03-12 14:31:38 UTC
Account Expires -
Fix Verified DS 8.1 RHEL5 - Windows Synchronization 1.1.0

Comment 18 Chandrasekar Kannan 2009-04-29 22:57:48 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-0455.html