Bug 9810 - validate_ldb of String(Generalized-Time) does not accept millisecond format ".000Z"
Summary: validate_ldb of String(Generalized-Time) does not accept millisecond format "...
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: AD: LDB/DSDB/SAMDB (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: 4.3
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
: 10709 (view as bug list)
Depends on:
Blocks: 10077
  Show dependency treegraph
 
Reported: 2013-04-18 14:43 UTC by Arvid Requate
Modified: 2015-01-28 22:33 UTC (History)
7 users (show)

See Also:


Attachments
Patch courtesy of http://www.snix.com/wiki/index.php/Samba_4 (1.48 KB, patch)
2013-04-18 14:45 UTC, Arvid Requate
no flags Details
Patches for v4-2-test (64.22 KB, patch)
2015-01-25 16:22 UTC, Stefan Metzmacher
metze: review? (abartlet)
asn: review+
gd: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate 2013-04-18 14:43:57 UTC
A Windows 2008 R2 Terminal Server License Server (configured for "per User" CALs) is not able to save the msTSExpireDate (<http://msdn.microsoft.com/en-us/library/cc220557.aspx>) attribute on the user object in S4.

System eventlog shows the event 4105 at user login:
The Terminal Services license server cannot update the license attributes for user “<UserName>” in Active Directory Domain “<DomainName>”
<http://support.microsoft.com/kb/2030310/en-us>


log.samba shows the following modify for the user logging in:

  ldb: ldb_trace_request: MODIFY
  dn: CN=testuser1,CN=Users,DC=foo,DC=bar
  changetype: modify
  replace: msTSManagingLS
  msTSManagingLS: 00486-237-9937597-84351
  -
  replace: msTSLicenseVersion
  msTSLicenseVersion: 393216
  -
  replace: msTSExpireDate
  msTSExpireDate: 20130616160028.000Z
  -


   control: 1.2.840.113556.1.4.1413  crit:0  data:no
   control: 1.3.6.1.4.1.7165.4.3.17  crit:0  data:no


Running into the following error validating/normalizing the value for msTSExpireDate:

  ldb: ldb_asprintf/set_errstring: objectclass_attrs: attribute 'msTSExpireDate' on entry 'CN=butzer,CN=Users,DC=s4lish,DC=qa' contains at least one invalid value!


It looks like the function "ldb_val_to_time" (lib/ldb/common/ldb_msg.c) does not recognize the .000Z time format.
Comment 1 Arvid Requate 2013-04-18 14:45:32 UTC
Created attachment 8784 [details]
Patch courtesy of http://www.snix.com/wiki/index.php/Samba_4
Comment 2 Robert Trebula 2014-03-20 08:31:20 UTC
I also have this problem. We get event 4105 from Terminal Services Licencing service on Windows Server 2012 R2. Our AD is:
# samba --version
Version 4.1.4-Debian
Comment 3 Robert Trebula 2014-03-24 16:09:19 UTC
I can confirm that the attached patch fixes the issue for me.
 
Side note: I am running debian-jessie version of samba here and I had to apply the patch to ldb package not samba package. They both contain ldb_msg.c but I found out (the hard way) that the one in the samba package is not used. I don't know if this matters upstream or not.

Thank you,
Robert
Comment 4 Björn Jacke 2014-07-24 11:51:04 UTC
*** Bug 10709 has been marked as a duplicate of this bug. ***
Comment 5 Marc Muehlfeld 2014-07-28 17:15:16 UTC
Where in the sources are the torture tests for existing date formats located? I want to have a look at it. Maybe I can adapt an existing test to this new format without much knowledge, to get this patch into the official version quickly. :-)
Comment 6 Stefan Metzmacher 2014-07-28 18:43:37 UTC
(In reply to comment #5)
> Where in the sources are the torture tests for existing date formats located? I
> want to have a look at it. Maybe I can adapt an existing test to this new
> format without much knowledge, to get this patch into the official version
> quickly. :-)

lib/ldb/tests/python/api.py or lib/ldb/tests/schema-tests/schema-add-test.ldif,
but "git grep '\.0Z' source4/dsdb/tests/" shows nothing.
Comment 7 Karolin Seeger 2014-11-27 10:53:50 UTC
Is this a showstopper for 4.2.0?
Comment 8 Björn Jacke 2014-11-27 11:40:17 UTC
no regression, no blocker
Comment 9 Stefan Metzmacher 2015-01-25 16:22:53 UTC
Created attachment 10662 [details]
Patches for v4-2-test
Comment 10 Andreas Schneider 2015-01-26 12:24:03 UTC
Karolin, please add the patch to 4.2. Thanks!
Comment 11 Karolin Seeger 2015-01-26 20:08:26 UTC
Pushed to autobuild-v4-2-test.
Comment 12 Stefan Metzmacher 2015-01-28 22:33:53 UTC
Pushed to v4-2-test.
Closing out bug report.

Thanks!