RE: prefixMap refactoring

View: New views
9 Messages — Rating Filter:   Alert me  

RE: prefixMap refactoring

by Kamen Mazdrashki :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Here is another portion of patches for prefixMap.
I think I am almost done with this (finally).

There are few things to be done shortly:
- clean up the code from unused functions and structures;
- refactor code against Samba-Coding-Style guide
  (thanks Metze for pointing that out)

All the patches could be found in a git repo also:
http://repo.or.cz/w/Samba/kamenim.git?a=shortlog;h=refs/heads/drsuapi_prefixmap_wip

Please comment.


BR,
Kamen Mazdrashki
kamen.mazdrashki@...
http://repo.or.cz/w/Samba/kamenim.git
-------------------------------------
CISCO SYSTEMS BULGARIA EOOD
http://www.cisco.com/global/BG/


































0001-s4-ldb-Fix-double-allocation-for-ldb_url.patch (1K) Download Attachment
0002-s4-drs-Fix-memory-leek-in-prefixMap.patch (1K) Download Attachment
0003-s4-drs-Move-making-of-partial-binary-oid-to-a-separ.patch (4K) Download Attachment
0004-s4-drs-Implement-binary-oid-lookup-into-prefixMap.patch (4K) Download Attachment
0005-s4-drs-tort-implement-prefixMap-comparison-functio.patch (3K) Download Attachment
0006-s4-drs-tort-test-for-schema_prefixMap-to-from-drsu.patch (4K) Download Attachment
0007-s4-drs-schema_prefixMap-to-from-drsuapi_prefixMap-c.patch (9K) Download Attachment
0008-s4-drs-Move-schema_prefixMap-allocation-in-separate.patch (4K) Download Attachment
0009-s4-Add-DRS-UNIT-test-suite-to-LOCAL-group-of-tests.patch (1006 bytes) Download Attachment
0010-s4-DRS-RPC-tests-added-to-RPC-group-of-tests.patch (1K) Download Attachment
0011-s4-drs-dsdb_schema-uses-dsdb_schema_prefixmap-defin.patch (1K) Download Attachment
0012-s4-drs-dsdb_load_oid_mappings_drsuapi-dsdb_loa.patch (6K) Download Attachment
0013-s4-drs-dsdb_get_oid_mappings_drsuapi-to-use-new-p.patch (3K) Download Attachment
0014-s4-drs-dsdb_verify_oid_mappings_drsuapi-replaced.patch (6K) Download Attachment
0015-s4-drs-dsdb_map_oid2int-replaced-by-dsdb_schema_p.patch (7K) Download Attachment
0016-s4-drs-dsdb_map_int2oid-replaced-by-dsdb_schema_p.patch (7K) Download Attachment
0017-s4-drs-dsdb_schema_pfm_from_drsuapi_pfm-to-accept.patch (8K) Download Attachment
0018-s4-drs-tort-prefixMap-to-from-ldb_val-serializatio.patch (5K) Download Attachment
0019-s4-drs-dsdb_load_prefixmap_from_drsuapi-fix.patch (1K) Download Attachment
0020-s4-drs-Load-prefixMap-from-ldb_val-moved-in-separat.patch (2K) Download Attachment
0021-s4-drs-refactor-dsdb_load_oid_mappings_ldb-to-use.patch (4K) Download Attachment
0022-s4-drs-tort-Create-temporary-LDB-for-testing-purpo.patch (4K) Download Attachment
0023-s4-drs-tort-prefixMap-read-write-in-LDB-test-case.patch (4K) Download Attachment
0024-s4-drs-dsdb_read_prefixes_from_ldb-refactored.patch (5K) Download Attachment
0025-s4-drs-dsdb_write_prefixes_from_schema_to_ldb-ref.patch (4K) Download Attachment
0026-s4-drs-tort-refactor-SCHEMA_INFO_DEFAULT-defined.patch (6K) Download Attachment
0027-s4-drs-prefixMap-lookup-by-full_OID-implementation.patch (1K) Download Attachment
0028-s4-drs-tort-Test-case-for-dsdb_create_prefix_mappi.patch (6K) Download Attachment
0029-s4-drs-dsdb_create_prefix_mapping-refactored.patch (4K) Download Attachment
0030-s4-drs-bugfix-memory-should-be-allocated-in-local.patch (1K) Download Attachment
0031-s4-drs-tort-_torture_drs_pfm_compare_same-should.patch (8K) Download Attachment
0032-s4-drs-remove-unused-num_prefixes-and-prefixes-from.patch (3K) Download Attachment

Parent Message unknown RE: prefixMap refactoring

by Kamen Mazdrashki :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Please find attached patches to completely refactor prefixMap
implementation.
'make test' passes - i.e. it fails the same way when 'make test'
is run on current master.
I am now running 'make lcov' tests - hope that test coverage
has increased by at least a 1% (actually I hope it is more than that).
Next is to run simple 'net vampire' test against w2k3 with Exchange
installed - this test doesn't pass currently as prefixMap contains
few partial-OIDs.


All the patches could be found in a git repo also:
http://repo.or.cz/w/Samba/kamenim.git?a=shortlog;h=refs/heads/drsuapi_prefixmap_wip


Cheers,
Kamen Mazdrashki
kamen.mazdrashki@...
http://repo.or.cz/w/Samba/kamenim.git
-------------------------------------
CISCO SYSTEMS BULGARIA EOOD
http://www.cisco.com/global/BG/



prefixmap-wip.tar.gz (33K) Download Attachment

Parent Message unknown RE: prefixMap refactoring

by Kamen Mazdrashki :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Oct 29, 2009 at 23:36, Kamen Mazdrashki <kamen.mazdrashki@...> wrote:
> Please find attached patches to completely refactor prefixMap
> implementation.
> 'make test' passes - i.e. it fails the same way when 'make test'
> is run on current master.
> I am now running 'make lcov' tests - hope that test coverage
> has increased by at least a 1% (actually I hope it is more than that).
I've tried several times to run 'make lcov' - no coverage data
is produced. Neither with my branch nor with the 'master'. Am I doing
something wrong or 'make lcov' does not produce data if 'make test' fails?
 
> Next is to run simple 'net vampire' test against w2k3 with Exchange
> installed - this test doesn't pass currently as prefixMap contains
> few partial-OIDs.
Same thing here too. I've tried it several times - both with my
dev branch and 'master' -> no success. 'net vampire' fails when it
comes to apply schema as it seems to me.
You may find d6 log at: http://pastebin.com/m318670c7


Once again:
All the patches could be found in a git repo also:
http://repo.or.cz/w/Samba/kamenim.git?a=shortlog;h=refs/heads/drsuapi_prefixmap_wip
I am also attaching all the patches, gzipped, here too.
So please review.

Thanks,
Kamen Mazdrashki
kamen.mazdrashki@...
http://repo.or.cz/w/Samba/kamenim.git
-------------------------------------
CISCO SYSTEMS BULGARIA EOOD
http://www.cisco.com/global/BG/


> -----Original Message-----
> From: Kamen Mazdrashki
> Sent: Thursday, October 29, 2009 11:36 PM
> To: Kamen Mazdrashki; samba-technical@...
> Cc: metze@...; tridge@...; abartlet@...; Anatoliy
> Atanasov
> Subject: RE: prefixMap refactoring
>
> Hi,
>
> Please find attached patches to completely refactor prefixMap
> implementation.
> 'make test' passes - i.e. it fails the same way when 'make test'
> is run on current master.
> I am now running 'make lcov' tests - hope that test coverage has
> increased by at least a 1% (actually I hope it is more than that).
> Next is to run simple 'net vampire' test against w2k3 with Exchange
> installed - this test doesn't pass currently as prefixMap contains few
> partial-OIDs.
>
>
> All the patches could be found in a git repo also:
> http://repo.or.cz/w/Samba/kamenim.git?a=shortlog;h=refs/heads/drsuapi_p
> refixmap_wip
>
>
> Cheers,
> Kamen Mazdrashki
> kamen.mazdrashki@...
> http://repo.or.cz/w/Samba/kamenim.git
> -------------------------------------
> CISCO SYSTEMS BULGARIA EOOD
> http://www.cisco.com/global/BG/


RE: prefixMap refactoring

by Andrew Bartlett :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, 2009-10-31 at 00:22 +0200, Kamen Mazdrashki wrote:

> On Thu, Oct 29, 2009 at 23:36, Kamen Mazdrashki <kamen.mazdrashki@...> wrote:
> > Please find attached patches to completely refactor prefixMap
> > implementation.
> > 'make test' passes - i.e. it fails the same way when 'make test'
> > is run on current master.
> > I am now running 'make lcov' tests - hope that test coverage
> > has increased by at least a 1% (actually I hope it is more than that).
> I've tried several times to run 'make lcov' - no coverage data
> is produced. Neither with my branch nor with the 'master'. Am I doing
> something wrong or 'make lcov' does not produce data if 'make test' fails?
>  
> > Next is to run simple 'net vampire' test against w2k3 with Exchange
> > installed - this test doesn't pass currently as prefixMap contains
> > few partial-OIDs.
> Same thing here too. I've tried it several times - both with my
> dev branch and 'master' -> no success. 'net vampire' fails when it
> comes to apply schema as it seems to me.
> You may find d6 log at: http://pastebin.com/m318670c7
The error codes without a string form typically come from the Windows
side.  You should see about extending the NTSTATUS map in the same way
you extended the Windows error map.

That might give you a clue as to the server-side error.

Andrew Bartlett

--
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Cisco Inc.



signature.asc (196 bytes) Download Attachment

RE: prefixMap refactoring

by Andrew Bartlett :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, 2009-10-31 at 00:22 +0200, Kamen Mazdrashki wrote:

> On Thu, Oct 29, 2009 at 23:36, Kamen Mazdrashki <kamen.mazdrashki@...> wrote:
> > Please find attached patches to completely refactor prefixMap
> > implementation.
> > 'make test' passes - i.e. it fails the same way when 'make test'
> > is run on current master.
> > I am now running 'make lcov' tests - hope that test coverage
> > has increased by at least a 1% (actually I hope it is more than that).
> I've tried several times to run 'make lcov' - no coverage data
> is produced. Neither with my branch nor with the 'master'. Am I doing
> something wrong or 'make lcov' does not produce data if 'make test' fails?
Honestly, I'm not sure.

> > Next is to run simple 'net vampire' test against w2k3 with Exchange
> > installed - this test doesn't pass currently as prefixMap contains
> > few partial-OIDs.
> Same thing here too. I've tried it several times - both with my
> dev branch and 'master' -> no success. 'net vampire' fails when it
> comes to apply schema as it seems to me.
> You may find d6 log at: http://pastebin.com/m318670c7

That error is interesting:

NT code 0xc00020e0
(from MS-ERREF):
0x000020E0                     Failed to obtain the required syntax for
the
ERROR_DS_ATT_SCHEMA_REQ_SYNTAX attribute schema.

I wonder why the remote server doesn't like us?

Andrew Bartlett

--
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Cisco Inc.



signature.asc (196 bytes) Download Attachment

Re: prefixMap refactoring

by Stefan (metze) Metzmacher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Andrew Bartlett schrieb:

> On Sat, 2009-10-31 at 00:22 +0200, Kamen Mazdrashki wrote:
>> On Thu, Oct 29, 2009 at 23:36, Kamen Mazdrashki <kamen.mazdrashki@...> wrote:
>>> Please find attached patches to completely refactor prefixMap
>>> implementation.
>>> 'make test' passes - i.e. it fails the same way when 'make test'
>>> is run on current master.
>>> I am now running 'make lcov' tests - hope that test coverage
>>> has increased by at least a 1% (actually I hope it is more than that).
>> I've tried several times to run 'make lcov' - no coverage data
>> is produced. Neither with my branch nor with the 'master'. Am I doing
>> something wrong or 'make lcov' does not produce data if 'make test' fails?
>
> Honestly, I'm not sure.
>
>>> Next is to run simple 'net vampire' test against w2k3 with Exchange
>>> installed - this test doesn't pass currently as prefixMap contains
>>> few partial-OIDs.
>> Same thing here too. I've tried it several times - both with my
>> dev branch and 'master' -> no success. 'net vampire' fails when it
>> comes to apply schema as it seems to me.
>> You may find d6 log at: http://pastebin.com/m318670c7
>
> That error is interesting:
>
> NT code 0xc00020e0
> (from MS-ERREF):
> 0x000020E0                     Failed to obtain the required syntax for
> the
> ERROR_DS_ATT_SCHEMA_REQ_SYNTAX attribute schema.
Isn't that a local error?

metze



signature.asc (268 bytes) Download Attachment

Re: prefixMap refactoring

by Andrew Bartlett :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 2009-11-03 at 11:56 +0100, Stefan (metze) Metzmacher wrote:

> Andrew Bartlett schrieb:
> > On Sat, 2009-10-31 at 00:22 +0200, Kamen Mazdrashki wrote:
> >> On Thu, Oct 29, 2009 at 23:36, Kamen Mazdrashki <kamen.mazdrashki@...> wrote:
> >>> Please find attached patches to completely refactor prefixMap
> >>> implementation.
> >>> 'make test' passes - i.e. it fails the same way when 'make test'
> >>> is run on current master.
> >>> I am now running 'make lcov' tests - hope that test coverage
> >>> has increased by at least a 1% (actually I hope it is more than that).
> >> I've tried several times to run 'make lcov' - no coverage data
> >> is produced. Neither with my branch nor with the 'master'. Am I doing
> >> something wrong or 'make lcov' does not produce data if 'make test' fails?
> >
> > Honestly, I'm not sure.
> >
> >>> Next is to run simple 'net vampire' test against w2k3 with Exchange
> >>> installed - this test doesn't pass currently as prefixMap contains
> >>> few partial-OIDs.
> >> Same thing here too. I've tried it several times - both with my
> >> dev branch and 'master' -> no success. 'net vampire' fails when it
> >> comes to apply schema as it seems to me.
> >> You may find d6 log at: http://pastebin.com/m318670c7
> >
> > That error is interesting:
> >
> > NT code 0xc00020e0
> > (from MS-ERREF):
> > 0x000020E0                     Failed to obtain the required syntax for
> > the
> > ERROR_DS_ATT_SCHEMA_REQ_SYNTAX attribute schema.
>
> Isn't that a local error?
Given we don't have a #define for the error, I was presuming it could
not have come from Samba code.

Andrew Bartlett

--
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Cisco Inc.



signature.asc (196 bytes) Download Attachment

Re: prefixMap refactoring

by Kamen Mazdrashki-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Nov 4, 2009 at 00:23, Andrew Bartlett <abartlet@...> wrote:

> On Tue, 2009-11-03 at 11:56 +0100, Stefan (metze) Metzmacher wrote:
>> Andrew Bartlett schrieb:
>> > On Sat, 2009-10-31 at 00:22 +0200, Kamen Mazdrashki wrote:
>> >> On Thu, Oct 29, 2009 at 23:36, Kamen Mazdrashki <kamen.mazdrashki@...> wrote:
>> >>> Next is to run simple 'net vampire' test against w2k3 with Exchange
>> >>> installed - this test doesn't pass currently as prefixMap contains
>> >>> few partial-OIDs.
>> >> Same thing here too. I've tried it several times - both with my
>> >> dev branch and 'master' -> no success. 'net vampire' fails when it
>> >> comes to apply schema as it seems to me.
>> >> You may find d6 log at: http://pastebin.com/m318670c7
>> >
>> > That error is interesting:
>> >
>> > NT code 0xc00020e0
>> > (from MS-ERREF):
>> > 0x000020E0                     Failed to obtain the required syntax for
>> > the
>> > ERROR_DS_ATT_SCHEMA_REQ_SYNTAX attribute schema.
>>
>> Isn't that a local error?
It is us to return this error.
It happens because
dsdb_attribute_from_drsuapi()->dsdb_schema_setup_ldb_schema_attribute()
fails to find the attribute (attr->syntax->ldb_syntax is NULL).
Attribute is (it is an Exchange attribute):
  cn = "ms-Exch-Auth-Orig",
  lDAPDisplayName = "authOrig",
  attributeID_oid = "1.2.840.113556.1.2.129",
  attributeSyntax_oid = "2.5.5.7",
  oMSyntax = 127,

I guess it is because we don't have it described in:
  schema_syntax.c: dsdb_syntaxes[]

Metze, do I just need to add Exchange syntaxes in dsdb_syntaxes[] map?

>
> Given we don't have a #define for the error, I was presuming it could
> not have come from Samba code.
>
We don't have #define for this error because it is a WERROR code, while
libnet_BecomeDC() is expected to return NTSTATUS.
I will figure out that tomorrow though. It should be translated to an
NTSTATUS error code right (although I am not sure this WERROR could
be mapped to an NTSTATUS without information loss).

Oh, forgot to mention -> I am debugging this 'drsuapi_prefixmap_wip'
branch merged.


CU,
Kamen Mazdrashki
kamen.mazdrashki@...
http://repo.or.cz/w/Samba/kamenim.git
-------------------------------------
CISCO SYSTEMS BULGARIA EOOD
http://www.cisco.com/global/BG/

Re: prefixMap refactoring

by Stefan (metze) Metzmacher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Kamen Mazdrashki schrieb:

> On Wed, Nov 4, 2009 at 00:23, Andrew Bartlett <abartlet@...> wrote:
>> On Tue, 2009-11-03 at 11:56 +0100, Stefan (metze) Metzmacher wrote:
>>> Andrew Bartlett schrieb:
>>>> On Sat, 2009-10-31 at 00:22 +0200, Kamen Mazdrashki wrote:
>>>>> On Thu, Oct 29, 2009 at 23:36, Kamen Mazdrashki <kamen.mazdrashki@...> wrote:
>>>>>> Next is to run simple 'net vampire' test against w2k3 with Exchange
>>>>>> installed - this test doesn't pass currently as prefixMap contains
>>>>>> few partial-OIDs.
>>>>> Same thing here too. I've tried it several times - both with my
>>>>> dev branch and 'master' -> no success. 'net vampire' fails when it
>>>>> comes to apply schema as it seems to me.
>>>>> You may find d6 log at: http://pastebin.com/m318670c7
>>>> That error is interesting:
>>>>
>>>> NT code 0xc00020e0
>>>> (from MS-ERREF):
>>>> 0x000020E0                     Failed to obtain the required syntax for
>>>> the
>>>> ERROR_DS_ATT_SCHEMA_REQ_SYNTAX attribute schema.
>>> Isn't that a local error?
> It is us to return this error.
> It happens because
> dsdb_attribute_from_drsuapi()->dsdb_schema_setup_ldb_schema_attribute()
> fails to find the attribute (attr->syntax->ldb_syntax is NULL).
> Attribute is (it is an Exchange attribute):
>   cn = "ms-Exch-Auth-Orig",
>   lDAPDisplayName = "authOrig",
>   attributeID_oid = "1.2.840.113556.1.2.129",
>   attributeSyntax_oid = "2.5.5.7",
>   oMSyntax = 127,
>
> I guess it is because we don't have it described in:
>   schema_syntax.c: dsdb_syntaxes[]
>
> Metze, do I just need to add Exchange syntaxes in dsdb_syntaxes[] map?
Could be... However I thought we have already all of them in the map,
but don't implement all of them.

All attributeSyntax 2.5.5.7 and oMSyntax: 127 have a oMObjectClass to
identify the exact syntax. Maybe windows sets this automaticly if not
given...

metze



signature.asc (268 bytes) Download Attachment