[SCM] Samba Shared Repository - branch master updated

Andrew Tridgell tridge at samba.org
Thu Jan 7 19:27:16 MST 2010


The branch, master has been updated
       via  5ccf8ae... s4-samba3samtest: we need to force netbios name as well
       via  dde2b66... s4-samba3sid: fixed error returns when res->count != 1 and oom
       via  9aed099... s4-samba3samtest: force workgroup so the domain is right
       via  f68c43e... s4-samba3sid: the sambaNextRid attribute is actually the previous RID
       via  d6f92db... s4-samba3sam: use samba3sid module
       via  dd61336... s4-dsdb: added a samba3sid module
       via  66f161d... s4-acl: fixed acl.py test to use correct ldif
       via  81c0b01... s4-secdesc: fixed the sec_descriptor.py test
       via  43a815c... s4-samba3samtest: use system credentials for creating users
       via  8b8bb15... s4-dsdb: fixed const misuse in acl module
       via  baa8793... s4-dsdb: use dsdb_module_am_system() in acl module
       via  595fad2... s4-dsdb: allow specification of a SID if we are system
       via  f118f54... s4-dsdb: added dsdb_module_am_system()
       via  d22a9e5... s4-dsdb: squash some unknown structure warnings
       via  5d6032e... s4-partition: fixed selection of partitions on exact match
       via  59f314d... s4-scripting: we need to use a base search for the NTDS GUID
       via  501dd4a... s4:dsdb/repl: convert dreplsrv_op_pull_source_send/recv to tevent_req
       via  278d2f7... s4-smbd: setup the default event contexts for other process models
       via  5803253... s4-drs: we need to wrap extended operations in transactions
       via  2d10f3a... s4-dsdb: poke the RID Manager when completely out of RIDs too
       via  a65823e... s4-dsdb: ensure we will in all the attributes for RID Set
       via  308a479... s4-dsdb: added DSDB_FLAG_TOP_MODULE
       via  5f36f03... s4-dsdb: no longer need special invocationID handling for standalone servers
       via  a7fffe8... s4-provision: do a self join for all server types
       via  f6cf895... s4-schema: added generic attributeID conversion functions
       via  f7517e6... s4-schema: added dsdb_attribute_by_lDAPDisplayName_ldb_val
       via  cd65ce8... s4-schema: make ldb_val to string comparison safer with nul termination
       via  ff968e4... s4-idl: regenerate DRS IDL
       via  4c7bf05... s4-idl: added some more wellknown attributeIDs
       via  3352e5d... s4/dsdb_schema: Load msDS-IntId value separately when loading from LDB
       via  2523811... Revert "s4-schema: Set ATTID in schema cache from "msDS-IntId""
       via  6247a13... s4/schema: Do not assign msDS-IntId value if LDB_CONTROL_RELAX_OID is passed
       via  73838b3... s4-libnet: better error messages in libnet_vampire.c
       via  9871f52... s4/dsdb_schema: use msDS-IntId value for attribute look-up
       via  a44ae10... s4/dsdb_schema: fetch msDS-IntId value during SCHEMA replication
       via  a7b3891... s4/dsdb_schema: GET_UINT32_DS() macro to use supplied default value instead of 0
       via  f7756c8... s4-partition: don't ignore errors from other modules
       via  9672a3d... s4-devel: a useful script to setup bin/ and st/ as tmpfs filesystems
       via  1f25d0a... s4-provision: re-open sam.ldb after creating the schema
       via  42f0bda... s4-provision: RID 1000 is consumed by the machine account
       via  fdf12a6... s4-ldb: improve error handling in indexing code
       via  c4fa4d1... s4-dsdb: improve error messages in schema and pdc_fsmo modules
       via  ac5d426... s4-drs: added some debug messages
       via  dcbba58... s4-event: added s4_event_context_set_default()
       via  f254091... s4-dsdb: added support for DRSUAPI_EXOP_FSMO_RID_ALLOC
       via  b1f97b7... s4-dsdb: added an extended operation for allocating a new RID pool
       via  2590b77... s4-repl: implement MSG_DREPL_ALLOCATE_RID
       via  cc7967b... s4-repl: allow for callbacks when a repl operation completes
       via  7a40cac... s4-dsdb: the dsdb ldb modules now need messagiing
       via  dc11414... s4-dsdb: send a message to the drepl task when we need another RID pool
       via  805ab0e... s4-messaging: added a new msg type MSG_DREPL_ALLOCATE_RID
       via  19e515a... s4-repl: added request for RID allocation in drepl task
       via  8cd2bed... s4-dsdb: added dsdb_find_guid_attr_by_dn()
       via  37340d5... s4-ridalloc: copy with missing rIDNextRid and rIDAllocationPool
       via  45550f8... s4-dsdb: added dsdb_module_set_integer()
       via  c12b9ab... s4-dsdb: clarify who is responsible for each attribute
       via  dd8cb3c... s4-dsdb: fixed usage of rIDAllocationPool and rIDPreviousAllocationPool
       via  5136438... s4-dsdb: implement refresh of RID Set pool for a local RID Manager
       via  53d10d1... s4-provision: don't hard wire the creation of the RID Set object
       via  1053ce5... s4-dsdb: implement creation of the RID Set object
       via  439ee5a... s4-dsdb: use dsdb_next_callback()
       via  d0bd6e7... s4-dsdb: added dsdb_next_callback()
       via  e6f14ac... s4-dsdb: added dsdb_module_constrainted_update_integer()
       via  f240110... s4-dsdb: added dsdb_module_reference_dn()
       via  f137f93... s4-dsdb: added dsdb_module_add()
       via  fcfb5d7... s4-provision: allow provision modifies to add records
       via  226460d... s4-dsdb: move the RID allocation logic into ridalloc.c
       via  7f90a05... s4-samldb: use RID Set to allocate user/group RIDs
       via  5eb3b91... s4-provision: the DC object itself needs a fixed objectSID
       via  2bad107... s4-dsdb: added samdb_rid_set_dn()
       via  a136249... s4-provision: added an initial RID Set
       via  bd6d0e9... s4-ldb: added nice ldif display of 64 bit ranges for RIDs
       via  fbc3a0f... s4-dsdb: added samdb_reference_dn()
      from  c915bd8... linked_attributes: Fix missing dependency on util.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 5ccf8ae37385bd401910e7c31c63fad43dcc89ae
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Jan 8 12:55:21 2010 +1100

    s4-samba3samtest: we need to force netbios name as well
    
    needed for when run in CLIENT context

commit dde2b66341d5addbb80a239b8ccab58af1f3fc24
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Jan 8 12:54:42 2010 +1100

    s4-samba3sid: fixed error returns when res->count != 1 and oom

commit 9aed0993624ecd42ad68b3b080668fa07a9bc1b9
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Jan 8 12:45:49 2010 +1100

    s4-samba3samtest: force workgroup so the domain is right
    
    the samba3sid backend looks at lp_sam_name() which is based on the
    workgroup

commit f68c43e80338921be8145f8b3a3b391a941715a2
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Jan 8 12:45:29 2010 +1100

    s4-samba3sid: the sambaNextRid attribute is actually the previous RID
    
    Not well named .... though same mistake that MS made with rIDNextRid

commit d6f92db456162571e7d9273afe371103da72e6b0
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Jan 8 12:15:01 2010 +1100

    s4-samba3sam: use samba3sid module
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit dd61336165396f8aaccde1320de26bae789fb324
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Jan 8 12:14:39 2010 +1100

    s4-dsdb: added a samba3sid module
    
    This module allocates SIDs using the Samba3 algorithm, for use with
    the samba3sam module.
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 66f161dee13fc027ea0253abdf40dfb7dc4bffa3
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Jan 8 10:03:51 2010 +1100

    s4-acl: fixed acl.py test to use correct ldif
    
    same problem as sec_descriptor.py

commit 81c0b01585c93472a14e3027a6da0b6d65a2ed7c
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Jan 8 10:00:35 2010 +1100

    s4-secdesc: fixed the sec_descriptor.py test
    
    The test was using a "changetype: add" to try and add a member to a
    group, where it should use a "changetype: modify" with a "add: member"
    
    Also fixed the recovery when the test fails part way through (delete
    the test users at the start as well as the end)
    
    Nadya, please check!

commit 43a815c67ac7b7406b047b488393fa42617a5884
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Jan 8 09:31:23 2010 +1100

    s4-samba3samtest: use system credentials for creating users

commit 8b8bb15a54a80b8a568f9da955a33ff8336168ee
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Jan 8 09:30:59 2010 +1100

    s4-dsdb: fixed const misuse in acl module

commit baa8793a94a05bd5fde0f2770d9a16959e01b60b
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Jan 8 09:30:31 2010 +1100

    s4-dsdb: use dsdb_module_am_system() in acl module

commit 595fad2b34b6f67b130344bc741ff0ddffb0db4f
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Jan 8 09:29:32 2010 +1100

    s4-dsdb: allow specification of a SID if we are system
    
    needed for samba3sam test

commit f118f54ee783a97ed2bc5415213f3145710e0b4c
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Jan 8 09:29:01 2010 +1100

    s4-dsdb: added dsdb_module_am_system()
    
    better than each module inventing their own

commit d22a9e5d3bee44ac59922a2a602ad235bf450d5d
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Jan 8 09:28:38 2010 +1100

    s4-dsdb: squash some unknown structure warnings

commit 5d6032eb4b3e77240d2eccf7c644d1a30da89c78
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Jan 8 09:00:15 2010 +1100

    s4-partition: fixed selection of partitions on exact match
    
    When a search is on the root of a partition on the global catalog,
    don't search partitions above that one.

commit 59f314d321bb276ebdf2da3017b6a5d3b79d13e2
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jan 7 21:28:03 2010 +1100

    s4-scripting: we need to use a base search for the NTDS GUID
    
    now we have nTDSConnections structures we can get more than 1 reply

commit 501dd4a3b51635fd215d6e397b64f264911c7250
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Dec 30 17:11:51 2009 +0100

    s4:dsdb/repl: convert dreplsrv_op_pull_source_send/recv to tevent_req
    
    metze
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 278d2f75baaaab1bb30910f0fd332731b4292a06
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jan 7 19:12:45 2010 +1100

    s4-smbd: setup the default event contexts for other process models

commit 58032533620dc89dd093f55dabe003ec743f8dff
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jan 7 18:38:39 2010 +1100

    s4-drs: we need to wrap extended operations in transactions

commit 2d10f3a84197a20fa7a6ff8305a69ac57ddd44e3
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jan 7 18:38:16 2010 +1100

    s4-dsdb: poke the RID Manager when completely out of RIDs too

commit a65823e33c8fab39ea6dde752662c527bcbf818b
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jan 7 18:16:14 2010 +1100

    s4-dsdb: ensure we will in all the attributes for RID Set
    
    We need to go to the top of the module stack so that all the extra
    attributes get filled in

commit 308a4798b8b6acc7f74ce678a7c04f536a3e4737
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jan 7 18:15:34 2010 +1100

    s4-dsdb: added DSDB_FLAG_TOP_MODULE
    
    This is used when you want the dsdb_module_*() functions to go to the
    top of the stack.

commit 5f36f0352e92243aa9f801d69ddc4c4152dfecbc
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jan 7 17:32:13 2010 +1100

    s4-dsdb: no longer need special invocationID handling for standalone servers
    
    They now work the same way as a DC

commit a7fffe8da0464b25d587e5148207e1a67b930505
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jan 7 17:31:23 2010 +1100

    s4-provision: do a self join for all server types
    
    We need a machine account so the RID allocation code can work. It
    seems better to use the same code paths for a domain controller and
    standalone server to avoid testing headaches with little used code.

commit f6cf895951f24a28efb1a2859e066f5568e189b1
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jan 7 17:29:40 2010 +1100

    s4-schema: added generic attributeID conversion functions
    
    When we get one we haven't seen before, we can work out the right type
    automatically in most cases.
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit f7517e62569b108a79dfba10a6f06ad92c996413
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jan 7 17:27:46 2010 +1100

    s4-schema: added dsdb_attribute_by_lDAPDisplayName_ldb_val
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit cd65ce8a18b9ea9a8ce2338bc02c1b3e8ee10225
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jan 7 17:27:03 2010 +1100

    s4-schema: make ldb_val to string comparison safer with nul termination
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit ff968e487c9762727d7d2322f3e0fe81b6320cdf
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jan 7 17:25:38 2010 +1100

    s4-idl: regenerate DRS IDL
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 4c7bf0527a3ffc6c98691f9258cab3add0511129
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jan 7 17:25:19 2010 +1100

    s4-idl: added some more wellknown attributeIDs
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 3352e5d7bab3822249bbda685dbf7010ebac2681
Author: Kamen Mazdrashki <kamen.mazdrashki at postpath.com>
Date:   Thu Jan 7 06:04:35 2010 +0200

    s4/dsdb_schema: Load msDS-IntId value separately when loading from LDB
    
    This way we have consistent behavior when loading from DRSUAPI
    and from LDB.

commit 25238110dfc0826c2e533a543d1ca44e1f9e058c
Author: Kamen Mazdrashki <kamen.mazdrashki at postpath.com>
Date:   Thu Jan 7 05:08:49 2010 +0200

    Revert "s4-schema: Set ATTID in schema cache from "msDS-IntId""
    
    This reverts commit 4e8ad284f5813413fdec8426f11e24570d22549b.

commit 6247a135c68b592d99a8c1594aebe5ca7e716d7c
Author: Kamen Mazdrashki <kamen.mazdrashki at postpath.com>
Date:   Thu Jan 7 04:01:14 2010 +0200

    s4/schema: Do not assign msDS-IntId value if LDB_CONTROL_RELAX_OID is passed
    
    This way msDS-IntId should not be assigned during provisioning,
    which is how Windows works

commit 73838b353aadd221f011e42c1225bcd5cc07dc9d
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jan 7 12:19:42 2010 +1100

    s4-libnet: better error messages in libnet_vampire.c

commit 9871f52bd318b492e6e6ebb525789d7dbc6eac65
Author: Kamen Mazdrashki <kamen.mazdrashki at postpath.com>
Date:   Thu Jan 7 02:47:25 2010 +0200

    s4/dsdb_schema: use msDS-IntId value for attribute look-up

commit a44ae10c77b1eb2276b8c098a245b5b4df4607dd
Author: Kamen Mazdrashki <kamen.mazdrashki at postpath.com>
Date:   Thu Jan 7 02:46:25 2010 +0200

    s4/dsdb_schema: fetch msDS-IntId value during SCHEMA replication

commit a7b3891fb5e20fd3a5b9cc9df37d70693836c0e0
Author: Kamen Mazdrashki <kamen.mazdrashki at postpath.com>
Date:   Wed Jan 6 23:16:12 2010 +0200

    s4/dsdb_schema: GET_UINT32_DS() macro to use supplied default value instead of 0

commit f7756c87bb8bd1eba8d7f92cfbc797db42d3de4a
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jan 7 10:22:26 2010 +1100

    s4-partition: don't ignore errors from other modules
    
    if we get an error code from a lower module, we don't want to ignore
    it just because something also succeeded

commit 9672a3d1cc17dd800403a9987602403b8c6e757f
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jan 7 10:18:30 2010 +1100

    s4-devel: a useful script to setup bin/ and st/ as tmpfs filesystems
    
    this makes building and testing s4 as a developer much faster, if you
    have enough memory!

commit 1f25d0a5add1812723dfb93da28bbb80dc5d6757
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jan 7 10:12:24 2010 +1100

    s4-provision: re-open sam.ldb after creating the schema
    
    This enables the full schema during the rest of the provision, which
    means indexing is enabled (along with index error checking, such as
    duplicate SIDs)

commit 42f0bdae6952af7e1005b6bf9b4a3c6ecc42d62d
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jan 7 10:11:30 2010 +1100

    s4-provision: RID 1000 is consumed by the machine account

commit fdf12a607d4da368bcbb8d4379b6ea38cbfdbce6
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jan 7 10:11:10 2010 +1100

    s4-ldb: improve error handling in indexing code
    
    When we get an indexing failure we want a clear error message

commit c4fa4d116264f661d9eaddc6c4e430de476cff83
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jan 7 10:09:09 2010 +1100

    s4-dsdb: improve error messages in schema and pdc_fsmo modules
    
    We want to incorporate the error messages from the modules further
    down the stack.

commit ac5d42606270423b409e2cac32550bb6e48b27de
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 20:56:19 2010 +1100

    s4-drs: added some debug messages
    
    It is nice to see when a RID Alloc is successful

commit dcbba583d9a7acbbd0086889f3be722121754eae
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 20:55:38 2010 +1100

    s4-event: added s4_event_context_set_default()
    
    we're still not weaned off event_context_find()

commit f25409195737e8e9c29495526f6d2f6c58bda037
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 19:35:05 2010 +1100

    s4-dsdb: added support for DRSUAPI_EXOP_FSMO_RID_ALLOC
    
    This allocates a RID pool for the client DC when we are the RID Manager
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit b1f97b7e60b68429f0a9c12de9cd1cf24b2d8d35
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 19:34:14 2010 +1100

    s4-dsdb: added an extended operation for allocating a new RID pool
    
    This will be called by getncchanges when a client asks for a
    DRSUAPI_EXOP_FSMO_RID_ALLOC operation
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 2590b7795d38728f53f795c2b60b32ace9ca5c4b
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 17:18:42 2010 +1100

    s4-repl: implement MSG_DREPL_ALLOCATE_RID
    
    When the repl server gets MSG_DREPL_ALLOCATE_RID it contacts the RID
    Manager to ask for another RID pool. We use a callback on completion
    of the operation to make sure that we don't have two RID allocation
    requests in flight at once
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit cc7967b1c0555ba7641fb0248077295521f74943
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 17:16:58 2010 +1100

    s4-repl: allow for callbacks when a repl operation completes
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 7a40cacbde0dc707ac2d354bfb335312f420da4b
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 16:47:36 2010 +1100

    s4-dsdb: the dsdb ldb modules now need messagiing
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit dc11414f987aa99f286acb1d1ece625d290831f3
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 16:47:11 2010 +1100

    s4-dsdb: send a message to the drepl task when we need another RID pool
    
    We send the message when the current pool is half gone. We don't wait
    for a reply.
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 805ab0ef15faf339c4336eb95e09e1bea4b85d5a
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 16:45:34 2010 +1100

    s4-messaging: added a new msg type MSG_DREPL_ALLOCATE_RID
    
    This will be used to ask the drepl task for a new RID pool
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 19e515aac7a6e5ce85cfd6905a1cc773277047a9
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 14:54:12 2010 +1100

    s4-repl: added request for RID allocation in drepl task
    
    The drepl task now checks to see if our rIDAllocationPool is
    exhausted, and if it is then we queue a extended operation
    DsGetNCChanges call to ask the RID Manager to give us a new allocation
    pool.
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 8cd2bedee74ae8dfb3a19f9bdde4a568de4b44cd
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 14:50:41 2010 +1100

    s4-dsdb: added dsdb_find_guid_attr_by_dn()
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 37340d5a2e04a194479beb80b96b0bc78df4393a
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 14:50:04 2010 +1100

    s4-ridalloc: copy with missing rIDNextRid and rIDAllocationPool
    
    The attributes rIDNextRid and rIDAllocationPool are not replicated, so
    their initial value when we first get a RID Set from the RID Manager
    is blank.
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 45550f83f00f259a64cd70f7b2f741a12ee55854
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 14:48:55 2010 +1100

    s4-dsdb: added dsdb_module_set_integer()
    
    This will be used by ridalloc.c
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit c12b9ab2f2d26147a0878bbb2a1672892599293e
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 11:40:05 2010 +1100

    s4-dsdb: clarify who is responsible for each attribute
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit dd8cb3c7ed1e32fa4073c6e38dafc35fe2cb4f72
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 11:38:38 2010 +1100

    s4-dsdb: fixed usage of rIDAllocationPool and rIDPreviousAllocationPool
    
    These are very badly named attributes! See the comments in ridalloc.c
    for a explanation of what they really seem to mean
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 5136438ad612435ceb11e81e4dc316791bdc003e
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 10:27:30 2010 +1100

    s4-dsdb: implement refresh of RID Set pool for a local RID Manager
    
    when we run out of RIDs in our RID Set pool then grab a new one from
    the RID Manager object
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 53d10d139e569f9132193e8f8c268638eab30a0b
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 09:26:17 2010 +1100

    s4-provision: don't hard wire the creation of the RID Set object
    
    We now create it automatically in the samldb module when the first
    user is created.
    
    The creation of the dns user also had to move to the _modify.ldif as
    it now relies on the fSMO role being setup for the RID Manager
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 1053ce529d2ed833edd9343c36f28b4ba788db96
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 09:24:29 2010 +1100

    s4-dsdb: implement creation of the RID Set object
    
    when we are the RID Manager we can create our own RID Set object when
    the first user is created

commit 439ee5aaaeb9036d2db69d512bcbc7e88f4a601e
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 09:23:29 2010 +1100

    s4-dsdb: use dsdb_next_callback()
    
    We can't just use the callers callback directly otherwise the
    ldb_module_done() is never called on the parent request, as the child
    request is passed to the callback.
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit d0bd6e7ea5a6cc760916acd4f549ac7652c46e05
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 09:21:21 2010 +1100

    s4-dsdb: added dsdb_next_callback()
    
    This should be used when you create a sub request and just want the
    parent requests callback to be called when done.
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit e6f14ac2c4f0d1eaae93980b3628250de945e71e
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 09:20:35 2010 +1100

    s4-dsdb: added dsdb_module_constrainted_update_integer()
    
    This provides a convenient way to update a integer attribute with a
    constrained delete/add
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit f24011059b8b656eeb32c2724c0350f135dd2309
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 09:19:04 2010 +1100

    s4-dsdb: added dsdb_module_reference_dn()
    
    This adds a module callable version of samdb_reference_dn(), which
    finds a DN via a reference link
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit f137f93e098b23b48d3e7bc9e0bbc46f04b29cbd
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 09:17:19 2010 +1100

    s4-dsdb: added dsdb_module_add()
    
    added a ldb add function for modules
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit fcfb5d7b63293a13fa4984c0a4502a682a5a02a9
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jan 6 09:15:35 2010 +1100

    s4-provision: allow provision modifies to add records
    
    we need to recognise a changetype of 'add'

commit 226460d543892fcfcb569297bc450648f4fc4f0f
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Jan 5 18:23:46 2010 +1100

    s4-dsdb: move the RID allocation logic into ridalloc.c
    
    This will end up having the RID Manager logic as well, so all the RID
    pool allocation logic is in one spot
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 7f90a05c66df5483e949b109b9018ee70b9c5d27
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Jan 5 17:09:51 2010 +1100

    s4-samldb: use RID Set to allocate user/group RIDs
    
    This is the first step towards DRS-friendly RID allocation. We now get
    the next rid from the RID Set object
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 5eb3b919c59b62065db32e0575fcd1d84a64e3db
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Jan 5 17:08:56 2010 +1100

    s4-provision: the DC object itself needs a fixed objectSID
    
    We can't allocate a objectSID until we have rIDSetReferences, but that
    is in the DC object, so we have to force the objectSID of the DC
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 2bad107aa1110bd003aaca91c3214fe2c6b07197
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Jan 5 17:07:51 2010 +1100

    s4-dsdb: added samdb_rid_set_dn()
    
    This returns the DN of our RID Set object
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit a1362492ab71a8853d2292d55b35e5c90de9448e
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Jan 5 15:20:10 2010 +1100

    s4-provision: added an initial RID Set
    
    We will allocate RIDs from this set
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit bd6d0e93795589f18894b4e3837970436969fc60
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Jan 5 15:12:16 2010 +1100

    s4-ldb: added nice ldif display of 64 bit ranges for RIDs

commit fbc3a0fe6248871d6e8bed6947559c10f762954f
Author: Andrew Tridgell <tridge at samba.org>
Date:   Mon Jan 4 14:13:21 2010 +1100

    s4-dsdb: added samdb_reference_dn()
    
    This returns a 'reference' DN, which is a link to a DN, from the
    specified object. It is then used by samdb_server_reference_dn() which
    returns the serverReference DN, and samdb_rid_manager_dn() which
    returns the rIDManagerReference DN.

-----------------------------------------------------------------------

Summary of changes:
 librpc/gen_ndr/drsuapi.h                          |    6 +
 librpc/gen_ndr/ndr_drsuapi.c                      |    3 +
 librpc/idl/drsuapi.idl                            |    3 +
 source4/dsdb/common/util.c                        |  103 ++++-
 source4/dsdb/config.mk                            |    3 +-
 source4/dsdb/repl/drepl_out_helpers.c             |  322 ++++++-----
 source4/dsdb/repl/drepl_out_pull.c                |   54 +-
 source4/dsdb/repl/drepl_partitions.c              |    6 +-
 source4/dsdb/repl/drepl_periodic.c                |    2 +
 source4/dsdb/repl/drepl_ridalloc.c                |  282 +++++++++
 source4/dsdb/repl/drepl_service.c                 |    1 +
 source4/dsdb/repl/drepl_service.h                 |   11 +-
 source4/dsdb/samdb/ldb_modules/acl.c              |   38 +-
 source4/dsdb/samdb/ldb_modules/config.mk          |   21 +-
 source4/dsdb/samdb/ldb_modules/instancetype.c     |    3 +-
 source4/dsdb/samdb/ldb_modules/lazy_commit.c      |   13 +-
 source4/dsdb/samdb/ldb_modules/partition.c        |   12 +-
 source4/dsdb/samdb/ldb_modules/pdc_fsmo.c         |    4 +-
 source4/dsdb/samdb/ldb_modules/ridalloc.c         |  646 +++++++++++++++++++++
 source4/dsdb/samdb/ldb_modules/samba3sid.c        |  197 +++++++
 source4/dsdb/samdb/ldb_modules/samba_dsdb.c       |   77 +---
 source4/dsdb/samdb/ldb_modules/samldb.c           |  637 ++------------------
 source4/dsdb/samdb/ldb_modules/schema_data.c      |    5 +
 source4/dsdb/samdb/ldb_modules/schema_load.c      |    8 +-
 source4/dsdb/samdb/ldb_modules/show_deleted.c     |    4 +-
 source4/dsdb/samdb/ldb_modules/tests/samba3sam.py |   17 +-
 source4/dsdb/samdb/ldb_modules/util.c             |  192 ++++++
 source4/dsdb/samdb/ldb_modules/util.h             |    5 +-
 source4/dsdb/samdb/samdb.h                        |    8 +
 source4/dsdb/schema/schema.h                      |    1 +
 source4/dsdb/schema/schema_init.c                 |   56 +-
 source4/dsdb/schema/schema_query.c                |   30 +-
 source4/dsdb/schema/schema_syntax.c               |  180 ++++--
 source4/lib/events/events.h                       |    1 +
 source4/lib/events/tevent_s4.c                    |   15 +-
 source4/lib/ldb-samba/ldif_handlers.c             |  118 ++++
 source4/lib/ldb-samba/ldif_handlers.h             |    1 +
 source4/lib/ldb/ldb_tdb/ldb_index.c               |   36 +-
 source4/lib/ldb/ldb_tdb/ldb_tdb.c                 |    3 +-
 source4/lib/ldb/tests/python/acl.py               |    3 +-
 source4/lib/ldb/tests/python/sec_descriptor.py    |  116 +++--
 source4/lib/messaging/messaging.h                 |    1 +
 source4/libnet/libnet_vampire.c                   |    4 +-
 source4/rpc_server/drsuapi/getncchanges.c         |  132 ++++-
 source4/scripting/bin/setup_dns.sh                |    2 +-
 source4/scripting/devel/tmpfs.sh                  |   13 +
 source4/scripting/python/samba/__init__.py        |    5 +-
 source4/scripting/python/samba/provision.py       |   49 +-
 source4/setup/provision.ldif                      |    2 +-
 source4/setup/provision_self_join.ldif            |   16 +-
 source4/setup/provision_self_join_modify.ldif     |   14 +
 source4/setup/schema_samba4.ldif                  |    1 +
 source4/smbd/process_prefork.c                    |    8 +-
 source4/smbd/process_standard.c                   |    6 +
 source4/smbd/server.c                             |    3 +
 55 files changed, 2431 insertions(+), 1068 deletions(-)
 create mode 100644 source4/dsdb/repl/drepl_ridalloc.c
 create mode 100644 source4/dsdb/samdb/ldb_modules/ridalloc.c
 create mode 100644 source4/dsdb/samdb/ldb_modules/samba3sid.c
 create mode 100755 source4/scripting/devel/tmpfs.sh


Changeset truncated at 500 lines:

diff --git a/librpc/gen_ndr/drsuapi.h b/librpc/gen_ndr/drsuapi.h
index a5016fa..8596bf3 100644
--- a/librpc/gen_ndr/drsuapi.h
+++ b/librpc/gen_ndr/drsuapi.h
@@ -336,6 +336,7 @@ enum drsuapi_DsAttributeId
 	DRSUAPI_ATTRIBUTE_governsID=(int)(0x00020016),
 	DRSUAPI_ATTRIBUTE_mustContain=(int)(0x00020018),
 	DRSUAPI_ATTRIBUTE_mayContain=(int)(0x00020019),
+	DRSUAPI_ATTRIBUTE_rDNAttId=(int)(0x0002001A),
 	DRSUAPI_ATTRIBUTE_attributeID=(int)(0x0002001e),
 	DRSUAPI_ATTRIBUTE_attributeSyntax=(int)(0x00020020),
 	DRSUAPI_ATTRIBUTE_isSingleValued=(int)(0x00020021),
@@ -374,6 +375,7 @@ enum drsuapi_DsAttributeId
 	DRSUAPI_ATTRIBUTE_systemPossSuperiors=(int)(0x000900c3),
 	DRSUAPI_ATTRIBUTE_systemMayContain=(int)(0x000900c4),
 	DRSUAPI_ATTRIBUTE_systemMustContain=(int)(0x000900c5),
+	DRSUAPI_ATTRIBUTE_systemAuxiliaryClass=(int)(0x000900c6),
 	DRSUAPI_ATTRIBUTE_sAMAccountName=(int)(0x000900dd),
 	DRSUAPI_ATTRIBUTE_sAMAccountType=(int)(0x0009012e),
 	DRSUAPI_ATTRIBUTE_fSMORoleOwner=(int)(0x00090171),
@@ -390,6 +392,7 @@ enum drsuapi_DsAttributeId
 	DRSUAPI_ATTRIBUTE_servicePrincipalName=(int)(0x00090303),
 	DRSUAPI_ATTRIBUTE_objectCategory=(int)(0x0009030e),
 	DRSUAPI_ATTRIBUTE_gPLink=(int)(0x0009037b),
+	DRSUAPI_ATTRIBUTE_transportAddressAttribute=(int)(0x0009037f),
 	DRSUAPI_ATTRIBUTE_msDS_Behavior_Version=(int)(0x000905b3),
 	DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber=(int)(0x000906f6),
 	DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs=(int)(0x0009071c),
@@ -408,6 +411,7 @@ enum drsuapi_DsAttributeId
 #define DRSUAPI_ATTRIBUTE_governsID ( 0x00020016 )
 #define DRSUAPI_ATTRIBUTE_mustContain ( 0x00020018 )
 #define DRSUAPI_ATTRIBUTE_mayContain ( 0x00020019 )
+#define DRSUAPI_ATTRIBUTE_rDNAttId ( 0x0002001A )
 #define DRSUAPI_ATTRIBUTE_attributeID ( 0x0002001e )
 #define DRSUAPI_ATTRIBUTE_attributeSyntax ( 0x00020020 )
 #define DRSUAPI_ATTRIBUTE_isSingleValued ( 0x00020021 )
@@ -446,6 +450,7 @@ enum drsuapi_DsAttributeId
 #define DRSUAPI_ATTRIBUTE_systemPossSuperiors ( 0x000900c3 )
 #define DRSUAPI_ATTRIBUTE_systemMayContain ( 0x000900c4 )
 #define DRSUAPI_ATTRIBUTE_systemMustContain ( 0x000900c5 )
+#define DRSUAPI_ATTRIBUTE_systemAuxiliaryClass ( 0x000900c6 )
 #define DRSUAPI_ATTRIBUTE_sAMAccountName ( 0x000900dd )
 #define DRSUAPI_ATTRIBUTE_sAMAccountType ( 0x0009012e )
 #define DRSUAPI_ATTRIBUTE_fSMORoleOwner ( 0x00090171 )
@@ -462,6 +467,7 @@ enum drsuapi_DsAttributeId
 #define DRSUAPI_ATTRIBUTE_servicePrincipalName ( 0x00090303 )
 #define DRSUAPI_ATTRIBUTE_objectCategory ( 0x0009030e )
 #define DRSUAPI_ATTRIBUTE_gPLink ( 0x0009037b )
+#define DRSUAPI_ATTRIBUTE_transportAddressAttribute ( 0x0009037f )
 #define DRSUAPI_ATTRIBUTE_msDS_Behavior_Version ( 0x000905b3 )
 #define DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber ( 0x000906f6 )
 #define DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs ( 0x0009071c )
diff --git a/librpc/gen_ndr/ndr_drsuapi.c b/librpc/gen_ndr/ndr_drsuapi.c
index eb89db7..16388e7 100644
--- a/librpc/gen_ndr/ndr_drsuapi.c
+++ b/librpc/gen_ndr/ndr_drsuapi.c
@@ -1389,6 +1389,7 @@ _PUBLIC_ void ndr_print_drsuapi_DsAttributeId(struct ndr_print *ndr, const char
 			case DRSUAPI_ATTRIBUTE_governsID: val = "DRSUAPI_ATTRIBUTE_governsID"; break;
 			case DRSUAPI_ATTRIBUTE_mustContain: val = "DRSUAPI_ATTRIBUTE_mustContain"; break;
 			case DRSUAPI_ATTRIBUTE_mayContain: val = "DRSUAPI_ATTRIBUTE_mayContain"; break;
+			case DRSUAPI_ATTRIBUTE_rDNAttId: val = "DRSUAPI_ATTRIBUTE_rDNAttId"; break;
 			case DRSUAPI_ATTRIBUTE_attributeID: val = "DRSUAPI_ATTRIBUTE_attributeID"; break;
 			case DRSUAPI_ATTRIBUTE_attributeSyntax: val = "DRSUAPI_ATTRIBUTE_attributeSyntax"; break;
 			case DRSUAPI_ATTRIBUTE_isSingleValued: val = "DRSUAPI_ATTRIBUTE_isSingleValued"; break;
@@ -1427,6 +1428,7 @@ _PUBLIC_ void ndr_print_drsuapi_DsAttributeId(struct ndr_print *ndr, const char
 			case DRSUAPI_ATTRIBUTE_systemPossSuperiors: val = "DRSUAPI_ATTRIBUTE_systemPossSuperiors"; break;
 			case DRSUAPI_ATTRIBUTE_systemMayContain: val = "DRSUAPI_ATTRIBUTE_systemMayContain"; break;
 			case DRSUAPI_ATTRIBUTE_systemMustContain: val = "DRSUAPI_ATTRIBUTE_systemMustContain"; break;
+			case DRSUAPI_ATTRIBUTE_systemAuxiliaryClass: val = "DRSUAPI_ATTRIBUTE_systemAuxiliaryClass"; break;
 			case DRSUAPI_ATTRIBUTE_sAMAccountName: val = "DRSUAPI_ATTRIBUTE_sAMAccountName"; break;
 			case DRSUAPI_ATTRIBUTE_sAMAccountType: val = "DRSUAPI_ATTRIBUTE_sAMAccountType"; break;
 			case DRSUAPI_ATTRIBUTE_fSMORoleOwner: val = "DRSUAPI_ATTRIBUTE_fSMORoleOwner"; break;
@@ -1443,6 +1445,7 @@ _PUBLIC_ void ndr_print_drsuapi_DsAttributeId(struct ndr_print *ndr, const char
 			case DRSUAPI_ATTRIBUTE_servicePrincipalName: val = "DRSUAPI_ATTRIBUTE_servicePrincipalName"; break;
 			case DRSUAPI_ATTRIBUTE_objectCategory: val = "DRSUAPI_ATTRIBUTE_objectCategory"; break;
 			case DRSUAPI_ATTRIBUTE_gPLink: val = "DRSUAPI_ATTRIBUTE_gPLink"; break;
+			case DRSUAPI_ATTRIBUTE_transportAddressAttribute: val = "DRSUAPI_ATTRIBUTE_transportAddressAttribute"; break;
 			case DRSUAPI_ATTRIBUTE_msDS_Behavior_Version: val = "DRSUAPI_ATTRIBUTE_msDS_Behavior_Version"; break;
 			case DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber: val = "DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber"; break;
 			case DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs: val = "DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs"; break;
diff --git a/librpc/idl/drsuapi.idl b/librpc/idl/drsuapi.idl
index 3038863..2994958 100644
--- a/librpc/idl/drsuapi.idl
+++ b/librpc/idl/drsuapi.idl
@@ -447,6 +447,7 @@ interface drsuapi
 		DRSUAPI_ATTRIBUTE_governsID			= 0x00020016,
 		DRSUAPI_ATTRIBUTE_mustContain			= 0x00020018,
 		DRSUAPI_ATTRIBUTE_mayContain			= 0x00020019,
+		DRSUAPI_ATTRIBUTE_rDNAttId			= 0x0002001A,
 		DRSUAPI_ATTRIBUTE_attributeID			= 0x0002001e,
 		DRSUAPI_ATTRIBUTE_attributeSyntax		= 0x00020020,
 		DRSUAPI_ATTRIBUTE_isSingleValued		= 0x00020021,
@@ -485,6 +486,7 @@ interface drsuapi
 		DRSUAPI_ATTRIBUTE_systemPossSuperiors		= 0x000900c3,
 		DRSUAPI_ATTRIBUTE_systemMayContain		= 0x000900c4,
 		DRSUAPI_ATTRIBUTE_systemMustContain		= 0x000900c5,
+		DRSUAPI_ATTRIBUTE_systemAuxiliaryClass		= 0x000900c6,
 		DRSUAPI_ATTRIBUTE_sAMAccountName		= 0x000900dd,
 		DRSUAPI_ATTRIBUTE_sAMAccountType		= 0x0009012e,
 		DRSUAPI_ATTRIBUTE_fSMORoleOwner			= 0x00090171,
@@ -501,6 +503,7 @@ interface drsuapi
 		DRSUAPI_ATTRIBUTE_servicePrincipalName		= 0x00090303,
 		DRSUAPI_ATTRIBUTE_objectCategory		= 0x0009030e,
 		DRSUAPI_ATTRIBUTE_gPLink			= 0x0009037b,
+		DRSUAPI_ATTRIBUTE_transportAddressAttribute	= 0x0009037f,
 		DRSUAPI_ATTRIBUTE_msDS_Behavior_Version		= 0x000905b3,
 		DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber		= 0x000906f6,
 		DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs		= 0x0009071c,
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index b8ba26a..70750ca 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -1521,6 +1521,86 @@ struct ldb_dn *samdb_server_site_dn(struct ldb_context *ldb, TALLOC_CTX *mem_ctx
 	return server_site_dn;
 }
 
+/*
+  find a 'reference' DN that points at another object
+  (eg. serverReference, rIDManagerReference etc)
+ */
+int samdb_reference_dn(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct ldb_dn *base,
+		       const char *attribute, struct ldb_dn **dn)
+{
+	const char *attrs[2];
+	struct ldb_result *res;
+	int ret;
+
+	attrs[0] = attribute;
+	attrs[1] = NULL;
+
+	ret = ldb_search(ldb, mem_ctx, &res, base, LDB_SCOPE_BASE, attrs, NULL);
+	if (ret != LDB_SUCCESS) {
+		return ret;
+	}
+	if (res->count != 1) {
+		talloc_free(res);
+		return LDB_ERR_NO_SUCH_OBJECT;
+	}
+
+	*dn = ldb_msg_find_attr_as_dn(ldb, mem_ctx, res->msgs[0], attribute);
+	if (!*dn) {
+		talloc_free(res);
+		return LDB_ERR_NO_SUCH_ATTRIBUTE;
+	}
+
+	talloc_free(res);
+	return LDB_SUCCESS;
+}
+
+/*
+  find our machine account via the serverReference attribute in the
+  server DN
+ */
+int samdb_server_reference_dn(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct ldb_dn **dn)
+{
+	struct ldb_dn *server_dn;
+	int ret;
+
+	server_dn = samdb_server_dn(ldb, mem_ctx);
+	if (server_dn == NULL) {
+		return LDB_ERR_NO_SUCH_OBJECT;
+	}
+
+	ret = samdb_reference_dn(ldb, mem_ctx, server_dn, "serverReference", dn);
+	talloc_free(server_dn);
+
+	return ret;
+}
+
+/*
+  find the RID Manager$ DN via the rIDManagerReference attribute in the
+  base DN
+ */
+int samdb_rid_manager_dn(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct ldb_dn **dn)
+{
+	return samdb_reference_dn(ldb, mem_ctx, samdb_base_dn(ldb), "rIDManagerReference", dn);
+}
+
+/*
+  find the RID Set DN via the rIDSetReferences attribute in our
+  machine account DN
+ */
+int samdb_rid_set_dn(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct ldb_dn **dn)
+{
+	struct ldb_dn *server_ref_dn;
+	int ret;
+
+	ret = samdb_server_reference_dn(ldb, mem_ctx, &server_ref_dn);
+	if (ret != LDB_SUCCESS) {
+		return ret;
+	}
+	ret = samdb_reference_dn(ldb, mem_ctx, server_ref_dn, "rIDSetReferences", dn);
+	talloc_free(server_ref_dn);
+	return ret;
+}
+
 const char *samdb_server_site_name(struct ldb_context *ldb, TALLOC_CTX *mem_ctx)
 {
 	const struct ldb_val *val = ldb_dn_get_rdn_val(samdb_server_site_dn(ldb, mem_ctx));
@@ -2353,16 +2433,20 @@ int dsdb_search_dn_with_deleted(struct ldb_context *ldb,
 
 
 /*
-  use a DN to find a GUID
+  use a DN to find a GUID with a given attribute name
  */
-int dsdb_find_guid_by_dn(struct ldb_context *ldb, 
-			 struct ldb_dn *dn, struct GUID *guid)
+int dsdb_find_guid_attr_by_dn(struct ldb_context *ldb,
+			      struct ldb_dn *dn, const char *attribute,
+			      struct GUID *guid)
 {
 	int ret;
 	struct ldb_result *res;
-	const char *attrs[] = { "objectGUID", NULL };
+	const char *attrs[2];
 	TALLOC_CTX *tmp_ctx = talloc_new(ldb);
 
+	attrs[0] = attribute;
+	attrs[1] = NULL;
+
 	ret = dsdb_search_dn_with_deleted(ldb, tmp_ctx, &res, dn, attrs);
 	if (ret != LDB_SUCCESS) {
 		talloc_free(tmp_ctx);
@@ -2372,11 +2456,20 @@ int dsdb_find_guid_by_dn(struct ldb_context *ldb,
 		talloc_free(tmp_ctx);
 		return LDB_ERR_NO_SUCH_OBJECT;
 	}
-	*guid = samdb_result_guid(res->msgs[0], "objectGUID");
+	*guid = samdb_result_guid(res->msgs[0], attribute);
 	talloc_free(tmp_ctx);
 	return LDB_SUCCESS;
 }
 
+/*
+  use a DN to find a GUID
+ */
+int dsdb_find_guid_by_dn(struct ldb_context *ldb,
+			 struct ldb_dn *dn, struct GUID *guid)
+{
+	return dsdb_find_guid_attr_by_dn(ldb, dn, "objectGUID", guid);
+}
+
 
 
 /*
diff --git a/source4/dsdb/config.mk b/source4/dsdb/config.mk
index 35a0c84..3226c08 100644
--- a/source4/dsdb/config.mk
+++ b/source4/dsdb/config.mk
@@ -64,7 +64,8 @@ DREPL_SRV_OBJ_FILES = $(addprefix $(dsdbsrcdir)/repl/, \
 		drepl_partitions.o \
 		drepl_out_pull.o \
 		drepl_out_helpers.o \
-		drepl_notify.o)
+		drepl_notify.o \
+		drepl_ridalloc.o)
 
 $(eval $(call proto_header_template,$(dsdbsrcdir)/repl/drepl_service_proto.h,$(DREPL_SRV_OBJ_FILES:.o=.c)))
 
diff --git a/source4/dsdb/repl/drepl_out_helpers.c b/source4/dsdb/repl/drepl_out_helpers.c
index 722db4f..5666a66 100644
--- a/source4/dsdb/repl/drepl_out_helpers.c
+++ b/source4/dsdb/repl/drepl_out_helpers.c
@@ -202,81 +202,83 @@ NTSTATUS dreplsrv_out_drsuapi_recv(struct tevent_req *req)
 }
 
 struct dreplsrv_op_pull_source_state {
-	struct composite_context *creq;
-
 	struct dreplsrv_out_operation *op;
-
-	struct dreplsrv_drsuapi_connection *drsuapi;
-
-	bool have_all;
-
-	uint32_t ctr_level;
-	struct drsuapi_DsGetNCChangesCtr1 *ctr1;
-	struct drsuapi_DsGetNCChangesCtr6 *ctr6;
 };
 
 static void dreplsrv_op_pull_source_connect_done(struct tevent_req *subreq);
 
-struct composite_context *dreplsrv_op_pull_source_send(struct dreplsrv_out_operation *op)
+struct tevent_req *dreplsrv_op_pull_source_send(TALLOC_CTX *mem_ctx,
+						struct tevent_context *ev,
+						struct dreplsrv_out_operation *op)
 {
-	struct composite_context *c;
-	struct dreplsrv_op_pull_source_state *st;
+	struct tevent_req *req;
+	struct dreplsrv_op_pull_source_state *state;
 	struct tevent_req *subreq;
 
-	c = composite_create(op, op->service->task->event_ctx);
-	if (c == NULL) return NULL;
-
-	st = talloc_zero(c, struct dreplsrv_op_pull_source_state);
-	if (composite_nomem(st, c)) return c;
+	req = tevent_req_create(mem_ctx, &state,
+				struct dreplsrv_op_pull_source_state);
+	if (req == NULL) {
+		return NULL;
+	}
 
-	st->creq	= c;
-	st->op		= op;
+	state->op = op;
 
-	subreq = dreplsrv_out_drsuapi_send(st,
-					   op->service->task->event_ctx,
-					   op->source_dsa->conn);
-	if (composite_nomem(subreq, c)) return c;
-	tevent_req_set_callback(subreq, dreplsrv_op_pull_source_connect_done, st);
+	subreq = dreplsrv_out_drsuapi_send(state, ev, op->source_dsa->conn);
+	if (tevent_req_nomem(subreq, req)) {
+		return tevent_req_post(req, ev);
+	}
+	tevent_req_set_callback(subreq, dreplsrv_op_pull_source_connect_done, req);
 
-	return c;
+	return req;
 }
 
-static void dreplsrv_op_pull_source_get_changes_send(struct dreplsrv_op_pull_source_state *st);
+static void dreplsrv_op_pull_source_get_changes_trigger(struct tevent_req *req);
 
 static void dreplsrv_op_pull_source_connect_done(struct tevent_req *subreq)
 {
-	struct dreplsrv_op_pull_source_state *st = tevent_req_callback_data(subreq,
-						   struct dreplsrv_op_pull_source_state);
-	struct composite_context *c = st->creq;
+	struct tevent_req *req = tevent_req_callback_data(subreq,
+				 struct tevent_req);
+	NTSTATUS status;
 
-	c->status = dreplsrv_out_drsuapi_recv(subreq);
+	status = dreplsrv_out_drsuapi_recv(subreq);
 	TALLOC_FREE(subreq);
-	if (!composite_is_ok(c)) return;
+	if (tevent_req_nterror(req, status)) {
+		return;
+	}
 
-	dreplsrv_op_pull_source_get_changes_send(st);
+	dreplsrv_op_pull_source_get_changes_trigger(req);
 }
 
-static void dreplsrv_op_pull_source_get_changes_recv(struct rpc_request *req);
+static void dreplsrv_op_pull_source_get_changes_done(struct rpc_request *rreq);
 
-static void dreplsrv_op_pull_source_get_changes_send(struct dreplsrv_op_pull_source_state *st)
+static void dreplsrv_op_pull_source_get_changes_trigger(struct tevent_req *req)
 {
-	struct composite_context *c = st->creq;
-	struct repsFromTo1 *rf1 = st->op->source_dsa->repsFrom1;
-	struct dreplsrv_service *service = st->op->service;
-	struct dreplsrv_partition *partition = st->op->source_dsa->partition;
-	struct dreplsrv_drsuapi_connection *drsuapi = st->op->source_dsa->conn->drsuapi;
-	struct rpc_request *req;
+	struct dreplsrv_op_pull_source_state *state = tevent_req_data(req,
+						      struct dreplsrv_op_pull_source_state);
+	struct repsFromTo1 *rf1 = state->op->source_dsa->repsFrom1;
+	struct dreplsrv_service *service = state->op->service;
+	struct dreplsrv_partition *partition = state->op->source_dsa->partition;
+	struct dreplsrv_drsuapi_connection *drsuapi = state->op->source_dsa->conn->drsuapi;
+	struct rpc_request *rreq;
 	struct drsuapi_DsGetNCChanges *r;
 
-	r = talloc(st, struct drsuapi_DsGetNCChanges);
-	if (composite_nomem(r, c)) return;
+	r = talloc(state, struct drsuapi_DsGetNCChanges);
+	if (tevent_req_nomem(r, req)) {
+		return;
+	}
 
 	r->out.level_out = talloc(r, int32_t);
-	if (composite_nomem(r->out.level_out, c)) return;
+	if (tevent_req_nomem(r->out.level_out, req)) {
+		return;
+	}
 	r->in.req = talloc(r, union drsuapi_DsGetNCChangesRequest);
-	if (composite_nomem(r->in.req, c)) return;
+	if (tevent_req_nomem(r->in.req, req)) {
+		return;
+	}
 	r->out.ctr = talloc(r, union drsuapi_DsGetNCChangesCtr);
-	if (composite_nomem(r->out.ctr, c)) return;
+	if (tevent_req_nomem(r->out.ctr, req)) {
+		return;
+	}
 
 	r->in.bind_handle	= &drsuapi->bind_handle;
 	if (drsuapi->remote_info28.supported_extensions & DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8) {
@@ -289,8 +291,8 @@ static void dreplsrv_op_pull_source_get_changes_send(struct dreplsrv_op_pull_sou
 		r->in.req->req8.replica_flags		= rf1->replica_flags;
 		r->in.req->req8.max_object_count	= 133;
 		r->in.req->req8.max_ndr_size		= 1336811;
-		r->in.req->req8.extended_op		= DRSUAPI_EXOP_NONE;
-		r->in.req->req8.fsmo_info		= 0;
+		r->in.req->req8.extended_op		= state->op->extended_op;
+		r->in.req->req8.fsmo_info		= state->op->fsmo_info;
 		r->in.req->req8.partial_attribute_set	= NULL;
 		r->in.req->req8.partial_attribute_set_ex= NULL;
 		r->in.req->req8.mapping_ctr.num_mappings= 0;
@@ -305,36 +307,42 @@ static void dreplsrv_op_pull_source_get_changes_send(struct dreplsrv_op_pull_sou
 		r->in.req->req5.replica_flags		= rf1->replica_flags;
 		r->in.req->req5.max_object_count	= 133;
 		r->in.req->req5.max_ndr_size		= 1336770;
-		r->in.req->req5.extended_op		= DRSUAPI_EXOP_NONE;
-		r->in.req->req5.fsmo_info		= 0;
+		r->in.req->req5.extended_op		= state->op->extended_op;
+		r->in.req->req5.fsmo_info		= state->op->fsmo_info;
 	}
 
-	req = dcerpc_drsuapi_DsGetNCChanges_send(drsuapi->pipe, r, r);
-	composite_continue_rpc(c, req, dreplsrv_op_pull_source_get_changes_recv, st);
+	rreq = dcerpc_drsuapi_DsGetNCChanges_send(drsuapi->pipe, r, r);
+	if (tevent_req_nomem(rreq, req)) {
+		return;
+	}
+	composite_continue_rpc(NULL, rreq, dreplsrv_op_pull_source_get_changes_done, req);
 }
 
-static void dreplsrv_op_pull_source_apply_changes_send(struct dreplsrv_op_pull_source_state *st,
-						       struct drsuapi_DsGetNCChanges *r,
-						       uint32_t ctr_level,
-						       struct drsuapi_DsGetNCChangesCtr1 *ctr1,
-						       struct drsuapi_DsGetNCChangesCtr6 *ctr6);
+static void dreplsrv_op_pull_source_apply_changes_trigger(struct tevent_req *req,
+						          struct drsuapi_DsGetNCChanges *r,
+						          uint32_t ctr_level,
+						          struct drsuapi_DsGetNCChangesCtr1 *ctr1,
+						          struct drsuapi_DsGetNCChangesCtr6 *ctr6);
 
-static void dreplsrv_op_pull_source_get_changes_recv(struct rpc_request *req)
+static void dreplsrv_op_pull_source_get_changes_done(struct rpc_request *rreq)
 {
-	struct dreplsrv_op_pull_source_state *st = talloc_get_type(req->async.private_data,
-						   struct dreplsrv_op_pull_source_state);
-	struct composite_context *c = st->creq;
-	struct drsuapi_DsGetNCChanges *r = talloc_get_type(req->ndr.struct_ptr,
+	struct tevent_req *req = talloc_get_type(rreq->async.private_data,
+						 struct tevent_req);
+	NTSTATUS status;
+	struct drsuapi_DsGetNCChanges *r = talloc_get_type(rreq->ndr.struct_ptr,
 					   struct drsuapi_DsGetNCChanges);
 	uint32_t ctr_level = 0;
 	struct drsuapi_DsGetNCChangesCtr1 *ctr1 = NULL;
 	struct drsuapi_DsGetNCChangesCtr6 *ctr6 = NULL;
 
-	c->status = dcerpc_ndr_request_recv(req);
-	if (!composite_is_ok(c)) return;
+	status = dcerpc_ndr_request_recv(rreq);
+	if (tevent_req_nterror(req, status)) {
+		return;
+	}
 
 	if (!W_ERROR_IS_OK(r->out.result)) {
-		composite_error(c, werror_to_ntstatus(r->out.result));
+		status = werror_to_ntstatus(r->out.result);
+		tevent_req_nterror(req, status);
 		return;
 	}
 
@@ -361,38 +369,42 @@ static void dreplsrv_op_pull_source_get_changes_recv(struct rpc_request *req)
 		ctr_level = 6;
 		ctr6 = &r->out.ctr->ctr7.ctr.xpress6.ts->ctr6;
 	} else {
-		composite_error(c, werror_to_ntstatus(WERR_BAD_NET_RESP));
+		status = werror_to_ntstatus(WERR_BAD_NET_RESP);
+		tevent_req_nterror(req, status);
 		return;
 	}
 
 	if (!ctr1 && !ctr6) {
-		composite_error(c, werror_to_ntstatus(WERR_BAD_NET_RESP));
+		status = werror_to_ntstatus(WERR_BAD_NET_RESP);
+		tevent_req_nterror(req, status);
 		return;
 	}
 
 	if (ctr_level == 6) {
 		if (!W_ERROR_IS_OK(ctr6->drs_error)) {
-			composite_error(c, werror_to_ntstatus(ctr6->drs_error));
+			status = werror_to_ntstatus(ctr6->drs_error);
+			tevent_req_nterror(req, status);
 			return;
 		}
 	}
 
-	dreplsrv_op_pull_source_apply_changes_send(st, r, ctr_level, ctr1, ctr6);
+	dreplsrv_op_pull_source_apply_changes_trigger(req, r, ctr_level, ctr1, ctr6);
 }
 
-static void dreplsrv_update_refs_send(struct dreplsrv_op_pull_source_state *st);
+static void dreplsrv_update_refs_trigger(struct tevent_req *req);
 
-static void dreplsrv_op_pull_source_apply_changes_send(struct dreplsrv_op_pull_source_state *st,
-						       struct drsuapi_DsGetNCChanges *r,


-- 
Samba Shared Repository


More information about the samba-cvs mailing list