1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

356 Commits

Author SHA1 Message Date
Andrew Tridgell
38160deac4 s4-drs: use dsdb linked attribute parse functions
This makes the code considerably more readable
2010-01-02 08:16:54 +11:00
Andrew Tridgell
a81dd03917 s4-drs: set flag to indicate that we do support linked attributes 2010-01-02 08:16:54 +11:00
Andrew Tridgell
0c2afdd5a9 s4-drs: update highwatermark after successfully encoding the object 2010-01-02 08:16:52 +11:00
Andrew Tridgell
ff6dd4a67f s4-drs: send all linked attributes at the end of a replication cycle
This ensures that a link is not seen before the object it points to
2010-01-02 08:16:52 +11:00
Andrew Tridgell
5bf257fa9b s4-drs: use the extended linearized form for DRS replication
We were sending zero GUIDs. Not good!

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:52 +11:00
Andrew Tridgell
7653f56bd4 s4-drs: implemented sorting functions based on replication flags
I think we probably have more work to do on the sort order, but this
brings us a bit closer.
2010-01-02 08:16:52 +11:00
Andrew Tridgell
701148bbe9 s4-drs: we are doing the sorting for getncchanges in the app code now
the sorting is quite delicate, and easier to get right in the
getncchanges code

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:52 +11:00
Andrew Tridgell
cb00e443a3 s4-drs: give a reason when an AddEntry commit fails
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:52 +11:00
Andrew Tridgell
340d7e807b s4-drs: fixed the UDV return in getncchanges
We should overwrite an existing entry if found
2010-01-02 08:16:51 +11:00
Andrew Tridgell
bcc952d19d s4-drs: some useful debugging options for getncchanges
Added two debugging parametric options

  drs:max object sync = 
  drs:extra filter =
2010-01-02 08:16:51 +11:00
Andrew Tridgell
225bcfa4e6 s4-drs: handle mixtures of old and new style links in getncchanges
We need to send non-upgraded links using the old format
2010-01-02 08:16:51 +11:00
Andrew Tridgell
fde3f64373 s4-drs: added linked attribute replication to getncchanges 2010-01-02 08:16:50 +11:00
Andrew Tridgell
beba977213 s4-dsdb: ask for REVEAL_INTERNALS in getncchanges
We need this for the linked attribute meta data
2010-01-02 08:16:50 +11:00
Matthias Dieter Wallnöfer
e22e336f41 s4:drsuapi/getncchanges.c - Update the list of operational attributes
- Reorder them as specified in "operational.c"
- Add also the lan manager hash password attribute
2009-12-16 09:45:22 +01:00
Andrew Tridgell
732c701c52 s4-drs: ensure we fill in ncRoot_dn in getncchanges
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-09 18:18:26 +11:00
Andrew Tridgell
16eb25b35b s4-drs: use parentGUID attribute in getncchanges
Now that parentGUID is reliable again, use it instead
of building our own

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-09 18:18:25 +11:00
Andrew Tridgell
8d7a43fed7 s4-drs: fixed UDV and overlapping sync calls in DRS
When windows abandons a DRS sync, it will sometimes re-use the same bind handle for
a new sync. This means we need to check the DN of the sync and blank the getnc_state
if the DN has changed.

This also fixes the UDV to use the highest uSN for the partition, not for
the whole SAM.
2009-12-03 10:27:59 +11:00
Andrew Tridgell
92eff41ca5 s4-dsdb: some more attribuutes that we should only give if asked for 2009-11-20 15:19:35 +11:00
Andrew Tridgell
18cacc506e s4-drs: we need to specifically ask for ntSecurityDescriptor
ntSecurityDescriptor is no longer included by default
2009-11-20 14:57:04 +11:00
Erick Nascimento
a3632f22ec s4-drs: DsExecuteKCC() implementation
I implemented the DsExecuteKCC() handling code on kccsrv_execute_kcc().

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-11-14 12:11:02 +11:00
Andrew Tridgell
98e4393df9 s4-dsdb: create a static system_session context
This patch adds a system_session cache, preventing us from having to
recreate it on every ldb open, and allowing us to detect when the same
session is being used in ldb_wrap
2009-10-23 14:52:17 +11:00
Andrew Tridgell
95e895d880 s4: ran minimal_includes.pl on source4/rpc_server 2009-10-20 16:04:56 +11:00
Andrew Tridgell
d1784e7ca9 s4-drs: support DRSUAPI_DRS_ADD_REF flag
The DRSUAPI_DRS_ADD_REF flag tells the DRS server to run an UpdateRefs
call on behalf of the client after the DsGetNCChanges call. The lack
of support for this option may explain why the repsTo attribute was
not being created for w2k8-r2 replication partners.
2009-10-15 08:20:37 +11:00
Andrew Tridgell
59818f2f79 s4-drs: implement more of DsUpdateRefs
The DsUpdateRefs calls takes a set of flags that indicates if the
server should ignore specific add/delete error codes. 

This patch also exposes the core UpdateRefs call into a public
function, so that it can be called from DsGetNCChanges
2009-10-15 08:20:37 +11:00
Andrew Tridgell
f1bf262497 drs: improved error checking
Check the validity of the requested options in DsGetNCChanges
2009-10-15 08:20:37 +11:00
Matthias Dieter Wallnöfer
e9686985cb s4: Changes the old occurences of "lp_realm" in "lp_dnsdomain" where needed
For KERBEROS applications the realm should be upcase (function "lp_realm") but
for DNS ones it should be used lowcase (function "lp_dnsdomain"). This patch
implements the use of both in the right way.
2009-10-14 10:50:43 +02:00
Andrew Tridgell
4423173b08 s4-repl: check that a DsGetNCChanges is a continuation, and fix sorting
When we indicate that a getncchanges request is not complete, we set
the more_data flag to true in the response. The client usually then
asks for the next block of data. If the client decides it wants to
skip that replication and do a different replication then we need to
make sure that the next call is in fact a continuation of the existing
call, and not a new call.

This relies on returning the results sorted by uSNChanged, as the
client uses the tmp_highest_usn in each result to see if progress is
being made.
2009-10-13 13:09:07 +11:00
Andrew Tridgell
0c0eb14767 s4-drs: make DsBind a bit less verbose 2009-10-12 13:30:52 +11:00
Andrew Tridgell
a44030fc10 s4-drs: added some debug lines to DsAddEntry() 2009-10-06 18:59:47 +11:00
Andrew Tridgell
0285d568c5 s4-drs: take advantage of system session auth in dsbind
Now that the bind opens samdb with the right credentials, we no longer
need the re-open in updaterefs and getncchanges
2009-10-06 18:59:30 +11:00
Andrew Tridgell
f800d4998d s4-drs: fixed error message for drs_security_level_check 2009-10-06 18:58:41 +11:00
Andrew Tridgell
a021d55138 s4-drs: open samdb with system credentials when authorised
When a DC connects to DRS, open the samdb with system session
credentials, so that we don't have to re-open it each time on other
calls.
2009-10-06 18:58:13 +11:00
Andrew Tridgell
0d810fceaf s4-drs: removed debug code that replicated a maximum of 10 objects at a time 2009-09-28 10:24:58 +10:00
Andrew Tridgell
8aa85d7cbe s4-drsuapi: state variable for getncchanges 2009-09-28 10:24:50 +10:00
Andrew Tridgell
11efdc3ee2 s4-dsruapi: plugfest updates
- always fetch parentGUID from databases, don't rely on parentGUID in
  attributes

- re-fetch nc root mesages to avoid the problem of dual messages for
  roots

- support returning messages a chunk at a time, using max_object_count
  from request
2009-09-28 10:24:45 +10:00
Andrew Tridgell
b7dba6f16a s4-drsutil: allow NULL filter 2009-09-28 10:24:25 +10:00
Andrew Tridgell
42c3eca0d5 s4-drs: el may not be a talloc pointer
Use msg->elements for the new element values
2009-09-24 10:43:30 -07:00
Andrew Tridgell
baf93360a8 s4-drs: include deleted objects in getncchanges reply
Even though we don't create deleted objects ourselves yet, we need to
pass along deleted objects we receive from other replication partners
2009-09-24 10:35:40 -07:00
Anatoliy Atanasov
4f9de0e995 s4: Handle DRSUAPI_DS_REPLICA_NEIGHBOUR_SPECIAL_SECRET_PROCESSING in getncchanges
When this flag is specified in the request these attributes are treated as
secret: currentValue, dBCSPwd, initialAuthIncoming, initialAuthOutgoing,
lmPwdHistory, ntPwdHistory, priorValue, supplementalCredentials,
trustAuthIncoming, trustAuthOutgoing, unicodePwd
Their value is changed to NULL and the meta_data.originating_change_time to 0
2009-09-23 17:10:27 -07:00
Anatoliy Atanasov
23e4470c31 s4: Handle DRSUAPI_DS_REPLICA_NEIGHBOUR_ASYNC_REP in getncchanges
When this flag is specified in the request we should return
for ncRoot only and so scope of search is LDB_SCOPE_BASE.
2009-09-23 17:10:21 -07:00
Anatoliy Atanasov
97a9ae15b5 s4: Handle DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_SYNC_PACKET in getncchanges
When this flag is specified in the request we shouldn't use the
uptodateness vector in the request.
2009-09-23 17:10:12 -07:00
Anatoliy Atanasov
c9dc6506e6 s4: Handle DRSUAPI_DS_REPLICA_NEIGHBOUR_CRITICAL_ONLY req in getncchanges 2009-09-23 15:50:51 -07:00
Andrew Tridgell
10f86114de s4-drs: fill in more guids and SIDs, plus filter rDN
In DsGetNCChanges we need to fill in the parentGUID and objectGUID of
each object, plus we need to filter out the rDN from the meta data,
and always send the instanceType
2009-09-23 14:01:30 -07:00
Andrew Tridgell
af4c1f7fc6 s4-drsserver: fixed addition of sort control 2009-09-23 14:01:29 -07:00
Andrew Tridgell
ee4f7f1209 s4-drsserver: sort by DN to give tree order
This might help the windows client with ordered requests. Later we
need to support the "ancestors" mode flag.
2009-09-22 17:10:06 -07:00
Andrew Tridgell
bb3bdb3a62 s4-ldb: added a bunch more debug for DC join
These additional debug messages were added to help us track down
w2k8->s4 domain join
2009-09-22 17:10:06 -07:00
Andrew Tridgell
d5b9409e63 s4-drs: security checking on DRS needs to default to on 2009-09-19 19:39:42 -07:00
Andrew Tridgell
ad53c34b6b s4-repl: need param.h for lp_parm_bool 2009-09-19 15:53:22 -07:00
Anatoliy Atanasov
0b68967096 Move replmd_drsuapi_DsReplicaCursor2_compare to a common place. 2009-09-19 15:42:00 -07:00
Anatoliy Atanasov
6e56261eb7 Add drs_security_level_check for dcesrv calls security checks
There is also an option to disable the security check
by specifying in the smb.conf file:
drs:disable_sec_check = true
2009-09-19 15:39:40 -07:00
Andrew Tridgell
1261d694f0 more include minimisation 2009-09-19 14:12:01 -07:00
Andrew Tridgell
86383f0003 s4-rpc_server: removed remaining unnecessary #includes 2009-09-19 14:11:34 -07:00
Andrew Tridgell
8ea2cb2403 idl: added DsExecuteKCC IDL 2009-09-17 00:05:22 -07:00
Andrew Tridgell
30d13288e5 s4-repl: take advantage of async RPC forwarding
This uses async RPC forwarding for the DsReplicaSync call
2009-09-15 20:51:10 -07:00
Andrew Tridgell
5d2dfd12cf s4-drs: lock down key DRS calls
The key DRS calls should only be allowed by administrators or domain
controllers
2009-09-15 19:52:25 -07:00
Andrew Tridgell
9e0b1a3a1f s4-drs: filter based on local_usn
The getncchanges uSN is in our local space, so we must compare it to
the local_usn in replPropertyMetaData
2009-09-15 18:45:42 -07:00
Andrew Tridgell
b9ce122ff2 s4-drs: allow replication of renames
a rename may have no attribute changes
2009-09-14 13:12:32 -07:00
Andrew Tridgell
348efd5cbb s4-drs: fixed search expression
At least on the command line the braces are needed. Strange.
2009-09-13 16:40:00 -07:00
Andrew Tridgell
1820f4bdaf s4-drs: change debug level
It's useful seeing the object count without as much detail
2009-09-12 15:23:30 +10:00
Andrew Tridgell
a8ab1e2570 s4-drs: also fill in tmp_highest_usn
Without this the client will not update its repsFrom highest_usn values
2009-09-12 13:06:32 +10:00
Andrew Tridgell
493166b009 s4-drs: return objects with uSN > highest_usn
When the client tells us the highest_usn they have is N, then we want
to send them objects with usn>N, not>=N, as otherwise we end up
sending them the same object (the one with the highest uSN) again and
again.
2009-09-12 12:42:40 +10:00
Andrew Tridgell
0819e79c4f s4-drs: spelling fix, and simpler search expression
uSNChanged>=N is good enough, and offers a possibility of a simple
optimisation where the partition module could look for that expression
and check the partitions sequence number, then avoid searching a
partition that doesn't have any records with a larger uSN.
2009-09-12 12:08:34 +10:00
Andrew Tridgell
bbc0a56da5 s4-drs: fixed the cursor generation to always be filled in
We were relying on the uSNChanged>=n search always finding the DN of
the root of the partition, but this now doesn't happen very often as
we are now restricting when we change uSNChanged. This means we need
to always load the replUpToDateVector attribute from the NC root and
use it to populate the cursors in the return.
2009-09-12 11:15:28 +10:00
Andrew Tridgell
5da0a7e1a1 s4-repl: use common functions to simplify updaterefs.c
We now have dsdb_loadreps() and dsdb_savereps()
2009-09-12 11:15:27 +10:00
Anatoliy Atanasov
9014cb64fd Fix up-to-dateness vector creation. 2009-09-12 11:15:26 +10:00
Andrew Tridgell
97182d52df s4-drs: fixed the ldap SPN in AddEntry 2009-09-11 23:14:07 +10:00
Andrew Tridgell
d7d7613e31 s4-idl: added the IDL for the DsReplica* calls 2009-09-11 22:13:45 +10:00
Andrew Tridgell
8c58cef875 s4-drs: actually call the new drsuapi_add_SPNs() code
An early return here didn't do any good :-)
2009-09-11 17:13:28 +10:00
Andrew Tridgell
88e2fbaf95 s4-drs: add the magic DRS SPNs on AddEntry
When a DsAddEntry is used to create a nTDSDSA object we need to also
create the SPNs for the NTDS GUID in the servers machine account.
2009-09-11 15:15:39 +10:00
Andrew Tridgell
fdb8758e69 s4/drs: parentGUID needs to be specififcally asked for
Right now parentGUID is a normal attribute in s4, but it should be
generated, which means we need to ask for it in a search if we want to
use it.
2009-09-11 14:07:19 +10:00
Andrew Tridgell
3e7a3bc9bd s4/drs: enable attribute encryption
This means we now get passwords vampired correctly for s4<->s4
replication.
2009-09-10 17:46:30 +10:00
Andrew Tridgell
a08d17342d s4/drs: changed the UpdateRefs server to use the dn instead of the GUID
Our vampire code sends a zero GUID in the updaterefs calls. Windows
seems to ignore the GUID and use the DN in the naming context instead,
so I have changed our UpdateRefs server implementation to do the same.

With this change we can now vampire from s4<->s4 successfully! Now to
see if all the attributes came across correctly.
2009-09-10 14:28:24 +10:00
Andrew Tridgell
0c03232259 s4/drs: correctly fill in the GUID of DRS objects 2009-09-10 13:51:08 +10:00
Andrew Tridgell
78a5a5e665 s4: fix spelling 2009-09-10 13:50:46 +10:00
Andrew Tridgell
b65d6cf013 s4/drs: when we don't find an attribute use zero values
thanks to metze for pointing this out
2009-09-10 01:27:12 +10:00
Andrew Tridgell
a84a82335c s4:drs match the meta_data and attributes array
These two arrays need to be in sync, as they are walked in sync by the
client
2009-09-09 23:38:51 +10:00
Andrew Tridgell
e595ba2105 s4/drs: broke out the core of the getncchanges code
It is easier to understand without the heavy nesting
2009-09-09 21:26:17 +10:00
Andrew Tridgell
9721b1b7c0 s4:drs level_out is a pointer
DsAddEntry now seems to work for simple tests
2009-09-09 21:06:36 +10:00
Andrew Tridgell
51baffab5f s4:drs split addentry and getncchanges into separate files
These will get quite complex eventually, I think we are better
separating them so the code is a bit easier to follow
2009-09-09 21:06:36 +10:00
Andrew Tridgell
8640293fab s4/repl: implement DsReplicaSync
This patch implements DsReplicaSync by passing the call via irpc to
the repl server task. The repl server then triggers an immediate
replication of the specified partition.

This means we no longer need to set a small value for
dreplsrv:periodic_interval to force frequent DRS replication. We can
now wait for the DC to send us a ReplicaSync msg for any partition
that changes, and we immediately sync that partition.
2009-09-09 18:04:07 +10:00
Andrew Tridgell
dca7afb799 s4: fixed format of repsTo in samdb
Metze pointed out what the windows tool ldp.exe will examine repsTo
attributes on remote DCs, so we do in fact need to use the same format
that windows uses. This patch changes the server side implementation
of UpdateRefs to use the windows format
2009-09-09 12:36:51 +10:00
Stefan Metzmacher
d04cca005c s3:drsuapi: add a simple DsRemoveDSServer() implementation
metze
2009-09-08 22:06:02 +02:00
Stefan Metzmacher
5ef601e5eb s4:drsuapi: add an incomplete DsAddEntry implementation
metze
2009-09-08 22:05:56 +02:00
Andrew Tridgell
91805627c9 s4: implemented server side of DSUpdateRefs call
This call is made by DCs to tell us we should notify them of directory
changes
2009-09-08 11:52:45 +10:00
Anatoliy Atanasov
e6816715b7 Fill the meta data vector in the responce struct. 2009-09-08 11:52:44 +10:00
Anatoliy Atanasov
38995d7cbb First attempt to implement dcesrv_drsuapi_DsGetNCChanges
So far it returns the ctr6 responce without proper linked attributes
support and metadata. A couple of improvements are the filter in the search
uses '(uSNChanged>=N)', added extended dn search support, non-replicated attributes
are excluded from the result.
2009-09-03 19:10:49 +10:00
Jelmer Vernooij
87ec1d2532 Make sure prototypes are always included, make some functions static and
remove some unused functions.
2008-10-20 18:59:51 +02:00
Günther Deschner
6ddaf5f160 s4-drsuapi: merge drsuapi_DsCrackNames from s3 drsuapi idl.
Guenther
2008-10-18 23:06:31 +02:00
Günther Deschner
ca84c406d3 s4-drsuapi: merge drsuapi_DsGetDomainControllerInfo from s3 drsuapi idl.
Guenther
2008-10-18 23:06:24 +02:00
Günther Deschner
32a1d55797 s4-drsuapi: merge drsuapi_DsWriteAccountSpn from s3 drsuapi idl.
Guenther
2008-10-18 23:06:17 +02:00
Simo Sorce
508527890a Merge ldb_search() and ldb_search_exp_fmt() into a simgle function.
The previous ldb_search() interface made it way too easy to leak results,
and being able to use a printf-like expression turns to be really useful.
2008-09-23 18:17:46 -04:00
Michael Adam
7fba6c649b Change occurrences of the u1 member of DsBindInfo* to pid after idl change.
Michael
(This used to be commit b91bbc5fe4)
2008-07-22 15:35:23 +02:00
Jelmer Vernooij
21fc767378 Specify event_context to ldb_wrap_connect explicitly.
(This used to be commit b4e1ae07a2)
2008-04-17 12:23:44 +02:00
Jelmer Vernooij
0500b87092 r26540: Revert my previous commit after concerns raised by Andrew.
(This used to be commit 6ac86f8be7)
2007-12-21 05:52:06 +01:00
Jelmer Vernooij
3e75f222bc r26539: Remove unnecessary statics.
(This used to be commit e53e79eebe)
2007-12-21 05:52:05 +01:00
Jelmer Vernooij
57f20ccd24 r26296: Store loadparm context in DCE/RPC server context.
(This used to be commit fc1f4d2d65)
2007-12-21 05:48:13 +01:00
Jelmer Vernooij
f4a1083cf9 r26227: Make loadparm_context part of a server task, move loadparm_contexts further up the call stack.
(This used to be commit 0721a07aad)
2007-12-21 05:47:04 +01:00
Andrew Bartlett
25143a2648 r26135: Remove samdb_add(), samdb_delete() and samdb_modify(), which were just
wrappers to ldb_add() etc.  samdb_replace() remains, as it sets flags on
all entries as 'replace'.

Andrew Bartlett
(This used to be commit 09c0faa5b7)
2007-12-21 05:46:17 +01:00
Andrew Bartlett
3f2ca10d2d r25940: Rework the samldb and templates handling.
Templates just don't belong in the sam.ldb, as they don't obey any of
the other rules.  This moves them to a seperate templates.ldb.

In samldb, this patch reworks the duplicate SID and Name detection
code, to use ldb_search_exp_fmt() rather than gendb_search.  This
returns far more useful errors, which we now handle and report better.

The call to samdb_search_for_parent_domain() has been moved in samldb,
to allow both the account and SID uniqueness checks to be in the same
domain.  This function also returns better errors.

dcesrv_drsuapi.c is updated for the new prototype of
samdb_search_for_parent_domain()

Andrew Bartlett
(This used to be commit f1ab90c88c)
2007-12-21 05:45:10 +01:00
Jelmer Vernooij
05e7c48146 r25553: Convert to standard bool type.
(This used to be commit b7371f1a19)
2007-10-10 15:07:54 -05:00
Andrew Bartlett
58d9f6ed9d r24246: Avoid the annoying 'probable memory leak in ldb' messages, by fixing
some issues in the NBT server (this was a false positive, but easily
worked around) and DRSUAPI server.

We should take care not to use the ldb_context as a talloc pool, and
to always ensure that any results from ldb_search() are moved off that
pool with talloc_steal or talloc_free().

To work around the issue in provision, for which I can find no fault
(other than a lot of work being done in provision), I've moved the
detector trigger to 400 additional blocks.

This fixes Bug #4810 by <mwallnoefer@yahoo.de>

Andrew Bartlett
(This used to be commit 42bcf85620)
2007-10-10 15:01:29 -05:00
Andrew Tridgell
0479a2f1cb r23792: convert Samba4 to GPLv3
There are still a few tidyups of old FSF addresses to come (in both s3
and s4). More commits soon.
(This used to be commit fcf38a38ac)
2007-10-10 14:59:12 -05:00
Günther Deschner
4d1a21f24d r23239: Fill in drsuapi_QuerySitesByCost.
Guenther
(This used to be commit cf953d0481)
2007-10-10 14:53:06 -05:00
Andrew Bartlett
a62b46b4b2 r22477: When an invaild base is specified to ldb_search, it should return
LDB_ERR_NO_SUCH_OBJECT.  Handle this (found against LDAP, ldb_tdb is
being updated).

Andrew Bartlett
(This used to be commit 93e2ff2e85)
2007-10-10 14:51:31 -05:00
Stefan Metzmacher
89e28a0ec8 r21512: finish DsBind() in the DRSUAPI server:
- fill in our on bind_info struct correctly
- remember the local and remote DsBindInfo28 struct
- remember the remote bind_buid

w2k3 now tries replicate using DsGetNCChanges() from us,
after the NET-API-BECOME-DC test created the domain controller
and replicated all data.

(But we still give a DCERPC fault in DsGetNCChanges()...)

metze
(This used to be commit 33550c063d)
2007-10-10 14:48:47 -05:00
Stefan Metzmacher
ced4976d94 r21356: we have a function to get the sites dn
also it's not always under the domain dn

metze
(This used to be commit b8c940f1e2)
2007-10-10 14:48:18 -05:00
Jelmer Vernooij
64e88a8ccf r20850: Prefix all server calls with dcesrv_
(This used to be commit 76c78b0339)
2007-10-10 14:43:39 -05:00
Stefan Metzmacher
57f5bf78fa r20514: implement idl for DsGetNT4ChangeLog() which transferres the meta data
for NT4 DC's in mixed mode domains.

This call is triggered by tranferring the PDC FSMO Role to another DC

the real meta data is encoded in the user buffer which is just a DATA_BLOB in idl

metze
(This used to be commit d883815c8d)
2007-10-10 14:36:04 -05:00
Andrew Bartlett
f4fd6d97e6 r20374: It's still 2006 (just...). Add copyright.
Andrew Bartlett
(This used to be commit 21b38ae1e4)
2007-10-10 14:30:18 -05:00
Andrew Bartlett
ea4c64388b r20353: Restructure the DRSUAPI DsGetDomainControllerInfo test, because as
usual things are more complex than they appear.

Also remove the incorrect server-side implementation, which blindly
assumed some sense of consistancy across the API switch levels.

Andrew Bartlett
(This used to be commit 79941adbff)
2007-10-10 14:30:15 -05:00
Andrew Bartlett
400a56d6dd r20315: Implement the server side of DsGetDomainControllerInfo. This is a
supprisingly complex call...

It turns out that the in/out parameter 'level' is not in/out, but set
seperatly by the server-side code from r->req.req1.level.

This commit also breaks out some common code from samldb into samdb.

Andrew Bartlett
(This used to be commit 2eb9e6445c)
2007-10-10 14:29:38 -05:00
Stefan Metzmacher
9671a72a4c r19847: add idl for DsRemoveDSServer(), this is used when a server unbecomes a DC
metze
(This used to be commit df133cd22a)
2007-10-10 14:28:25 -05:00
Simo Sorce
a9e31b33b5 r19832: better prototypes for the linearization functions:
- ldb_dn_get_linearized
  returns a const string

- ldb_dn_alloc_linearized
  allocs astring with the linearized dn
(This used to be commit 3929c086d5)
2007-10-10 14:28:22 -05:00
Simo Sorce
4889eb9f7a r19831: Big ldb_dn optimization and interfaces enhancement patch
This patch changes a lot of the code in ldb_dn.c, and also
removes and add a number of manipulation functions around.

The aim is to avoid validating a dn if not necessary as the
validation code is necessarily slow. This is mainly to speed up
internal operations where input is not user generated and so we
can assume the DNs need no validation. The code is designed to
keep the data as a string if possible.

The code is not yet 100% perfect, but pass all the tests so far.
A memleak is certainly present, I'll work on that next.

Simo.
(This used to be commit a580c871d3)
2007-10-10 14:28:22 -05:00
Andrew Bartlett
08452bd738 r19761: This may need work, but here is an initial implementation of
DsWriteAccountSpn().

It passes the client toture test.

Andrew Bartlett
(This used to be commit a1e80eeb95)
2007-10-10 14:28:20 -05:00
Günther Deschner
eda5759e45 r16796: Fill in dsr_GetMemberships() / dsr_GetMemberships2().
This intersting call is apparently used to construct the user token,
collect memberships from other DSAs and to retrieve (nested) memberships
of a given group.

Torture test to follow (once I cleaned it up).

Guenther
(This used to be commit ca5e133e8c)
2007-10-10 14:09:46 -05:00
Stefan Metzmacher
657325d684 r15319: remove unneeded macros
metze
(This used to be commit 9611c8aa9c)
2007-10-10 14:05:14 -05:00
Jelmer Vernooij
d4de4c2d21 r12608: Remove some unused #include lines.
(This used to be commit 70e7449318)
2007-10-10 13:49:03 -05:00
Jelmer Vernooij
2cd5ca7d25 r12542: Move some more prototypes out to seperate headers
(This used to be commit 0aca5fd513)
2007-10-10 13:47:55 -05:00
Andrew Bartlett
db4b95827e r11270: Move the core CrackNames code from rpc_server/drsuapi to dsdb/samdb.
I'm sure this will not be the final resting place, but it will do for
now.

Use the cracknames code in auth/ for creating a server_info given a
principal name only (should avoid assumtions about spliting a
user@realm principal).

Andrew Bartlett
(This used to be commit c9d5d8e45d)
2007-10-10 13:45:11 -05:00
Andrew Bartlett
16bbafb7e8 r11239: Use ${REALM} for the realm in rootdse.ldif
Add the kpasswd server to our KDC, implementing the 'original' and
Microsoft versions of the protocol.

This works with the Heimdal kpasswd client, but not with MIT, I think
due to ordering issues.  It may not be worth the pain to have this
code go via GENSEC, as it is very, very tied to krb5.

This gets us one step closer to joins from Apple, Samba3 and other
similar implementations.

Andrew Bartlett
(This used to be commit ab5dbbe10a)
2007-10-10 13:45:06 -05:00
Andrew Bartlett
b4b75ddb5a r11223: Only pass around the ldb handle (make this code easier to seperate
into a general lib).

Andrew Bartlett
(This used to be commit e3abbfca4a)
2007-10-10 13:45:05 -05:00
Andrew Bartlett
ddb1c4aa13 r11194: Use the special ldb attribute "canonicalName" (therefore testing that
codepath) in DRSUAPI CrackNames.

Fix the NT4 account return value.

Andrew Bartlett
(This used to be commit 2513c02c64)
2007-10-10 13:44:59 -05:00
Andrew Bartlett
d96f706bb0 r10953: Add a new function to form a canonicalName out of a DN to ldb_dn.c
Use this new function in the client and server for the CrackNames
case, where we particularly need it.

Andrew Bartlett
(This used to be commit 380037ee09)
2007-10-10 13:39:45 -05:00
Andrew Tridgell
36d73b0e71 r10894: make the handling of dn/distinguishedName much closer to real
ldap. Also ensure we put a objectclass on our private ldb's, so they
have some chance of being stored in ldap if you want to
(This used to be commit 1af2cc067f)
2007-10-10 13:39:40 -05:00
Andrew Bartlett
dddaa5204e r10811: Revert accidental commit, I still need to finish the displayName and
syntatical mapping work.

Andrew Bartlett
(This used to be commit 7ec5084f63)
2007-10-10 13:39:32 -05:00
Andrew Bartlett
1377cca5f4 r10810: This adds the hooks required to communicate the current user from the
authenticated session down into LDB.  This associates a session info
structure with the open LDB, allowing a future ldb_ntacl module to
allow/deny operations on that basis.

Along the way, I cleaned up a few things, and added new helper functions
to assist.  In particular the LSA pipe uses simpler queries for some of
the setup.

In ldap_server, I have removed the 'ldasrv:hacked' module, which hasn't
been worked on (other than making it continue to compile) since January,
and I think the features of this module are being put into ldb anyway.

I have also changed the partitions in ldap_server to be initialised
after the connection, with the private pointer used to associate the ldb
with the incoming session.

Andrew Bartlett
(This used to be commit fd7203789a)
2007-10-10 13:39:32 -05:00
Andrew Bartlett
f3bce652c8 r10286: This patch is ugly and disgusting, but for now it works better than the other
ideas I have had.

When I get a full list of things I want to do to a krb5_context I'll
either add gsskrb5_ wrappers, or a way of speicfying the krb5 context
per gssapi context.

(I want to ensure that the only krb5_context variables created while
executing Samba4 are via our wrapper).

Andrew Bartlett
(This used to be commit 8a22d46e70)
2007-10-10 13:38:13 -05:00
Andrew Bartlett
1da54ac07c r10045: metze reminded me to use the correct enum entry, rather than 0 for the
return here.

Andrew Bartlett
(This used to be commit 73bd6c7534)
2007-10-10 13:36:32 -05:00
Tim Potter
5d2d627cde r9980: Fix some warnings.
(This used to be commit 716011dd92)
2007-10-10 13:36:26 -05:00
Andrew Bartlett
cf5ea56300 r9942: CN=Configuration is always under the database-wide base dn, so don't
try and pass it down as a parameter.

Andrew Bartlett
(This used to be commit 530d91de7c)
2007-10-10 13:36:24 -05:00
Andrew Bartlett
b3c0dacd20 r9941: Update the CrackNames test, and provide a much improved server-side
DRSUAPI CrackNames.

We can't pass the full cracknames test until the initial provision is
updated, the seperate DomainControllerInfo and canonical names support
is added.

Andrew Bartlett
(This used to be commit ed24d88f0e)
2007-10-10 13:36:24 -05:00
Simo Sorce
3e4c4cff21 r9391: Convert all the code to use struct ldb_dn to ohandle ldap like distinguished names
Provide more functions to handle DNs in this form
(This used to be commit 692e35b779)
2007-10-10 13:33:32 -05:00
Andrew Bartlett
14fd6efaf5 r8998: More work on the RPC server code to avoid abusing the name attribute
as a netbios name.

Andrew Bartlett
(This used to be commit 242db48b98)
2007-10-10 13:31:05 -05:00
Andrew Bartlett
4fd6c8e9cf r8984: Use the correct cross-reference search in DRSUAPI, rather than making
assumptions about the behaviour of "name" as a NETBIOS domain name.

Andrew Bartlett
(This used to be commit ba5fe07b97)
2007-10-10 13:31:03 -05:00
Stefan Metzmacher
a4c614b012 r8371: the objectGUID is now stored in binary...
metze
(This used to be commit b920b306b3)
2007-10-10 13:20:13 -05:00
Andrew Bartlett
79f6bcd5ae r5988: Fix the -P option (use machine account credentials) to use the Samba4
secrets system, and not the old system from Samba3.

This allowed the code from auth_domain to be shared - we now only
lookup the secrets.ldb in lib/credentials.c.

In order to link the resultant binary, samdb_search() has been moved
from deep inside rpc_server into lib/gendb.c, along with the existing
gendb_search_v().  The vast majority of this patch is the simple
rename that followed,

(Depending on the whole SAMDB for just this function seemed pointless,
and brought in futher dependencies, such as smbencrypt.c).

Andrew Bartlett
(This used to be commit e13c671619)
2007-10-10 13:11:12 -05:00
Stefan Metzmacher
4b83366b6c r5742: - add torture test and idl for DsReplicaUpdateRefs()
(the torture test currently only tests if the idl is correct)

- add start for idl for DsGetNCChanges()
  (if someone didn't noticed the current ethereal trunk code can
   successful decrypt DCERPC and LDAP gsskrb5 encrypted blobs,
   when you provide a keytab and have compiled against heimdal :-)

- add a view bitmaps and enum's for better debugging

metze
(This used to be commit cf7c1352ab)
2007-10-10 13:11:01 -05:00
Andrew Tridgell
e82aad1ce3 r5298: - got rid of pstring.h from includes.h. This at least makes it a bit
less likely that anyone will use pstring for new code

 - got rid of winbind_client.h from includes.h. This one triggered a
   huge change, as winbind_client.h was including system/filesys.h and
   defining the old uint32 and uint16 types, as well as its own
   pstring and fstring.
(This used to be commit 9db6c79e90)
2007-10-10 13:09:38 -05:00
Andrew Tridgell
759da3b915 r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for the
large commit. I thought this was worthwhile to get done for
consistency.
(This used to be commit ec32b22ed5)
2007-10-10 13:09:15 -05:00
Andrew Tridgell
577218b2ad r4640: first stage in the server side support for multiple context_ids on one pipe
this stage does the following:

 - simplifies the dcerpc_handle handling, and all the callers of it

 - split out the context_id depenent state into a linked list of established contexts

 - fixed some talloc handling in several rpc servers that i noticed while doing the above
(This used to be commit fde042b3fc)
2007-10-10 13:08:38 -05:00
Stefan Metzmacher
75f02f9d4d r4203: the bind_info blob isn't a const.
here's the idl to parse it, because we don't want the
callers to manually de/encode this

metze
(This used to be commit 983f74c365)
2007-10-10 13:07:26 -05:00
Stefan Metzmacher
57314e0df3 r4087: - add idl and torture tests for drsuapi_DsReplicaGetInfo()
(NOTE: that the drsuapi_DsReplicaObjMetaData2 struct is not corrently parsed yet
 and there're some unknown fields left in someother infotypes)

metze
(This used to be commit 4fd57d5e7c)
2007-10-10 13:06:25 -05:00
Stefan Metzmacher
114b43a167 r3999: - reply with the same DsBindInfo blob as w2k3 in the server function
- add idl for drsuapi_DsReplicaSync() not yet complete

- just return WERR_OK for the drsuapi_DsReplicaSync() server function

metze
(This used to be commit e896925ac0)
2007-10-10 13:06:12 -05:00
Stefan Metzmacher
2f39a9fe62 r3920: - it seem that we need to send a magic bind_guid in DsBind()
to make DsWriteAccountSpn() work

- add idl and torture test for DsWriteAccountSpn()

metze
(This used to be commit 625826ad90)
2007-10-10 13:06:06 -05:00
Stefan Metzmacher
83d29e9bac r3789: - fix error handling
- formating changes

metze
(This used to be commit 7bb3e3751b)
2007-10-10 13:05:53 -05:00
Stefan Metzmacher
43f500244b r3784: do a samdb lookup for the DsCrackNames server
metze
(This used to be commit a2776eca83)
2007-10-10 13:05:53 -05:00
Andrew Tridgell
c051779a0a r3468: split out dcerpc_server.h
(This used to be commit 729e0026e4)
2007-10-10 13:05:17 -05:00
Andrew Tridgell
90067934cd r3428: switched to using minimal includes for the auto-generated RPC code.
The thing that finally convinced me that minimal includes was worth
pursuing for rpc was a compiler (tcc) that failed to build Samba due
to reaching internal limits of the size of include files. Also the
fact that includes.h.gch was 16MB, which really seems excessive. This
patch brings it back to 12M, which is still too large, but
better. Note that this patch speeds up compile times for both the pch
and non-pch case.

This change also includes the addition iof a "depends()" option in our
IDL files, allowing you to specify that one IDL file depends on
another. This capability was needed for the auto-includes generation.
(This used to be commit b8f5fa8ac8)
2007-10-10 13:05:09 -05:00
Stefan Metzmacher
1890e6a659 r2992: drsuapi uses WERROR not NTSTATUS
metze
(This used to be commit 757f67c08b)
2007-10-10 12:59:55 -05:00
Stefan Metzmacher
f4e4989cb7 r2991: add drsuapi_DsGetDomainControllerInfo() idl and torture test
metze
(This used to be commit 98ca7640c5)
2007-10-10 12:59:55 -05:00
Stefan Metzmacher
c88518cc0e r2974: fix the build
metze
(This used to be commit 1bb71e7a86)
2007-10-10 12:59:53 -05:00
Stefan Metzmacher
64344b88d1 r2970: - give somefields names and typdef enums for the possible values
- do more crackname tests in the torture test

- move server code for cracknames to a different file

metze
(This used to be commit 18050ea603)
2007-10-10 12:59:53 -05:00
Stefan Metzmacher
b5fde9d2df r2954: add server cracknames code:
- we currently only do it for our REALM

metze
(This used to be commit e2df8c4285)
2007-10-10 12:59:51 -05:00
Stefan Metzmacher
78e29c0491 r2952: add idl and torture test for DsCrackNames
(I need to find out what the fields mean but it works)

metze
(This used to be commit eff51fc623)
2007-10-10 12:59:51 -05:00
Stefan Metzmacher
3dd56175ab r2889: add DRSUAPI server
- with DsBind and DsUnbind implmented :-)
  the RPC-DRSUAPI test works

metze
(This used to be commit 536af87ef1)
2007-10-10 12:59:42 -05:00