1
0
mirror of https://github.com/samba-team/samba.git synced 2025-10-26 23:33:15 +03:00
Commit Graph

164 Commits

Author SHA1 Message Date
Andrew Bartlett
e902274321 r12599: This new LDB module (and associated changes) allows Samba4 to operate
using pre-calculated passwords for all kerberos key types.
(Previously we could only use these for the NT# type).

The module handles all of the hash/string2key tasks for all parts of
Samba, which was previously in the rpc_server/samr/samr_password.c
code.  We also update the msDS-KeyVersionNumber, and the password
history.  This new module can be called at provision time, which
ensures we start with a database that is consistent in this respect.

By ensuring that the krb5key attribute is the only one we need to
retrieve, this also simplifies the run-time KDC logic.  (Each value of
the multi-valued attribute is encoded as a 'Key' in ASN.1, using the
definition from Heimdal's HDB.  This simplfies the KDC code.).

It is hoped that this will speed up the KDC enough that it can again
operate under valgrind.
2007-10-10 13:49:01 -05:00
Jelmer Vernooij
0aca5fd513 r12542: Move some more prototypes out to seperate headers 2007-10-10 13:47:55 -05:00
Andrew Bartlett
dc091c6c06 r12506: Fix up issues shown up by the expanded RPC-SAMR testsuite, and add ldb
transactions to the SAMR password change code.

Andrew Bartlett
2007-10-10 13:47:47 -05:00
Andrew Bartlett
07b885d0c7 r12504: Fix one more transaction cancel bail-out path, and correct comments.
Andrew Bartlett
2007-10-10 13:47:46 -05:00
Andrew Bartlett
2eebd7b3cf r12503: This function was just too simple to leave unimplemented.
Andrew Bartlett
2007-10-10 13:47:46 -05:00
Andrew Bartlett
2c8b988eb8 r12432: Re-indent and consistantly cancel the transaction.
Andrew Bartlett
2007-10-10 13:47:38 -05:00
Andrew Bartlett
c4520ba2e6 r12427: Move SAMR CreateUser2 to transactions, and re-add support for
different computer account types.  (Earlier code changes removed the
BDC case).

We don't use the TemplateDomainController, so just have a
TemplateServer in provision_templates.ldif

Andrew Bartlett
2007-10-10 13:47:37 -05:00
Andrew Bartlett
8308cf6e04 r12361: Add a new function: ldb_binary_encode_string()
This is for use on user-supplied arguments to printf style format
strings which will become ldb filters.  I have used it on LSA, SAMR
and the auth/ code so far.

Also add comments to cracknames code.

Andrew Bartlett
2007-10-10 13:47:30 -05:00
Andrew Tridgell
1af2cc067f 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
2007-10-10 13:39:40 -05:00
Andrew Bartlett
fd7203789a 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
2007-10-10 13:39:32 -05:00
Andrew Bartlett
0761b22f99 r9930: Use a single samdb_base_dn() function rather than lots of silly
searches all over the place.

This can be extended to cover an NT4 (no ADS) mode in future as well.

Andrew Bartlett
2007-10-10 13:36:23 -05:00
Simo Sorce
333ebb40d5 r9654: introduce the samdb_search_dn call 2007-10-10 13:34:38 -05:00
Simo Sorce
31c69d0655 r9392: Fix ldb_dn_compose to make build farm happy
Add ldb_dn_string_compose so that you can build a dn starting from a
struct ldb_dn base and a set of parameters to be composed in a format
string with the same syntax of printf
2007-10-10 13:33:33 -05:00
Simo Sorce
692e35b779 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
2007-10-10 13:33:32 -05:00
Andrew Bartlett
2beb694226 r9015: Fix access to BUILTIN again.
Andrew Bartlett
2007-10-10 13:31:08 -05:00
Andrew Bartlett
0f7b1136f6 r9011: Remove more references to "name" as a netbios name, using the
cross-reference instead.

Andrew Bartlett
2007-10-10 13:31:07 -05:00
Andrew Bartlett
1f071b0609 r8790: Finish the migration of aliases and privilages with SamSync, by adding
templating support for foreignSecurityPrincipals to the samdb module.
This is an extension beyond what microsoft does, and has been very
useful :-)

The setup scripts have been modified to use the new template, as has
the SAMR and LSA code.

Other cleanups in LSA remove the assumption that the short domain name
is the first component of the realm.

Also add a lot of useful debug messages, to make it clear how/why the
SamSync may have gone wrong.  Many of these should perhaps be hooked
into an error string.

Andrew Bartlett
2007-10-10 13:30:05 -05:00
Andrew Bartlett
968bcc4fe8 r8670: Remove GUID code from SAMR, it is handled lower down now. I notice
this code also does string SIDs, but I'm not quite sure where that
fits in.

Andrew Bartlett
2007-10-10 13:29:52 -05:00
Andrew Tridgell
a58ea6b385 r8520: fixed a pile of warnings from the build farm gcc -Wall output on
S390. This is an attempt to avoid the panic we're seeing in the
automatic builds.

The main fixes are:

 - assumptions that sizeof(size_t) == sizeof(int), mostly in printf formats

 - use of NULL format statements to perform dn searches.

 - assumption that sizeof() returns an int
2007-10-10 13:29:34 -05:00
Stefan Metzmacher
206f33778e r8370: remove the '$' from in the cn: attribute for computer and dc accounts
metze
2007-10-10 13:20:12 -05:00
Stefan Metzmacher
e601042c07 r8232: remove samr_String and netr_String as they are the same as lsa_String
metze
2007-10-10 13:19:22 -05:00
Andrew Bartlett
e2015671c2 r7993: Further work on the Krb5 PAC.
We now generate the PAC, and can verifiy both our own PAC and the PAC
from Win2k3.

This commit adds the PAC generation code, spits out the code to get
the information we need from the NETLOGON server back into a auth/
helper function, and adds a number of glue functions.

In the process of building the PAC generation code, some hints in the
Microsoft PAC specification shed light on other parts of the code, and
the updates to samr.idl and netlogon.idl come from those hints.

Also in this commit:

The Heimdal build package has been split up, so as to only link the
KDC with smbd, not the client utils.

To enable the PAC to be veified with gensec_krb5 (which isn't quite
dead yet), the keyblock has been passed back to the calling layer.

Andrew Bartlett
2007-10-10 13:18:57 -05:00
Andrew Tridgell
d40bc2fa8d r7860: switch our ldb storage format to use a NDR encoded objectSid. This is
quite a large change as we had lots of code that assumed that
objectSid was a string in S- format.

metze and simo tried to convince me to use NDR format months ago, but
I didn't listen, so its fair that I have the pain of fixing all the
code now :-)

This builds on the ldb_register_samba_handlers() and ldif handlers
code I did earlier this week. There are still three parts of this
conversion I have not finished:

 - the ltdb index records need to use the string form of the objectSid
   (to keep the DNs sane). Until that it done I have disabled indexing on
   objectSid, which is a big performance hit, but allows us to pass
   all our tests while I rejig the indexing system to use a externally
   supplied conversion function

 - I haven't yet put in place the code that allows client to use the
   "S-xxx-yyy" form for objectSid in ldap search expressions. w2k3
   supports this, presumably by looking for the "S-" prefix to
   determine what type of objectSid form is being used by the client. I
   have been working on ways to handle this, but am not happy with
   them yet so they aren't part of this patch

 - I need to change pidl to generate push functions that take a
   "const void *" instead of a "void*" for the data pointer. That will
   fix the couple of new warnings this code generates.

Luckily it many places the conversion to NDR formatted records
actually simplified the code, as it means we no longer need as many
calls to dom_sid_parse_talloc(). In some places it got more complex,
but not many.
2007-10-10 13:18:44 -05:00
Simo Sorce
a614466dec r7582: Better way to have a fast path searching for a specific DN.
Old way was ugly and had a bug, you couldn't add an attribute named
dn or distinguishedName and search for it, tdb would change that search in a dn search.
This makes it also possible to search by dn against an ldap server as the old method was
not supported by ldap syntaxes.

sss
2007-10-10 13:18:11 -05:00
Andrew Tridgell
9e428881f6 r7507: fixed the problem with users being shown too many times in acl
editors, and added a test for it.
2007-10-10 13:18:02 -05:00
Andrew Bartlett
d9c31e60a7 r6544: Use common structures between SAMR, NETLGON and the Krb5 PAC.
Fill out the group list for the SamLogon reply, so clients get the
supplementary groups.

Andrew Bartlett
2007-10-10 13:16:24 -05:00
Simo Sorce
4f0948dab0 r6470: Remove ldb_search_free() it is not needed anymore.
Just use talloc_free() to release the memory after an ldb_search().
2007-10-10 13:11:40 -05:00
Tim Potter
63dfa9b806 r6325: Rename aliasname -> alias_name in CreateDomAlias function. 2007-10-10 13:11:32 -05:00
Simo Sorce
fb9afcaf53 r6084: - Introduce the samldb module dependency on samba4
- This module will take care of properly filling an user or group object
  with required fields. You just need to provide the dn and the objectclass
  and a user/group get created

  Simo.
2007-10-10 13:11:18 -05:00
Andrew Bartlett
e13c671619 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
2007-10-10 13:11:12 -05:00
Andrew Bartlett
7822101cb5 r5879: Rename SAMR_FIELD_WORKSTATION to SAMR_FIELD_WORKSTATIONS - it is a list.
Andrew Bartlett
2007-10-10 13:11:06 -05:00
Andrew Bartlett
fd748f9d2f r5783: Test renaming of accounts in the RPC-SAMR test, and add support into
the SAMR server.

Andrew Bartlett
2007-10-10 13:11:03 -05:00
Tim Potter
6749b9404d r5364: Rename string fields called 'domain' and 'name' to be 'domain_name'. 2007-10-10 13:09:46 -05:00
Andrew Tridgell
196c45b834 r5309: removed ads.h from includes.h 2007-10-10 13:09:40 -05:00
Andrew Tridgell
9db6c79e90 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.
2007-10-10 13:09:38 -05:00
Andrew Tridgell
7607ddda3f r5080: patch from ronnie to make our samr IDL a little more consistent 2007-10-10 13:09:20 -05:00
Andrew Tridgell
ec32b22ed5 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.
2007-10-10 13:09:15 -05:00
Andrew Tridgell
e9dff03f79 r4745: remove the distinguishedName attribute adds from samr. See the
discussion on samba-technical about this.
2007-10-10 13:08:49 -05:00
Stefan Metzmacher
29bc75ba28 r4715: alwys add the distinguishedName attribute
the w2k3 dc join needs that

metze
2007-10-10 13:08:47 -05:00
Andrew Bartlett
51e94fa26c r4703: Add support for EnumTrustDomain, and expand the testsuite.
Add my copyright to the SAMR server.

Andrew Bartlett
2007-10-10 13:08:45 -05:00
Andrew Bartlett
271c8faadf r4698: - Initial implementation of trusted domains in LSA.
- Use templates for Secrets and the new trusted domains

 - Auto-add modifiedTime, createdTime and objectGUID to records in the
   samdb layer.

Andrew Bartlett
2007-10-10 13:08:44 -05:00
Andrew Bartlett
5569db0f94 r4680: Make more efficient use of memory in SAMR:
Avoid a strdup, use a talloc_reference
 Use the shortest term memory context possible

Andrew Bartlett
2007-10-10 13:08:42 -05:00
Andrew Tridgell
fde042b3fc 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
2007-10-10 13:08:38 -05:00
Andrew Tridgell
202470326d r4490: when implementing one rpc server call in terms of another call, you
must zero r.out before making the 2nd call if the 2nd call has any
non-ref out parameters. This is needed for the case where the 2nd call
fails, and the 1st call would then fill in its out fields based on
uninitialised memory.
2007-10-10 13:08:12 -05:00
Andrew Tridgell
1a4713bfd0 r4475: fixed smbd to work with the small changes in the ldb API (the most important
change was in the ldb_msg_add_*() routines, which now use the msg as a context,
and thus it needs to be a talloc ptr)
2007-10-10 13:07:55 -05:00
Volker Lendecke
04cf580ef3 r4417: Reply to samr_QueryDomainInfo with the same static value as level2 does.
Volker
2007-10-10 13:07:46 -05:00
Volker Lendecke
83d180c732 r4415: Implement samr_RemoveMemberFromForeignDomain. This is needed to delete a user
with usrmgr.exe.

To fix: Remove domain group membership attrib values when a user is deleted.

Volker
2007-10-10 13:07:46 -05:00
Volker Lendecke
cdec896113 r4414: Various bits&pieces:
* Implement samr_search_domain, filter out all elements with no "objectSid"
  attribute and all objects outside a specified domain sid.

* Minor cleanups in dcerpc_samr.c due to that.

* Implement srvsvc_NetSrvGetInfo level 100. A quick hack to get usrmgr.exe
  one step further.

* Same for samr_info_DomInfo1.

Volker
2007-10-10 13:07:46 -05:00
Volker Lendecke
9c62a239cd r4399: Implement samr_GetAliasMembership and samr_GetGroupsForUser. With these two,
usrmgr.exe seems to become usable. Some quirks, but it's worth a try.

Volker
2007-10-10 13:07:43 -05:00
Volker Lendecke
ae3c329e9d r4393: Trivial bugfix for a silly bug 2007-10-10 13:07:42 -05:00