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

295 Commits

Author SHA1 Message Date
Jeremy Allison
9997ee813b Remove fstring from map_username. Create a more sane interface than the called-parameter-is-modified.
Jeremy.
2010-11-10 01:14:17 +00:00
Volker Lendecke
dda1dd63d3 s3: Avoid an explicit ZERO_STRUCT 2010-09-26 01:12:37 +02:00
Volker Lendecke
6ee0d866c2 s3: Lift talloc_autofree_context() from make_auth_context_fixed() 2010-09-26 01:12:37 +02:00
Volker Lendecke
242e329610 s3: Lift talloc_autofree_context() from make_auth_context_subsystem() 2010-09-26 01:12:37 +02:00
Jeremy Allison
d8814b1a48 Fix bug 7694 - Crash bug with invalid SPNEGO token.
Found by the CodeNomicon test suites at the SNIA plugfest.

http://www.codenomicon.com/

If an invalid SPNEGO packet contains no OIDs we crash in the SMB1/SMB2 server
as we indirect the first returned value OIDs[0], which is returned as NULL.

Jeremy.
2010-09-23 21:44:24 -07:00
Andrew Bartlett
6832d5e933 libcli/auth/ntlmssp Be clear about talloc parents for session keys
The previous API was not clear as to who owned the returned session key.
This fixes a valgrind-found use-after-free in the NTLMSSP key derivation code,
and avoids making allocations - we steal and zero instead.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-16 21:09:17 +10:00
Simo Sorce
a413a86daa s3-smbd: use make_server_info_krb5()
Signed-off-by: Günther Deschner <gd@samba.org>
2010-08-30 14:24:38 +02:00
Simo Sorce
94adbf3726 s3-smbd: Use helper function to resolve kerberos user
Signed-off-by: Günther Deschner <gd@samba.org>
2010-08-30 14:21:53 +02:00
Volker Lendecke
177e394f93 s3: Pass the rhost through smb_pam_accountcheck 2010-08-22 22:42:21 +02:00
Volker Lendecke
ac7b63384d s3: Lift smbd_server_fd from reload_services() 2010-08-18 11:18:21 +02:00
Volker Lendecke
05604b315b s3: Remove smbd_server_fd() from setup_new_vc_session 2010-08-16 22:39:24 +02:00
Volker Lendecke
96ae457023 s3: Remove get_client_fd() 2010-08-16 13:13:10 +02:00
Volker Lendecke
98187fe309 s3: Increase debug level for shutdown_other_smbds 2010-08-15 09:50:13 +02:00
Volker Lendecke
02002a52f2 s3: Add debugs to shutdown_other_smbds 2010-08-15 09:50:12 +02:00
Volker Lendecke
39da717fe1 s3: Lift the smbd_messaging_context from reload_services 2010-08-08 18:09:33 +02:00
Günther Deschner
257a1f1097 s3-krb5: include krb5pac.h where needed.
Guenther
2010-08-06 15:43:37 +02:00
Günther Deschner
e7a6a3ec0d s3: avoid global include of ads.h.
Guenther
2010-08-05 00:32:02 +02:00
Jeremy Allison
5002b3a90d Add approriate TALLOC_CTX's thoughout the spnego code. No more implicit NULL contexts.
Jeremy.
2010-07-20 16:17:58 -07:00
Jeremy Allison
4ed9437b7e Add TALLOC_CTX argument to spnego_parse_negTokenInit, reduce
use of malloc, and data_blob().

Jeremy.
2010-07-20 13:35:43 -07:00
Simo Sorce
e958b39042 s3-auth: Move auth_ntlmssp wrappers in their own file
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-20 15:52:31 +10:00
Simo Sorce
a04bbd281c s3-auth: Refactor and rename auth_ntlmssp_server_info()
Rename it to auth_ntlmssp_steal_server_info() to make it clear that
the server_info struct is stolen from the auth_ntlmssp_state structure.
Use talloc_move instead of manual steal&clear
Add comments to explain what is going on.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-20 15:52:24 +10:00
Jeremy Allison
625a511389 Remove parse_negTokenTarg(), as it's actually incorrect. We're processing
negTokenInit's here. Use common code in spnego_parse_negTokenInit().

Jeremy.
2010-07-19 15:41:45 -07:00
Simo Sorce
c09dcb903c s3-auth: Use talloc hierarchies to properly free auth_ntlmssp_state contexts
Turn auth_ntlmssp_end into a destructor and attach it to auth_ntlmssp_state.
Remote auth_ntlmssp_end and use TALLOC_FREE in the callers.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 14:20:04 +10:00
Simo Sorce
e60ed80754 s3-auth: Simplify how we free the auth_context
Turn the freeing function into a destructor and attach it to the
auth_context.
Make all callers TALLOC_FREE() the auth_context instead of calling
the free function.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 14:20:00 +10:00
Jeremy Allison
e058de31e8 Make the "map to guest" parameter work correctly with NTLMSSP (spnego
and raw) under SMB2. Still need to investigate fixing this with krb5
auth (does this make sense ?).

Jeremy.
2010-07-16 11:05:34 -07:00
Andrew Bartlett
0d95cee58f s3:auth Change auth_ntlmssp_server_info API to return NTSTATUS
This fixes a bug where register_existing_vuid() could be called with a
NULL server_info if the alloction failed.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-07-14 16:22:49 +10:00
Andrew Bartlett
1debe30689 s3:smbd Give the kerberos session key a parent
Nothing will free this, so this prevents a memory leak.

Andrew Bartlett

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-07-14 16:22:49 +10:00
Andrew Bartlett
39d1a525d1 s3:smbd Fix segfault if register_existing_vuid() fails
The register_existing_vuid() call will handle both the ntlmssp_end and
vuid invalidation internally, so we don't want to do it again.

Andrew Bartlett

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-07-14 16:22:49 +10:00
Volker Lendecke
9b0fbcf35a s3: Remove smbd_messaging_context() from shutdown_other_smbds() 2010-07-05 11:06:30 +02:00
Volker Lendecke
2509eb4209 s3: Remove smbd_server_conn from reply_sesssetup_and_X 2010-06-12 15:42:55 +02:00
Volker Lendecke
c03012ea1c s3: Fix a typo 2010-06-12 15:42:55 +02:00
Volker Lendecke
8de7bf19b8 s3: Remove smbd_server_conn from reply_sesssetup_and_X_spnego 2010-06-12 15:42:55 +02:00
Volker Lendecke
853b29066c s3: Remove smbd_server_conn from reply_spnego_auth 2010-06-12 15:42:54 +02:00
Volker Lendecke
32900fdc97 s3: Remove smbd_server_conn from reply_spnego_negotiate 2010-06-12 15:42:54 +02:00
Volker Lendecke
0f852ab070 s3: Remove smbd_server_conn from reply_spnego_ntlmssp 2010-06-12 15:42:54 +02:00
Volker Lendecke
2260dbecc2 s3: Remove smbd_server_conn from reply_spnego_kerberos 2010-06-12 15:42:54 +02:00
Volker Lendecke
7a7f28d96d Revert "s3:smbd Fix segfault if register_existing_vuid() fails"
This reverts commit 8f1cec5faf.
2010-06-08 11:38:08 +02:00
Volker Lendecke
3e502159c7 Revert "s3:smbd Give the kerberos session key a parent"
This reverts commit 4a7f45b7e1.
2010-06-08 11:38:08 +02:00
Volker Lendecke
34b29b1198 Revert "s3:auth Change auth_ntlmssp_server_info API to return NTSTATUS"
This reverts commit edba46ce94.

Conflicts:

	source3/auth/auth_ntlmssp.c
2010-06-08 11:38:08 +02:00
Andrew Bartlett
edba46ce94 s3:auth Change auth_ntlmssp_server_info API to return NTSTATUS
It's nicer to have an NTSTATUS return, and in s3compat there may be a
reason other than 'no memory' why this can fail.

Andrew Bartlett
2010-06-07 23:34:29 +10:00
Andrew Bartlett
4a7f45b7e1 s3:smbd Give the kerberos session key a parent
I can't see what would free this, so this should prevent a memory leak.

Andrew Bartlett
2010-06-07 23:34:28 +10:00
Andrew Bartlett
8f1cec5faf s3:smbd Fix segfault if register_existing_vuid() fails
The register_existing_vuid() call will handle both the ntlmssp_end and
vuid invalidation internally, so we don't want to do it again.

Andrew Bartlett
2010-06-07 23:34:28 +10:00
Simo Sorce
471ed70c49 s3:smbd map_username() doesn't need sconn anymore
Signed-off-by: Andreas Schneider <asn@samba.org>
2010-05-31 18:21:29 +02:00
Andrew Bartlett
ebae21f023 ntlmssp: Make the ntlmssp.h from source3/ a common header
The code is not yet in common, but I hope to fix that soon.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-31 15:10:56 +02:00
Andrew Bartlett
723ea68d3b s3:auth Remove AUTH_NTLMSSP_STATE typedef.
typedefs are no longer preferred Samba style.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-31 15:10:44 +02:00
Andrew Bartlett
3b706865f6 s3:auth Make AUTH_NTLMSSP_STATE a private structure.
This makes it a little easier for it to writen in terms of GENSEC in future.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-31 15:10:33 +02:00
Simo Sorce
606be25ecf s3:auth Free sampass as soon as we have server_info
We don't keep sampass in server_info anymore
So it makes no sense to keep it around.

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-28 00:56:02 +02:00
Simo Sorce
d9cffc01be s3:auth use info3 in auth_serversupplied_info
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-28 00:55:53 +02:00
Andrew Bartlett
454b0b3f20 s3:kerberos Return PAC_LOGON_INFO rather than the full PAC_DATA
All the callers just want the PAC_LOGON_INFO, so search for that in
ads_verify_ticket(), and don't bother the callers with the rest of the
PAC.

This change makes sense on it's own (removing boilerplate wrappers
that just confuse the code), but it also makes it much easier to
implement a matching ads_verify_ticket() function in Samba4 for the
s3compat proposal.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-11 22:52:37 +02:00
Günther Deschner
c6ebab846d s3: only include gen_ndr headers where needed.
This shrinks include/includes.h.gch by the size of 7 MB and reduces build time
as follows:

ccache build w/o patch
real    4m21.529s
ccache build with patch
real    3m6.402s

pch build w/o patch
real    4m26.318s
pch build with patch
real    3m6.932s

Guenther
2010-05-06 00:22:59 +02:00