1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-31 17:18:04 +03:00
Commit Graph

3518 Commits

Author SHA1 Message Date
Stefan Metzmacher
85b393a199 s3:smb2cli: SMB2_WRITE needs one dyn byte to that the structure size check works.
Windows generates NT_STATUS_INVALID_PARAMETER otherwise.

metze
2011-09-07 08:33:15 +02:00
Stefan Metzmacher
42609036be s3:smb2cli: SMB2_READ needs one dyn byte to that the structure size check works.
Windows generates NT_STATUS_INVALID_PARAMETER otherwise.

metze
2011-09-07 08:32:45 +02:00
Stefan Metzmacher
fbcba9fa8f s3:smb2cli: SMB2_QUERY_DIRECTORY needs one dyn byte to that the structure size check works.
Windows generates NT_STATUS_INVALID_PARAMETER otherwise.

metze
2011-09-07 08:32:42 +02:00
Stefan Metzmacher
b57fb1e1a4 s3:smb2cli: SMB2_CREATE needs one dyn byte to that the structure size check works.
Windows generates NT_STATUS_INVALID_PARAMETER otherwise.

metze
2011-09-07 08:32:08 +02:00
Stefan Metzmacher
35d4afc3e0 s3:smb2cli: SMB2_SESSION_SETUP needs one dyn byte to that the structure size check works.
Windows generates NT_STATUS_INVALID_PARAMETER otherwise.

metze
2011-09-07 08:32:05 +02:00
Stefan Metzmacher
a44d3d1764 s3:smb2cli: make sure we don't try to send requests on a disconnected cli_state
metze
2011-09-05 18:01:07 +02:00
Stefan Metzmacher
4dca2acfe4 s3:smb2cli: make sure requests are not finished, when we send when to the network
metze
2011-09-05 18:01:06 +02:00
Stefan Metzmacher
0b6087c7be s3:smb2cli: disconnect the connection, if we're out of message ids
metze
2011-09-05 18:01:06 +02:00
Stefan Metzmacher
5155a15c5c s3:smb2cli: don't use state->cli->smb2.mid++ as macro argument
It gets expanded multiple times.

metze
2011-09-05 18:01:06 +02:00
Stefan Metzmacher
3167a2b8b9 s3:smb2cli: ask for a session key in smb2cli_sesssetup_send()
This is needed if we want to support SMB2 signing later.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sat Sep  3 16:21:35 CEST 2011 on sn-devel-104
2011-09-03 16:21:34 +02:00
Andreas Schneider
b8c3bfa55b s3-lib: If we create a pipe socket, don't start to listen.
The create_pipe_sock() function should only create the socket as the
name states and not start to listen on it too. We should start to listen
on in the individual places as we need different backlog values.

Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Mon Aug 29 13:21:43 CEST 2011 on sn-devel-104
2011-08-29 13:21:43 +02:00
Stefan Metzmacher
92b7e3ee58 s3:libsmb: make cli_session_request_send/recv() static
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Aug 28 20:29:01 CEST 2011 on sn-devel-104
2011-08-28 20:29:01 +02:00
Stefan Metzmacher
74adebe8d9 s3:libsmb: move cli_session_request*() to smbsock_connect.c
metze
2011-08-28 17:23:49 +02:00
Stefan Metzmacher
ab0a1cc5c6 s3:libsmb: move cli_smb_oplock_break_waiter*() to clioplock.c
metze
2011-08-28 17:16:51 +02:00
Stefan Metzmacher
1e43bacd5e s3:libsmb: use cli_smb_req_set_mid() in cli_smb_oplock_break_waiter_send()
metze
2011-08-28 17:16:50 +02:00
Stefan Metzmacher
9e0d975512 s3:libsmb: let cli_smb_req_mid() return the mid set by cli_smb_req_set_mid()
metze
2011-08-28 16:32:19 +02:00
Volker Lendecke
932f2229f1 s/event_context/tevent_context/ in smbsock_any_connect
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Aug 23 18:21:58 CEST 2011 on sn-devel-104
2011-08-23 18:21:58 +02:00
Volker Lendecke
5ba5ccdc41 s/event_context/tevent_context/ in smbsock_connect 2011-08-23 16:51:26 +02:00
Stefan Metzmacher
eeb0298ac1 s3:smb2cli: pass more fields to smb2cli_req_create()/smb2cli_req_send()
The caller should take care of the global cli_state values.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Aug 12 19:38:27 CEST 2011 on sn-devel-104
2011-08-12 19:38:27 +02:00
Stefan Metzmacher
28c4d2d0f3 s3:smb2cli: allow 32bit dyn_len in smb2cli_req_create()/smb2cli_req_send()
metze
2011-08-12 18:06:44 +02:00
Stefan Metzmacher
b41d44eda3 s3:libsmb: keep a cli_smb_state->one_way
This moves the SMB1 specific stuff to cli_smb_req_create(),
instead of having it in the core dispatching code.

metze
2011-08-12 18:06:28 +02:00
Stefan Metzmacher
c485df9530 s3:libsmb: abstract the incoming dispatch function via a function pointer
This will allow handling of SMB2 in future.

metze
2011-08-12 18:06:04 +02:00
Stefan Metzmacher
58003b5a77 s3:libsmb: split out cli_state_dispatch_smb1() from cli_smb_received()
metze
2011-08-12 17:54:04 +02:00
Stefan Metzmacher
9b15963695 s3:libsmb: add missing TALLOC_FREE(frame) to cli_smb_received()
metze
2011-08-12 17:54:04 +02:00
Stefan Metzmacher
0d1a7fda1e s3:libsmb: keep the request order in cli_smb_req_unset_pending()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Aug 12 12:36:03 CEST 2011 on sn-devel-104
2011-08-12 12:36:03 +02:00
Stefan Metzmacher
edeb41aa20 s3:libsmb: use tevent_req_defer_callback() unless there's only one request in cli_smb_received()
Callers of tevent_req_done() (or similar functions) have to return directly.
Otherwise the callback could invalidate the current stack state,
which is likely to trigger segfaults.

If there was only one pending request and we just got the response
for that one, we can use tevent_req_done() directly.

Otherwise there're more pending requests and we need to call
cli_state_receive_next() or we got the response for chained requests.
Both means that we have to use tevent_req_defer_callback().

metze
2011-08-12 11:08:00 +02:00
Stefan Metzmacher
02cb2052d8 s3:libsmb: make use of cli_state_receive_next() in cli_smb_received()
metze
2011-08-12 11:08:00 +02:00
Stefan Metzmacher
56d3c91af7 s3:libsmb: notify all request about failures in cli_smb_req_set_pending()
It's up to the caller to notify the current request,
but we have to notify all other pending requests if
we're not able to read the next response from the server.

metze
2011-08-12 11:08:00 +02:00
Stefan Metzmacher
4335a4f1c6 s3:libsmb: split out cli_state_receive_next() from cli_smb_req_set_pending()
metze
2011-08-12 11:08:00 +02:00
Stefan Metzmacher
ca567117b0 s3:libsmb: use talloc_stackframe() in cli_smb_received()
metze
2011-08-12 11:08:00 +02:00
Stefan Metzmacher
bae9324e50 s3:libsmb: call cli_smb_req_unset_pending() before tevent_req_done() also for chained requests
metze
2011-08-12 11:08:00 +02:00
Stefan Metzmacher
d41d2e93f4 s3:libsmb: reset the destructor in cli_smb_req_unset_pending()
metze
2011-08-12 11:08:00 +02:00
Stefan Metzmacher
c01b8326e0 s3:libsmb: add cli_state_notify_pending() and use it
If we got a problem on the connection we need to notify every
pending request. But we need to make use of tevent_req_defer_callback()
before tevent_req_nterror(), otherwise the callback, triggered
by tevent_req_nterror(), could invalidate the state of current caller,
which will likely cause segfaults.

metze
2011-08-12 11:08:00 +02:00
Stefan Metzmacher
81580429ec s3:libsmb: make cli_session_setup_spnego() static
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Aug 10 12:31:55 CEST 2011 on sn-devel-104
2011-08-10 12:31:55 +02:00
Stefan Metzmacher
d7cdd9651e s3:libsmb: pass remote_realm to cli_session_setup_spnego() in cli_session_setup()
metze
2011-08-10 11:14:55 +02:00
Stefan Metzmacher
c6a3dedd99 s3:libsmb: store the remote_realm on the cli_state
metze
2011-08-10 11:14:55 +02:00
Stefan Metzmacher
81e765582b s3:libsmb/cli*: use CLI_BUFFER_SIZE instead of cli->max_xmit
The max_data parameter of trans2/nttrans calls are not bound
to cli->max_xmit. Even with cli->max_xmit, which means the max
size of the whole SMB pdu, we would get fragmented trans2/nttrans
replies. That's why we can also use our maximum, which is CLI_BUFFER_SIZE.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Aug  9 18:14:38 CEST 2011 on sn-devel-104
2011-08-09 18:14:38 +02:00
Andrew Bartlett
ed59f21f65 s3-ntlmssp void function cannot return value
Removing the return is reasonable here because while no callers
currently specify more than one flag at a time, the
ntlmssp_want_feature code allows it.

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Aug  4 02:19:46 CEST 2011 on sn-devel-104
2011-08-04 02:19:46 +02:00
Andrew Bartlett
d811862b45 s3-ntlmssp Remove rudundent comment
This is explained where SESSION_KEY maps to SIGN at the NTLMSSP layer

Andrew Bartlett
2011-08-03 18:48:06 +10:00
Andrew Bartlett
9a45bf3952 s3-auth set session_info->sanitized_username in create_local_token()
Rather than passing this value around the callers, and eventually
setting it in register_existing_vuid(), we simply pass it to
create_local_token().  This also removes the need for
auth_ntlmssp_get_username().

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:04 +10:00
Andrew Bartlett
1231b784a1 s3-ntlmssp Remove auth_ntlmssp_and_flags()
There is no need to mask out these flags as they simply are not set
yet.

The correct abstraction is to ask for NTLMSSP features.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:03 +10:00
Andrew Bartlett
da4345a8d1 s3-ntlmssp Remove rpccli_get_pwd_hash and auth_ntlmssp_get_nt_hash
The session key we want here (the only one that is availble to the
encryption layer) is the one obtained by cli_get_session_key(), as
NTLMSSP creates a per-session session key via key exchange and NTLMv2
negotiation.

The key was never directly the NT hash anyway (this is simply a
mistake, the extra MD4() was lost during my previous cleanup
f28f113d8e in 2008), but was MD4(NT
hash) in early implementations of NTLMSSP.

However, regardless this call is not available on domain trusts
between AD domains and Windows 2003 R2, making this less useful.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:03 +10:00
Andrew Bartlett
bba5f0a641 s3-ntlmssp Remove auth_ntlmssp_or_flags
We now just use auth_ntlmssp_want_feature to get extra flags
on the NTLMSSP context

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:03 +10:00
Andrew Bartlett
778bf87d8d s3-ntlmssp Remove calls to auth_ntlmssp_and_flags from the server
This is changed so that the callers ask for the additional flags
that they need, starting with no additional flags.

This helps to create a proper abstraction layer in
ntlmssp_wrap/auth_ntlmssp.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:03 +10:00
Andrew Bartlett
6d7ac4f1ad s3-ntlmssp Add mem_ctx argument to auth_ntlmssp_update
This clarifies the lifetime of the returned token.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:03 +10:00
Andrew Bartlett
763243d6ed s3-ntlmssp NTLMSSP sealing implies signing, so set both flags
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:03 +10:00
Andrew Bartlett
d69843c908 s3-ntlmssp Add hooks to optionally call into GENSEC in auth_ntlmssp
This allows the current behaviour of the NTLMSSP code to be unchanged
while adding a way to hook in an alternate implementation via an auth
module.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:03 +10:00
Andrew Bartlett
dee845eb70 s3-ntlmssp Add mem_ctx argument to auth_ntlmssp_get_session_key() 2011-08-03 18:48:02 +10:00
Andrew Bartlett
a942401c1f s3-ntlmssp Use auth_ntlmssp_*() functions in more places
This allows auth_ntlmssp_get_ntlmssp_state() to be removed.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:02 +10:00
Andrew Bartlett
9edb9763df s3-ntlmssp Remove unused auth_ntlmssp_get_domain()
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:02 +10:00