1
0
mirror of https://github.com/samba-team/samba.git synced 2025-10-30 08:23:49 +03:00
Commit Graph

90 Commits

Author SHA1 Message Date
Andrew Bartlett
2b569c42e0 r19598: Ahead of a merge to current lorikeet-heimdal:
Break up auth/auth.h not to include the world.

Add credentials_krb5.h with the kerberos dependent prototypes.

Andrew Bartlett
2007-10-10 14:25:00 -05:00
Andrew Tridgell
09007b0907 r17824: add a wrapper for the common partitions_basedn calculation 2007-10-10 14:16:45 -05:00
Andrew Tridgell
a5ea749f0a r17823: get rid of most of the samdb_base_dn() calls, as they are no longer
needed in searches
2007-10-10 14:16:45 -05:00
Stefan Metzmacher
5b26cbc342 r17270: split the logic of saying this auth backend wants to handle this
request from the password checking. This will help to make
the password checking hook async later

metze
2007-10-10 14:10:25 -05:00
Andrew Bartlett
a2441ae99a r16238: Use a baseDN for the auth_sam searches, to allow continued function
with partitions.

Also fix some debug messages.

Andrew Bartlett
2007-10-10 14:09:08 -05:00
Jelmer Vernooij
c19c2b51d3 r15328: Move some functions around, remove dependencies.
Remove some autogenerated headers (which had prototypes now autogenerated by pidl)
Remove ndr_security.h from a few places - it's no longer necessary
2007-10-10 14:05:17 -05:00
Jelmer Vernooij
6646384aaf r15298: Fix the build using a few hacks in the build system.
Recursive dependencies are now forbidden (the build system
will bail out if there are any).

I've split up auth_sam.c into auth_sam.c and sam.c. Andrew,
please rename sam.c / move its contents to whatever/wherever you think suits
best.
2007-10-10 14:05:04 -05:00
Jelmer Vernooij
5b3ab728ed r15297: Move create_security_token() to samdb as it requires SAMDB (and the rest of LIBSECURITY doesn't)
Make the ldb password_hash module only depend on some keys manipulation code, not full heimdal
Some other dependency fixes
2007-10-10 14:05:04 -05:00
Andrew Tridgell
babf747cfd r14975: use the magic comment recognised by the IBM checker for deliberate
fall through in switch
2007-10-10 14:00:49 -05:00
Stefan Metzmacher
9ec706238c r14860: create libcli/security/security.h
metze
2007-10-10 13:59:44 -05:00
Jelmer Vernooij
e71cca7f0c r14571: More improvements on shared library support in Samba. Only ldb is left now... 2007-10-10 13:58:49 -05:00
Jelmer Vernooij
3dd477ca51 r14464: Don't include ndr_BASENAME.h files unless strictly required, instead
try to include just the BASENAME.h files (containing only structs)
2007-10-10 13:57:27 -05:00
Jelmer Vernooij
1a16a6f1df r14380: Reduce the size of structs.h 2007-10-10 13:57:16 -05:00
Jelmer Vernooij
1228358767 r13924: Split more prototypes out of include/proto.h + initial work on header
file dependencies
2007-10-10 13:52:24 -05:00
Andrew Bartlett
c530ab5dc6 r13910: Fix the 'your password has expired' on every login. We now consider
if the 'password does not expire' flag has been set, filling in the
PAC and netlogon reply correctly if so.

Andrew Bartlett
2007-10-10 13:52:22 -05:00
Andrew Bartlett
c6eb74f429 r13252: Cleanup, both in code, comments and talloc use:
In particular, I've used the --leak-report-full option to smbd to
track down memory that shouldn't be on a long-term context.  This is
now talloc_free()ed much earlier.

Andrew Bartlett
2007-10-10 13:51:38 -05:00
Andrew Bartlett
85b3f6ebdd r13247: Try to make better use of talloc in the auth/ and auth/gensec code.
We don't want temporary memory hanging around on the long-term
contexts.

Andrew Bartlett
2007-10-10 13:51:37 -05:00
Andrew Bartlett
c10491fb9b r12718: We don't use unicodePwd directly any more.
Andrew Bartlett
2007-10-10 13:49:45 -05:00
Jelmer Vernooij
70e7449318 r12608: Remove some unused #include lines. 2007-10-10 13:49:03 -05:00
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 Tridgell
53f0fb77c3 r12363: minor fixes for win2000 join/login
- the objectClass needs to be added to the list of attributes to make
   the check for objectClass=computer work

 - the short version of the name needs to be used for the 'cn' in
   cracknames
2007-10-10 13:47:31 -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 Bartlett
41f09ef934 r11929: Add static, comments.
Andrew Bartlett
2007-10-10 13:46:48 -05:00
Andrew Bartlett
36973b1eef r11543: A major upgrade to our KDC and PAC handling.
We now put the PAC in the AS-REP, so that the client has it in the
TGT.  We then validate it (and re-sign it) on a TGS-REQ, ie when the
client wants a ticket.

This should also allow us to interop with windows KDCs.

If we get an invalid PAC at the TGS stage, we just drop it.

I'm slowly trying to move the application logic out of hdb-ldb.c, and
back in with the rest of Samba's auth system, for consistancy.  This
continues that trend.

Andrew Bartlett
2007-10-10 13:45:52 -05:00
Andrew Bartlett
1643ad169c r11537: Make the authsam_account_ok routine callable by external users (the KDC).
Andrew Bartlett
2007-10-10 13:45:51 -05:00
Andrew Bartlett
da38bcefa7 r11525: Move lookups (including the attribute search) for users from
kdc/hdb-ldb.c to share the routines used for auth/

This will require keeping the attribute list in sync, but I think it
is worth it for the next steps (sharing the server_info generation).

Andrew Bartlett
2007-10-10 13:45:48 -05:00
Andrew Bartlett
ce611eb5f3 r11520: indent 2007-10-10 13:45:47 -05:00
Andrew Bartlett
690cad8083 r11370: Samba4 now passes it's own RPC-SAMLOGON test again.
This avoids the nasty user@DOMAIN test for now, as it has very odd
semantics with NTLMv2.

Allow only user accounts to do an interactive login.

Andrew Bartlett
2007-10-10 13:45:27 -05:00
Andrew Bartlett
421e64c2b4 r11366: Pass around the flags which indicate if we should support plaintext
logins and NTLM machine account logins.

Andrew Bartlett
2007-10-10 13:45:26 -05:00
Andrew Bartlett
0800942dbb r11312: Make it clear we are looking at the 'domain ref', not the domain
itself in the auth_sam module.

Andrew Bartlett
2007-10-10 13:45:18 -05:00
Andrew Bartlett
ecacef213b r11293: Use the right search when forming the data for the PAC.
Andrew Bartlett
2007-10-10 13:45:14 -05:00
Andrew Bartlett
bc6f6f9381 r11273: Initialise the new server_info->logon_server element.
Andrew Bartlett
2007-10-10 13:45:11 -05:00
Andrew Bartlett
c9d5d8e45d 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
2007-10-10 13:45:11 -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
Jelmer Vernooij
f547ab4644 r10579: str_list_make() can return NULL 2007-10-10 13:39:07 -05:00
Jelmer Vernooij
87bb382445 r10532: Replace next_token() with str_list_make() 2007-10-10 13:39:02 -05:00
Andrew Bartlett
ceec35564f r9412: Simplfy this NTLM authentication code by requiring the caller to
supply the user_sess_key and lm_sess_key parameters.  Inspired by
coverty complaining about inconsistant checking.

Also factor out some of this code, where we deal with just NT and LM
hashes, or embedded plaintext passwords.

Andrew Bartlett
2007-10-10 13:33:35 -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
181155f9e0 r8980: Make Samba4 honour account control flags (we were asking for a
non-existant field).

Also change time(NULL) into an NTTIME for comparison, rather than
experience rounding bugs (size of time_t) when converting an NTTIME
into a time_t.

Andrew Bartlett
2007-10-10 13:31:03 -05:00
Andrew Bartlett
ecbd2235a3 r8700: Propmted by tridge's need to do plaintext auth in ejs, rework the
user_info strcture in auth/

This moves it to a pattern much like that found in ntvfs, with
functions to migrate between PAIN, HASH and RESPONSE passwords.

Instead of make_user_info*() functions, we simply fill in the control
block in the callers, per recent dicussions on the lists.  This
removed a lot of data copies as well as error paths, as we can grab
much of it with talloc.

Andrew Bartlett
2007-10-10 13:29:55 -05:00
Andrew Tridgell
3a49626ae1 r8676: attribute lists in ldb searches must be NULL terminated
this is what was causing the panic on the s390 box
2007-10-10 13:29:53 -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
Andrew Bartlett
93335d587d r7306: Use a consistant #define for detecting support for the Heimdal krb5
log redirection code.

Andrew Bartlett
2007-10-10 13:17:39 -05:00
Andrew Bartlett
2fb413355a r7269: talloc_steal() is preferred where possible, as it can't fail and does
not have some of the issues of talloc_reference().

Andrew Bartlett
2007-10-10 13:17:34 -05:00
Andrew Bartlett
c25e78b4b3 r6883: Move to what simo assures me is the 'correct' way to find the NetBIOS
and long names for a domain.

Add servicePrincipalName mapping table (administrator configurable),
in the same spot as microsoft uses.

Andrew Bartlett
2007-10-10 13:16:55 -05:00
Andrew Bartlett
6b9020661a r6793: Move auth_sam to use the dnsDomain rather than the
soon-to-be-depricated 'realm'.

Add torture test for this behaviour.

Andrew Bartlet
2007-10-10 13:16:44 -05:00
Andrew Bartlett
8ee208a926 r6565: Cludge, cludge, cludge...
We need to pass the 'secure channel type' to the NETLOGON layer, which
must match the account type.

(Yes, jelmer objects to this inclusion of the kitchen sink ;-)

Andrew Bartlett
2007-10-10 13:16:26 -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 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