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

76 Commits

Author SHA1 Message Date
Andrew Bartlett
bdde51b26f auth/kerberos: Use talloc_stackframe to avoid memory and FD leak of event context
The smb_krb5_send_and_recv_func_forced and smb_krb5_send_and_recv_func
functions could leak an event context including an epoll FD and some
memory.  This may explain a flapping test in krb5.kdc

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by:  Kamen Mazdrashki <kamenim@samba.org>
2015-02-08 08:07:08 +01:00
Andrew Bartlett
9a0aa6f6f7 torture: Start a new testsuite for krb5 and KDC behaviour
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2015-01-23 05:42:07 +01:00
Andrew Bartlett
086c06e361 kerberos: Remove un-used event context argument from smb_krb5_init_context()
The event context here was only specified in the server or admin-tool
context, which does not do network communication, so this only caused
a talloc_reference() and never any useful result.

The actual network communication code sets an event context directly
before making the network call.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Apr 28 02:24:57 CEST 2014 on sn-devel-104
2014-04-28 02:24:57 +02:00
Stefan Metzmacher
5d2574edd2 s4:auth/kerberos: make use of samba_tevent_context_init()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:45 +01:00
Alexander Bokovoy
822e6794f0 s4:auth/kerberos: don't do tracing in MIT build
Signed-off-by: Simo Sorce <idra@samba.org>
2012-05-04 16:51:29 +02:00
Simo Sorce
aa1a0d80de krb-init: define out heimdal specific stuff in mitkrb build 2012-05-04 16:51:28 +02:00
Simo Sorce
9a585a3141 s4-auth-krb: avoid useless condition
Code bails out with ENOMEM 2 lines a bove if config_file is NULL anyways
2012-05-04 16:51:28 +02:00
Alexander Bokovoy
594e316181 lib/replace: split out GSSAPI from lib/replace/system/kerberos.h into lib/replace/system/gssapi.h
With waf build include directories are defined by dependencies specified to subsystems.
Without proper dependency <gssapi/gssapi.h> cannot be found for embedded Heimdal builds
when there are no system-wide gssapi/gssapi.h available.

Split out GSSAPI header includes in a separate replacement header and use that explicitly
where needed.

Autobuild-User: Alexander Bokovoy <ab@samba.org>
Autobuild-Date: Wed Apr 25 00:18:33 CEST 2012 on sn-devel-104
2012-04-25 00:18:32 +02:00
Simo Sorce
f7070c90b9 For now just disable this Heindal specific stuff in the MIT build 2012-04-23 16:40:49 -04:00
Simo Sorce
110dad8c9e Make krb5 context initialization not heimdal specific
Turn the logging data to an opaque pointer.
Ifdef code and use MIT logging function when built against system MIT.
2012-04-23 16:40:05 -04:00
Andrew Bartlett
dbbc6e9dda s4-param Remove config_path() -> lpcfg_config_path()
This is consistent with lock_path()

Andrew Bartlett
2011-04-29 16:38:14 +10:00
Andrew Tridgell
db0316832a s4-krb5: be a bit less verbose about krb5 packets
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-04-04 10:30:30 +10:00
Andrew Tridgell
7cb0f95bf2 s4-auth: fixed infinite loop in krb5 auth
we were continually trying the first address returned, instead of
moving to the next address

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Sun Nov 14 04:11:28 UTC 2010 on sn-devel-104
2010-11-14 04:11:28 +00:00
Andrew Tridgell
6582d4739c s4-auth: fixed crash in krb5 auth
remote_addr was used after free
2010-11-14 13:53:29 +11:00
Andrew Bartlett
14f455ba99 s4-kerberos Mention the remote address we fail to contact the KDC on 2010-11-05 23:42:08 +11:00
Andrew Tridgell
003a36eb5e s4-auth: unconditionally set previous_ev
we need the caller to know when the previous_ev was NULL

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-11-04 20:35:43 +11:00
Andrew Bartlett
42127cdbb0 s4-credentials Add explicit event context handling to Kerberos calls (only)
By setting the event context to use for this operation (only) onto
the krb5_context just before we call that operation, we can try
and emulate the specification of an event context to the actual send_to_kdc()

This eliminates the specification of an event context to many other
cli_credentials calls, and the last use of event_context_find()

Special care is taken to restore the event context in the event of
nesting in the send_to_kdc function.

Andrew Bartlett
2010-10-11 13:02:16 +00:00
Andrew Bartlett
baeaa17986 s4-kerberos Remove unused parameter 2010-10-11 13:02:15 +00:00
Andrew Tridgell
6b266b85cf s4-loadparm: 2nd half of lp_ to lpcfg_ conversion
this converts all callers that use the Samba4 loadparm lp_ calling
convention to use the lpcfg_ prefix.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-16 18:24:27 +10:00
Simo Sorce
f77714c887 s4:kdc streamline context initialization
Allow other plugins to init the context without having it try to grab sockets
or set samba specific logging.
2010-01-31 13:30:31 -05:00
Simo Sorce
61a4ab36d9 cleanup: remove trailing spaces and tabs 2010-01-28 02:05:05 -05:00
Andrew Tridgell
29d08bfe26 s4-kerberos: raise the general kerberos debug level to 3
level 2 for every krb request is a bit much
2010-01-16 18:30:22 +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
Stefan Metzmacher
2e82a4ced2 s4:auth/kerberos: s/private/private_data
metze
2009-02-02 13:08:05 +01:00
Stefan Metzmacher
c72cbce6ee s4:auth/kerberos: convert to tevent_* api
metze
2009-01-03 19:58:56 +01:00
Stefan Metzmacher
5fa0d3d568 s4:socket: use a socket_wrapper aware function to auto close the fd event for sockets
metze
2009-01-03 19:58:53 +01:00
Stefan Metzmacher
183c379fe5 s4:lib/tevent: rename structs
list=""
list="$list event_context:tevent_context"
list="$list fd_event:tevent_fd"
list="$list timed_event:tevent_timer"

for s in $list; do
	o=`echo $s | cut -d ':' -f1`
	n=`echo $s | cut -d ':' -f2`
	r=`git grep "struct $o" |cut -d ':' -f1 |sort -u`
	files=`echo "$r" | grep -v source3 | grep -v nsswitch | grep -v packaging4`
	for f in $files; do
		cat $f | sed -e "s/struct $o/struct $n/g" > $f.tmp
		mv $f.tmp $f
	done
done

metze
2008-12-29 20:46:40 +01:00
Stefan Metzmacher
fc31f2c526 s4:lib/socket: socket_connect_send() and socket_connect_ev() should only wrok with addresses
metze
2008-12-18 13:32:51 +01:00
Jelmer Vernooij
a76adc5397 Remove two debug parameters, not used anywhere.
Andrew, I was pretty sure these could be removed but if not, please let
me know.
2008-11-02 01:03:46 +01:00
Matthias Dieter Wallnöfer
57edd24ca0 Cosmetic corrections for the KERBEROS library
This commit applies some cosmetic corrections for the KERBEROS library.
2008-09-24 19:40:03 +02:00
Stefan Metzmacher
9cc663af6e auth/kerberos: we don't need to include heimdal private headers
metze
(This used to be commit 6ec3887aee)
2008-08-01 17:52:37 +02:00
Stefan Metzmacher
35cd60b002 build with the new heimdal version
(This used to be commit 3817d653fa)
2008-08-01 16:11:00 +02:00
Jelmer Vernooij
bf6d40f271 r26449: Support configuration without a known configuration dir.
(This used to be commit d3643c2152)
2007-12-21 05:50:14 +01:00
Jelmer Vernooij
1ea47faa97 r26397: Fix circular dependency in samba-socket.
(This used to be commit 801c8c766c)
2007-12-21 05:49:26 +01:00
Jelmer Vernooij
5f4842cf65 r26376: Add context for libcli_resolve.
(This used to be commit 459e1466a4)
2007-12-21 05:49:12 +01:00
Jelmer Vernooij
01d2acfdb4 r26335: Specify name_resolve_order to socket code.
(This used to be commit b03e5d0011)
2007-12-21 05:48:46 +01:00
Jelmer Vernooij
120ecdb5cb r26233: Pass loadparm context when creating krb5 contexts.
(This used to be commit 7780bf285f)
2007-12-21 05:47:11 +01:00
Jelmer Vernooij
2f3551ca7c r25446: Merge some changes I made on the way home from SFO:
2007-09-29 More higher-level passing around of lp_ctx.
2007-09-29 Fix warning.
2007-09-29 Pass loadparm contexts on a higher level.
2007-09-29 Avoid using global loadparm context.
(This used to be commit 3468952e77)
2007-10-10 15:07:34 -05:00
Jelmer Vernooij
60a1046c5c r25430: Add the loadparm context to all parametric options.
(This used to be commit fd697d77c9)
2007-10-10 15:07:31 -05:00
Jelmer Vernooij
37d53832a4 r25398: Parse loadparm context to all lp_*() functions.
(This used to be commit 3fcc960839)
2007-10-10 15:07:25 -05:00
Jelmer Vernooij
98b57d5eb6 r25035: Fix some more warnings, use service pointer rather than service number in more places.
(This used to be commit df9cebcb97)
2007-10-10 15:05:43 -05:00
Jelmer Vernooij
ffeee68e4b r25026: Move param/param.h out of includes.h
(This used to be commit abe8349f9b)
2007-10-10 15:05:38 -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
Andrew Bartlett
fe0b8a5df4 r22987: Clarify how the events are handled in the kerberos code, and
standardise with the rest of the code.

Andrew Bartlett
(This used to be commit 3aa9d70723)
2007-10-10 14:52:36 -05:00
Andrew Tridgell
c42219d735 r22969: fix some more places where we could end up with more than one event
context. We now have an event context on the torture_context, and we
can also get one from the cli_credentials structure
(This used to be commit c0f65eb656)
2007-10-10 14:52:34 -05:00
Andrew Bartlett
b5ae9019b0 r22967: Move to the TCP packet interface for the krb5_send_to_kdc plugin.
This replaces a lump of hand-crafted code with the generic packet
system used in the rest of Samba4.

(I started this while chasing down the epoll bug, which turned out to
be seperate)
(This used to be commit 2a7dec4e5d)
2007-10-10 14:52:33 -05:00
Andrew Tridgell
2741921a50 r22961: use EVENT_FD_AUTOCLOSE and SOCKET_FLAG_NOCLOSE to fix up some hairy
problems with order of socket closing in krb5
(This used to be commit 46a7d83c2b)
2007-10-10 14:52:32 -05:00
Stefan Metzmacher
7983989508 r22635: make it possible to not turn off dns canonicalization of hostnames
with krb5:set_dns_canonicalize=yes

needed for the drsuapi replication, but we should fix this with
a kdc locator plugin ...

metze
(This used to be commit f0a12355bc)
2007-10-10 14:51:56 -05:00
Jelmer Vernooij
b481b29a1a r22602: s/HAVE_SOCKET_IPV6/HAVE_IPV6/ to match the define used by Heimdal.
(This used to be commit 5ff665b653)
2007-10-10 14:51:50 -05:00
Andrew Bartlett
d5bbd817fe r20988: Call out to Heimdal's krb5.conf processing to configure many aspects
of KDC behaviour.  This should allow PKINIT to be turned on and
managed with reasonable sanity.

This also means that the krb5.conf in the same directory as the
smb.conf will always have priority in Samba4, which I think will be
useful.

Andrew Bartlett
(This used to be commit a50bbde81b)
2007-10-10 14:44:18 -05:00