1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-25 00:23:52 +03:00
Commit Graph

322 Commits

Author SHA1 Message Date
Andrew Bartlett
f78982a0f1 r10812: Fix capitalisation (thanks tridge).
Andrew Bartlett
2007-10-10 13:39:32 -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
6021fa3734 r10796: Make getting an anonymous session info a utility function.
Andrew Bartlett
2007-10-10 13:39:30 -05:00
Andrew Bartlett
1c3911374e r10764: To match Win2k3 SP1, we need to set an anonymous user token for
schannel connections.

Test for Win2k3 SP1 behaviour in RPC-SCHANNEL.

Andrew Bartlett
2007-10-10 13:39:28 -05:00
Andrew Bartlett
5b2114bb9c r10670: Add notes on things that are TODO in Samba4 kerberos land.
Andrew Bartlett
2007-10-10 13:39:16 -05:00
Andrew Tridgell
194efd26e4 r10669: reverted jelmers commit 10663 as it was causing lots of panics in 'make test'
I also think the method of getting rid of pstring isn't the right
one. I certainly do want to get rid of pstring/fstring, but the reason
for removing them is the use of arbitrary sized fixed length strings
on the stack and in structures. Changing to another fixed length stack
string format isn't really a win, and moving to use strncpy() is
actually worse than pstrcpy() as strncpy() has the absolutely awful
semantics of always zeroing all remaining bytes, so it ends up taking
a lot of cpu doing pointless memory writes.

I'd rather move to more use of asprintf()/talloc_asprintf() and
similar functions for dynamic string allocation.

You also have to be very careful about some of these system defined
string limits. One some systems PATH_MAX could be 64k or even larger,
which can quickly blow the stack out when you allocate a few of them.
2007-10-10 13:39:16 -05:00
Jelmer Vernooij
57cfbe51e6 r10663: Eliminate use of pstring 2007-10-10 13:39:15 -05:00
Andrew Bartlett
51a0275a0e r10597: And add the .mk files for the new credentials subsystem.
Andrew Bartlett
2007-10-10 13:39:09 -05:00
Andrew Bartlett
2e76a4b8ef r10596: Move the credentials code into it's own subsystem, and push it under auth/
Andrew Bartlett
2007-10-10 13:39:09 -05:00
Jelmer Vernooij
b53313dc51 r10586: Add MergedObject() builder. Default to Library() rather
then StaticLibrary()
2007-10-10 13:39:08 -05:00
Jelmer Vernooij
f547ab4644 r10579: str_list_make() can return NULL 2007-10-10 13:39:07 -05:00
Andrew Bartlett
49c6c36763 r10565: Try to make Kerberos authentication a bit more friendly.
This disables it for 'localhost' as well as for any host our KDC does
not recognise.

Andrew Bartlett
2007-10-10 13:39:06 -05:00
Andrew Bartlett
3b09f9e8f9 r10561: This patch takes over KDC socket routines in Heimdal, and directs them
at the Samba4 socket layer.

The intention here is to ensure that other events may be processed while
heimdal is waiting on the KDC.  The interface is designed to be
sufficiently flexible, so that the plugin may choose how to time
communication with the KDC (ie multiple outstanding requests, looking
for a functional KDC).

I've hacked the socket layer out of cldap.c to handle this very
specific case of one udp packet and reply.  Likewise I also handle
TCP, stolen from the winbind code.

This same plugin system might also be useful for a self-contained
testing mode in Heimdal, in conjunction with libkdc.  I would suggest
using socket-wrapper instead however.

Andrew Bartlett
2007-10-10 13:39:04 -05:00
Jelmer Vernooij
87bb382445 r10532: Replace next_token() with str_list_make() 2007-10-10 13:39:02 -05:00
Jelmer Vernooij
a5b88bcd42 r10513: Reduce some use of pstring. The main reason some parts of the code still
use pstring is next_token() now.
2007-10-10 13:38:58 -05:00
Jelmer Vernooij
6df956edba r10509: Some more sconscript fixes. Now getting to link stage for smbclient 2007-10-10 13:38:58 -05:00
Jelmer Vernooij
703ffbaaac r10478: More work on proto headers; we now generate a couple of smaller ones
that are then included by include/proto.h
2007-10-10 13:38:52 -05:00
Andrew Bartlett
1f726906c4 r10464: Use more consistant names.
Andrew Bartlett
2007-10-10 13:38:49 -05:00
Tim Potter
1b675a1bdf r10447: Add gensec sources to proto.h 2007-10-10 13:38:47 -05:00
Andrew Tridgell
0951db6a89 r10407: the schannel database does not need to be synchronous (and thus crash
safe) as it is removed on smbd restart
2007-10-10 13:38:41 -05:00
Andrew Bartlett
194e8f07c0 r10402: Make the RPC-SAMLOGON test pass against Win2k3 SP0 again.
I still have issues with Win2k3 SP1, and Samba4 doesn't pass it's own
test for the moment, but I'm working on these issues :-)

This required a change to the credentials API, so that the special
case for NTLM logins using a principal was indeed handled as a
special, not general case.

Also don't set the realm from a ccache, as then it overrides --option=realm=.

Andrew Bartlett
2007-10-10 13:38:39 -05:00
Andrew Bartlett
77aca9619d r10398: Don't do DNS lookups on short names (no .).
Andrew Bartlett
2007-10-10 13:38:39 -05:00
Volker Lendecke
3dc7e67dc5 r10390: Remove fstring, pstring and uint32_t from winbindd_nss.h.
Volker
2007-10-10 13:38:39 -05:00
Andrew Bartlett
99efec2758 r10383: This patch is on the road to implementing servers (such as kpasswd) that
use raw krb5, not GSSAPI.  I still keep the 'fake GSSAPI' code, but
under the module name 'fake_gssapi_krb5'.

Andrew Bartlett
2007-10-10 13:38:34 -05:00
Tim Potter
9d001dc083 r10377: Save configuration stuff to sconf.cache so it isn't annoyingly run
at every single build.  Run 'scons configure=1' or delete sconf.cache
to force checks to be re-run.

Jelmer, I think this stuff is cached in the .sconf_cache directory but
the message is still displayed and it looks like it caches the compiled
test object file not the actual result of the test.
2007-10-10 13:38:33 -05:00
Andrew Bartlett
3e38456dd5 r10372: Having gone to all the effort to uppercase the realm, actually set the
upper-case realm.

Andrew Bartlett
2007-10-10 13:38:32 -05:00
Jelmer Vernooij
22f18a8424 r10366: More scons fixes. Building et, asn1, lex and yacc files sort-of works now 2007-10-10 13:38:32 -05:00
Andrew Bartlett
3c0dc570b8 r10364: Turn gensec:gssapi on by default, except for a login of the form
-Udomain\\user.

This will probably break in a few configurations, so please let me
know.  I'll also work to have a way to inhibit kerberos/ntlmssp, as
this removes -k.

Andrew Bartlett
2007-10-10 13:38:31 -05:00
Jelmer Vernooij
4f0d7f75b9 r10348: Add scons scripts for remaining subsystems. Most subsystems build now,
but final linking still fails (as does generating files asn1, et, idl and proto
files)
2007-10-10 13:38:30 -05:00
Andrew Bartlett
de3ceab3d0 r10337: This grubby little hack is the implementation of a concept discussed
on the kerberos mailing lists a couple of weeks ago: Don't use DNS at
all for expanding short names into long names.

Using the 'override krb5_init_context' code already in the tree, this
removes the DNS lag on a kerberos session setup/connection.

Andrew Bartlett
2007-10-10 13:38:29 -05:00
Jelmer Vernooij
4bffe44359 r10330: Add SConscript to more subsystems. Some of the tdb tools build now.
Start on custom Samba scons tools (for handling proto generation, pidl, etc)
2007-10-10 13:38:28 -05:00
Andrew Bartlett
096c751f37 r10292: This is set below from lp_server_role().
Andrew Bartlett
2007-10-10 13:38:14 -05:00
Andrew Bartlett
f6a6456441 r10291: The patch optionally (off by default, not available in all cases) allows
Samba to use the target principal name supplied in the mechTokenMIC of
an SPNEGO negTokenInit.

This isn't a great idea for security reasons, but is how Samba3 behaves,
and allows kerberos to function more often in some environments.  It is
only available for CIFS session setups, due to the ordering of the
exchange.

Andrew Bartlett
2007-10-10 13:38:13 -05:00
Andrew Bartlett
8a22d46e70 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
2007-10-10 13:38:13 -05:00
Jelmer Vernooij
8aa9711a30 r10246: Remove unused function
Move auth-specific file to auth/
2007-10-10 13:38:11 -05:00
Andrew Bartlett
3c8be196cc r10174: This patch implements generic PAC verification, without assumptions
about the size of the signature.  In particular, this works with AES,
which was previously broken Samba4/Samba4.

Reviewed by metze (and thanks for help with the previous IDL commit).
2007-10-10 13:38:06 -05:00
Andrew Bartlett
cdfcc09343 r10155: Add more notes on required gsskrb5 functions.
Andrew Bartlett
2007-10-10 13:38:04 -05:00
Andrew Bartlett
e4f2afc343 r10153: This patch adds a new parameter to gensec_sig_size(), the size of the
data to be signed/sealed.  We can use this to split the data from the
signature portion of the resultant wrapped packet.

This required merging the gsskrb5_wrap_size patch from
lorikeet-heimdal, and fixes AES encrption issues on DCE/RPC (we no
longer use a static 45 byte value).

This fixes one of the krb5 issues in my list.

Andrew Bartlett
2007-10-10 13:38:04 -05:00
Andrew Bartlett
2e5884fc24 r10145: Allow a variable length signature, so we can support signing with
other than arcfour-hmac-md5.  Currently we still fail to verify other
signatures however.

Andrew Bartlett
2007-10-10 13:38:03 -05:00
Andrew Bartlett
a3aba57c00 r10066: This is the second in my patches to work on Samba4's kerberos support,
with an aim to make the code simpiler and more correct.

Gone is the old (since the very early Samba 3.0 krb5 days) 'iterate over
all keytypes)' code in gensec_krb5, we now follow the approach used in
gensec_gssapi, and use a keytab.

I have also done a lot of work in the GSSAPI code, to try and reduce
the diff between us and upstream heimdal.  It was becoming hard to
track patches in this code, and I also want this patch (the DCE_STYLE
support) to be in a 'manageable' state for when lha considers it for
merging.  (metze assures me it still has memory leak problems, but
I've started to address some of that).

This patch also includes a simple update of other code to current
heimdal, as well as changes we need for better PAC verification.

On the PAC side of things we now match windows member servers by
checking the name and authtime on an incoming PAC.  Not generating these
right was the cause of the PAC pain, and so now both the main code and
torture test validate this behaviour.

One thing doesn't work with this patch:
 - the sealing of RPC pipes with kerberos, Samba -> Samba seems
broken.  I'm pretty sure this is related to AES, and the need to break
apart the gss_wrap interface.

Andrew Bartlett
2007-10-10 13:36:33 -05:00
Andrew Bartlett
506a7b67ae r10035: This patch removes the need for the special case hack
'MEMORY_WILDCARD' keytab type. (part of this checking is in effect a
merge from lorikeet-heimdal, where I removed this)

This is achieved by correctly using the GSSAPI gsskrb5_acquire_cred()
function, as this allows us to specify the target principal, regardless
of which alias the client may use.

This patch also tries to simplify some principal handling and fixes some
error cases.

Posted to samba-technical, reviewed by metze, and looked over by lha on IRC.

Andrew Bartlett
2007-10-10 13:36:31 -05:00
Andrew Bartlett
f36e657a41 r10021: More kerberos notes. 2007-10-10 13:36:30 -05:00
Andrew Bartlett
b50e546eb4 r9927: Extend copyright for all the hard work I've done this year.
Andrew Bartlett
2007-10-10 13:36:22 -05:00
Jelmer Vernooij
200a8f6652 r9792: Rename StrCaseCmp -> strcasecmp_m. All these years I was thinking
StrCaseCmp was sys_strcasecmp, while it is in fact strcasecmp_m!
2007-10-10 13:35:01 -05:00
Andrew Bartlett
6202267f6e r9728: A *major* update to the credentials system, to incorporate the
Kerberos CCACHE into the system.

This again allows the use of the system ccache when no username is
specified, and brings more code in common between gensec_krb5 and
gensec_gssapi.

It also has a side-effect that may (or may not) be expected: If there
is a ccache, even if it is not used (perhaps the remote server didn't
want kerberos), it will change the default username.

Andrew Bartlett
2007-10-10 13:34:54 -05:00
Andrew Bartlett
c7a44518ad r9693: Move the smb_krb5_context setup code to use the new pattern of
tmp_ctx, then steal at the last moment, on success.

andrew Bartlett
2007-10-10 13:34:41 -05:00
Andrew Bartlett
47699019db r9681: We don't need the full smb_krb5_context here, so just pass the krb5_context.
Andrew Bartlett
2007-10-10 13:34:40 -05:00
Andrew Bartlett
50e6229c7a r9678: Remove unused variables.
Andrew Bartlett
2007-10-10 13:34:39 -05:00
Andrew Tridgell
7bee374b3f r9648: this fixes the krb5 based login with the pac. The key to this whole saga was
that the logon_time field in the pac must match the authtime field in the ticket we
gave the client in the AS-REP (and thus also the authtime field in the ticket we get
back in the TGS-REQ).

Many thanks to Andrew Bartlett for his patience in showing me the
basic ropes of all this code! This was a joint effort.
2007-10-10 13:34:37 -05:00
Stefan Metzmacher
995b805e04 r9526: provide DCERPC auth type 16
metze
2007-10-10 13:34:26 -05:00