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

3719 Commits

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

metze
2011-09-07 08:33:38 +02:00
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
Andrew Bartlett
3185ecaf54 s3-ntlmssp Remove unused auth_ntlmssp_get_client
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:02 +10:00
Stefan Metzmacher
de71a67a1c s3:libsmb/clifile: make use of cli_set_timeout()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Aug  3 10:16:18 CEST 2011 on sn-devel-104
2011-08-03 10:16:18 +02:00
Stefan Metzmacher
71c695d8d1 s3:cli_np_tstream: make use of cli_set_timeout()
metze
2011-08-03 09:01:40 +02:00
Stefan Metzmacher
b7d5cd90d5 s3:libsmb/clidfs: make use of cli_state_encryption_on()
metze
2011-08-03 09:01:39 +02:00
Stefan Metzmacher
6d1ef3faee s3:libsmb/libsmb_server: make use of cli_set_timeout()
metze
2011-08-02 04:54:29 +02:00
Stefan Metzmacher
91b0aab3fc s3:libsmb/cli*: make use of cli_state_protocol()
metze
2011-08-02 04:54:29 +02:00
Stefan Metzmacher
233336d0c2 s3:libsmb: add cli_state_protocol()
metze
2011-08-02 04:54:28 +02:00
Stefan Metzmacher
6e8a6e033f s3:libsmb/cli*: make use of cli_state_capabilities()
metze
2011-08-02 04:54:28 +02:00
Stefan Metzmacher
ffd99c5de5 s3:libsmb/libsmb_*: make use of cli_state_capabilities()
metze
2011-08-02 04:54:28 +02:00
Stefan Metzmacher
24c5427810 s3:libsmb: add cli_state_capabilities()
metze
2011-08-02 04:54:28 +02:00
Stefan Metzmacher
a83e769b01 s3:smb2cli_base: smb2cli_req_send() needs to call tevent_req_post() on error
metze
2011-08-02 04:54:28 +02:00
Alban Browaeys
11c2d3717c Fix bug #8341 - libsmbclient segfault when feed the root of a mounted share via an uri
Fix null deref.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Aug  2 02:58:26 CEST 2011 on sn-devel-104
2011-08-02 02:58:26 +02:00
Jeremy Allison
2049357217 Added missing return. Not strictly neccessary, the following if (!NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED))
clause will catch this and use tevent_req_nterror(req, status); to set the status as NT_STATUS_OK, but
it looks strange to do it that way.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Jul 30 01:34:24 CEST 2011 on sn-devel-104
2011-07-30 01:34:24 +02:00
Volker Lendecke
fac5c654e2 s3: Add a fallback for missing open&x support in OS/X Lion
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Jul 29 17:55:20 CEST 2011 on sn-devel-104
2011-07-29 17:55:20 +02:00
Michael Adam
f764de64e3 s3:libsmb: use lp_load_client() and lp_load_client_no_reinit() in libsmb_context 2011-07-28 11:17:29 +02:00
Michael Adam
fbf254c19a s3:libsmb: fix a call to lp_load to reinit the globals in any case
The potential previous lp_load of $HOME/.smb/smb.conf might have failed
halfway through and might have left globals initialized in an unwanted state.
So we should make sure to clean up before loading the dyn_CONFIGFILE()
2011-07-28 11:17:27 +02:00
Jeremy Allison
4fdad1960c Fix bug #8324 - smbclient cannot list directories from a big-endian machine.
Two uses of the setup array are not being correctly byte-swapped to little
endian.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Jul 27 03:14:48 CEST 2011 on sn-devel-104
2011-07-27 03:14:48 +02:00
Volker Lendecke
1335059ff5 s3: Fix async smb handling
In cli_echo with more than one response we ended up with more than one read_smb
request. One from the call to cli_smb_req_set_pending called from
cli_smb_received. The other one from cli_smb_received itself. I don't really
see another way to deal with this than to hold the read_smb request in the
cli_state.

Metze, please check!

Volker
2011-07-27 00:47:45 +02:00
Volker Lendecke
57a0f344a1 s3: Fix Coverity ID 2596, REVERSE_INULL
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Jul 24 16:37:19 CEST 2011 on sn-devel-104
2011-07-24 16:37:19 +02:00
Stefan Metzmacher
824a300d2b s3:libsmb: cli_set_secdesc() only needs a const struct security_descriptor
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sat Jul 23 11:08:19 CEST 2011 on sn-devel-104
2011-07-23 11:08:19 +02:00
Stefan Metzmacher
6219bb9899 s3:libsmb: remove unused cli_query_secdesc_old()
metze
2011-07-23 09:55:54 +02:00
Stefan Metzmacher
baee2fbcfd s3:libsmb_xattr: make use of the new cli_query_secdesc()
metze
2011-07-23 09:55:54 +02:00
Björn Baumbach
cb4fc92177 s3-libsmb: introduce new cli_query_secdesc() which returns NTSTATUS
Replacement for cli_query_secdesc_old()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-07-23 09:18:57 +02:00
Björn Baumbach
768646c9a2 s3-libsmb: rename cli_query_secdesc() to cli_query_secdesc_old()
Will introduce new cli_query_secdesc() function

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-07-23 09:18:56 +02:00
Björn Baumbach
40e9d0c440 s3-libsmb: finally remove cli_read_old()
Replaced by new cli_read() which returns NTSTATUS instead of ssize_t.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-07-23 09:18:56 +02:00
Björn Baumbach
8bdbdd46f4 s3-libsmb/libsmb_file.c: replace cli_read_old() with cli_read()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-07-23 09:18:55 +02:00
Stefan Metzmacher
6d4f9fc251 s3:libsmb: move cli_state->desthost to cli_state->conn.remote_name
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Jul 22 18:17:41 CEST 2011 on sn-devel-104
2011-07-22 18:17:41 +02:00
Stefan Metzmacher
9fe30f3c91 s3:libsmb_server: make use of cli_state_remote_name()
metze
2011-07-22 17:06:09 +02:00
Stefan Metzmacher
b5e9ada632 s3:libsmb/libsmb_dir: make use of cli_state_remote_name()
metze
2011-07-22 17:06:09 +02:00
Stefan Metzmacher
8277260ae7 s3:libsmb/clirap2: make use of cli_state_remote_name()
metze
2011-07-22 17:06:09 +02:00
Stefan Metzmacher
390b54554c s3:libsmb/clifsinfo: make use of cli_state_remote_name()
metze
2011-07-22 17:06:09 +02:00
Stefan Metzmacher
ad40515d17 s3:libsmb/clidfs: make use of cli_state_remote_name()
metze
2011-07-22 17:06:09 +02:00
Stefan Metzmacher
77fdebc5e5 s3:libsmb/cliconnect: make use of cli_state_remote_name()
metze
2011-07-22 17:06:09 +02:00
Stefan Metzmacher
b87bd59ecb s3:libsmb: add cli_state_remote_name()
metze
2011-07-22 17:06:09 +02:00
Stefan Metzmacher
b3e0b73280 s3:libsmb: remove const from cli_cm_display()
metze
2011-07-22 17:06:09 +02:00
Stefan Metzmacher
48de329363 s3:libsmb: move cli_state->{src_ss,dest_ss} to cli_state->conn.{local_ss,remote_ss}
metze
2011-07-22 17:06:08 +02:00
Stefan Metzmacher
5c7749ac24 s3:libsmb: only pass const sockaddr_storage to cli_full_connection()
No direct or indirect caller needs this to be set.

metze
2011-07-22 17:06:08 +02:00
Stefan Metzmacher
814449ab01 s3:libsmb_server: pass NULL instead of a zero sockaddr_storage
metze
2011-07-22 17:06:08 +02:00
Stefan Metzmacher
1eb8c2ae22 s3:libsmb: only pass a const sockaddr_storage to cli_start_connection()
Let the caller use cli_state_remote_sockaddr() if needed.

metze
2011-07-22 17:06:08 +02:00
Stefan Metzmacher
0cd70ec169 s3:libsmb: let cli_connect_nb() only expect a const sockaddr_storage *dest_ss
Only one caller expects this value to be set,
which now calls cli_state_remote_sockaddr() to get the value.

metze
2011-07-22 17:06:08 +02:00
Stefan Metzmacher
7f0b4eed3b s3:libsmb: use cli_state_remote_sockaddr() in smb2cli_tcon_send()
metze
2011-07-22 17:06:08 +02:00
Stefan Metzmacher
fa42d2e262 s3:libsmb: add cli_state_[local|remote]_sockaddr()
metze
2011-07-22 17:06:08 +02:00
Stefan Metzmacher
13dbd5021b s3:libsmb: move cli_state->fd to cli_state->conn.fd
metze
2011-07-22 17:06:07 +02:00
Stefan Metzmacher
6d1757f189 s3:libsmb: make use of cli_state_disconnect()
metze
2011-07-22 17:06:07 +02:00
Stefan Metzmacher
103413da8b s3:libsmb: make use of cli_state_is_connected()
metze
2011-07-22 17:06:07 +02:00
Stefan Metzmacher
a11cc880ef s3:libsmb: move cli_state->outgoing to cli_state->conn.outgoing
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Jul 22 09:53:59 CEST 2011 on sn-devel-104
2011-07-22 09:53:59 +02:00
Stefan Metzmacher
9f2b3b0be6 s3:libsmb: move cli_state->pending to cli_state->conn.pending
metze
2011-07-22 08:44:08 +02:00
Stefan Metzmacher
b94a7caa3a s3:libsmb: fix compiler warnings in cli_state_create()
metze
2011-07-22 08:44:08 +02:00
Stefan Metzmacher
ebe258dd40 s3:libsmb: replace cli_initialise[_ex]() by cli_state_create()
This makes sure cli_state->src_ss and cli_state->dest_ss are always
initialized.

metze
2011-07-21 22:08:53 +02:00
Stefan Metzmacher
392ddf970c s3:libsmb: don't pass cli->called.name to NTLMv2_generate_names_blob()
cli->called.name is never initialized, so this change doesn't change
the behavior. And this behavior seems to be correct, see
commit 29c0c37691
s4/libcli: do not use netbios name in NTLMv2 blobs w/o spnego.

metze
2011-07-21 22:08:52 +02:00
Stefan Metzmacher
25447a528a s3:libsmb: move cli->vuid to cli->smb1.uid and hide it behind cli_state_[g|s]et_uid()
metze
2011-07-21 22:08:52 +02:00
Stefan Metzmacher
c70103f3f8 s3:libsmb: add cli_state_encryption_on()
metze
2011-07-21 22:08:51 +02:00
Björn Baumbach
8c360d7f76 s3-libsmb: introduce new NTSTATUS cli_read()
Replacement for cli_read_old()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-07-20 22:09:25 +02:00
Björn Baumbach
9b168e128a s3-libsmb: replace cli_read() with cli_read_old()
Will introduce new cli_read() function.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-07-20 22:09:25 +02:00
Stefan Metzmacher
8f41e54d53 s3:libsmb: move cli->cnum to cli->smb1.tid and hide it behind cli_state_[g|s]et_tid()
metze
2011-07-20 15:56:27 +02:00
Stefan Metzmacher
1e3822115c s3:libsmb: move cli->pid to cli->smb1.pid and hide it behind cli_[g|s]etpid()
metze
2011-07-20 15:55:08 +02:00
Stefan Metzmacher
9fb7e228f5 s3:libsmb: add cli->smb1.vc_num and hide it behind cli_state_get_vc_num()
This makes it clearer, why we send the pid value in the session setup.

metze
2011-07-20 15:54:31 +02:00
Stefan Metzmacher
6c31b610e4 s3:libsmb: move cli->mid to cli->smb1.mid
metze
2011-07-20 15:48:59 +02:00
Stefan Metzmacher
21a6bdc680 s3:libsmb: smb_bytes_talloc_string() doesn't need a cli_state
metze
2011-07-20 15:48:58 +02:00
Björn Baumbach
2052c2d6fa s3-libsmb: remove unused cli_lock()
Replaced with cli_lock32()

Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Jul 19 00:43:03 CEST 2011 on sn-devel-104
2011-07-19 00:43:03 +02:00
Stefan Metzmacher
1aae898908 s3:clikrb5: fix the build with newer heimdal versions
krb5_get_default_in_tkt_etypes() requires a 3rd argument
if KRB5_PDU_NONE is available.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Jul 14 21:21:13 CEST 2011 on sn-devel-104
2011-07-14 21:21:13 +02:00
Günter Kukkukk
9b3357c54e Fix bug 8305 - nmbd segfaults - when using "smbtree ..."
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Jul 13 16:35:16 CEST 2011 on sn-devel-104
2011-07-13 16:35:16 +02:00
Stefan Metzmacher
a1c1f8c83b s3:libsmb: remove unused cli_smb_inbuf()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Jul 13 01:19:51 CEST 2011 on sn-devel-104
2011-07-13 01:19:51 +02:00
Stefan Metzmacher
8a234cbe15 s3:libsmb: remove unused cli_oplock_handler()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Jul 12 10:53:52 CEST 2011 on sn-devel-104
2011-07-12 10:53:52 +02:00
Stefan Metzmacher
c07c4123d9 s3:libsmb: s/SMBkeepalive/NBSSkeepalive
metze
2011-07-12 09:44:04 +02:00
Stefan Metzmacher
7b73b6f964 s3:libsmb: remove unused cli->privileges
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Jul 12 09:30:49 CEST 2011 on sn-devel-104
2011-07-12 09:30:49 +02:00
Stefan Metzmacher
a2e248f270 s3:libsmbclient: use cli_state_is_connected() in SMBC_check_server()
metze
2011-07-11 18:18:27 +02:00
Stefan Metzmacher
e7c9319cac s3:libsmbclient: don't log the lowlevel fd in smbc_free_context()
metze
2011-07-11 18:18:27 +02:00
Stefan Metzmacher
7bba81f69d s3:libsmb: add cli_state_disconnect()
metze
2011-07-11 18:18:26 +02:00
Stefan Metzmacher
fa60a299f5 s3:libsmb: make use of cli_state_is_connected()
metze
2011-07-11 18:18:23 +02:00
Stefan Metzmacher
2b70c0f4f3 s3:libsmb: remove unused cli_set_port()
metze
2011-07-11 16:39:15 +02:00
Stefan Metzmacher
893d137f3f s3:libsmb: also remember the local socket address after connect
metze
2011-07-11 16:39:15 +02:00
Stefan Metzmacher
a2300094db s3:smb2cli_base: add my copyright
metze
2011-07-11 16:35:11 +02:00
Björn Baumbach
f2c5a0afd2 s3-libsmb: let cli_lock64 return NTSTATUS instead of bool
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Jul 11 12:48:38 CEST 2011 on sn-devel-104
2011-07-11 12:48:38 +02:00
Björn Baumbach
57194d8c5d s3-libsmb: introduce cli_lock32()
Same like cli_lock() but return NTSTATUS instead of bool

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-07-11 11:36:50 +02:00
Stefan Metzmacher
957876e76c s3:smb2cli_tcon: use tevent_req_oom()
metze
2011-07-10 17:11:14 +02:00
Volker Lendecke
fd240b546e s3: Fix Coverity ID 2587,2588: CHECKED_RETURN
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Jul 10 10:36:11 CEST 2011 on sn-devel-104
2011-07-10 10:36:11 +02:00
Stefan Metzmacher
244c856cbf s3:smb2cli_base: ask for the next response if there're still pending requests
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sat Jul  9 13:55:04 CEST 2011 on sn-devel-104
2011-07-09 13:55:04 +02:00
Stefan Metzmacher
8b4a3681e5 s3:smb2cli_base: make use of tevent_req_defer_callback()
In order to notify requests of transport layer errors,
we need to defer the triggering of the callbacks,
otherwise we may crash, if one of the callbacks
destroys the cli_state.

metze
2011-07-09 12:40:28 +02:00
Stefan Metzmacher
facc110c79 s3:smb2cli_base: fix memory hierachy in smb2cli_req_recv()
We need to use talloc_reference() if there're more than one
response, but we use it in a way that the caller can't
call talloc_free() or talloc_unlink() on it.

metze
2011-07-09 12:40:28 +02:00
Stefan Metzmacher
504d092aa7 s3:smb2cli_base: call smb2cli_req_unset_pending() before tevent_req_done()
metze
2011-07-09 12:40:27 +02:00
Stefan Metzmacher
242ca5dba3 s3:smb2cli_base: unset the destructor in smb2cli_req_unset_pending()
metze
2011-07-09 12:40:27 +02:00
Stefan Metzmacher
c55bfc0733 s3:smb2cli_base: keep the order of pending requests
metze
2011-07-09 12:40:27 +02:00
Stefan Metzmacher
a9f03f1982 s3:smb2cli_base: rename 'result' => 'req' in smb2cli_req_create()
metze
2011-07-09 12:40:26 +02:00
Stefan Metzmacher
d6cd1ee032 s3:libsmb: remove unused cli->inbuf and cli->bufsize
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Jul  8 15:21:46 CEST 2011 on sn-devel-104
2011-07-08 15:21:46 +02:00
Stefan Metzmacher
fc7359befb s3:libsmb: clistr_pull_talloc() doesn't need base_ptr and flags2 with STR_ASCII
interpret_short_filename() always parses OEM_Strings (in DOS charset).

metze
2011-07-08 14:09:10 +02:00
Stefan Metzmacher
7d757d6ac3 s3:libsmb: remove unused smb_dos_errstr()
metze
2011-07-08 14:09:10 +02:00
Stefan Metzmacher
83301d8b5a s3:libsmb/smberr: make global const arrays static
metze
2011-07-08 14:09:10 +02:00
Stefan Metzmacher
235aedae50 s3:libsmb: don't use the cli->inbuf to store the last error
We keep the raw error in cli->raw_status now, until we fixed all
caller to get the NTSTATUS from the function calls.

metze
2011-07-08 14:09:09 +02:00
Stefan Metzmacher
2c160224c2 s3:libsmb: don't call cli_set_error() in cli_echo()
cli_smb_recv() already does it.

metze
2011-07-08 14:09:09 +02:00
Stefan Metzmacher
f0e6e5c37d s3:libsmb: remove unused enum smb_read_errors infrastructure
metze
2011-07-08 14:09:08 +02:00
Stefan Metzmacher
06247a7a09 s3:libsmb: remove use of cli_errstr() in SMBC_server_internal()
metze
2011-07-08 14:09:07 +02:00
Stefan Metzmacher
fdd6c4e673 s3:libsmb: add smb2cli_query_directory*()
Based on the initial patch from Volker Lendecke <vl@samba.org>.

metze
2011-07-08 01:22:21 +02:00
Stefan Metzmacher
548f7d3f36 s3:libsmb: add smb2cli_write*()
Based on the initial patch from Volker Lendecke <vl@samba.org>.

metze
2011-07-08 01:22:21 +02:00
Stefan Metzmacher
22859b0e89 s3:libsmb: add smb2cli_read*()
Based on the initial patch from Volker Lendecke <vl@samba.org>.

metze
2011-07-08 01:22:21 +02:00
Stefan Metzmacher
d82be9588a s3:libsmb: add smb2cli_flush*()
Based on the initial patch from Volker Lendecke <vl@samba.org>.

metze
2011-07-08 01:22:20 +02:00
Stefan Metzmacher
40ecdeb3fb s3:libsmb: add smb2cli_close*()
Based on the initial patch from Volker Lendecke <vl@samba.org>.

metze
2011-07-08 01:22:20 +02:00
Stefan Metzmacher
2abc34cb4a s3:libsmb: add smb2cli_create*()
Based on the initial patch from Volker Lendecke <vl@samba.org>.

metze
2011-07-08 01:22:20 +02:00
Stefan Metzmacher
f21720773f s3:libsmb: add smb2cli_tcon*() and smb2cli_tdis*()
Based on the initial patch from Volker Lendecke <vl@samba.org>.

metze
2011-07-08 01:22:19 +02:00
Stefan Metzmacher
4efc85c6f1 s3:libsmb: add smb2cli_sesssetup*() and smb2cli_logoff*()
Based on the initial patch from Volker Lendecke <vl@samba.org>.

metze
2011-07-08 01:22:18 +02:00
Stefan Metzmacher
ab913d1768 s3:libsmb: add smb2cli_negprot*()
Based on the initial patch from Volker Lendecke <vl@samba.org>.

metze
2011-07-08 01:22:17 +02:00
Stefan Metzmacher
a0cf7bae60 s3:libsmb: add basic smb2 client infrastructure
Based on the initial patch from Volker Lendecke <vl@samba.org>.

metze
2011-07-08 01:22:17 +02:00
Björn Baumbach
11426758d7 s3-libsmb: Remove use of cli_errstr()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-07-07 19:16:28 +02:00
Stefan Metzmacher
3cdf962d1e s3:libsmb: finally remove unused cli_state->outbuf
metze
2011-07-07 19:16:28 +02:00
Stefan Metzmacher
0f006751ec s3:libsmb: remove unused clistr_push_fn()
metze
2011-07-07 19:16:28 +02:00
Stefan Metzmacher
30574a73d8 s3:libsmb: remove unused clistr_pull_fn()
metze
2011-07-07 19:16:28 +02:00
Stefan Metzmacher
072a27fd9f s3:libsmb: use trans2_bytes_push_str() in cli_tcon_andx_create() for the plaintext password
This makes sure we push the string always in DOS charset.

metze
2011-07-07 19:16:28 +02:00
Stefan Metzmacher
5b1ac1bcc3 s3:libsmb: use trans2_bytes_push_str() in cli_set_ea_path()
metze
2011-07-07 19:16:28 +02:00
Stefan Metzmacher
cea9245909 s3:libsmb: use trans2_bytes_push_str() in cli_dfs_get_referral()
metze
2011-07-07 19:16:28 +02:00
Stefan Metzmacher
2453164317 s3:libsmb: use a talloc_stackframe in cli_dfs_get_referral()
metze
2011-07-07 19:16:27 +02:00
Stefan Metzmacher
b77becdb55 s3:libsmb: use trans2_bytes_push_str/bytes() in cli_list_trans_*()
metze
2011-07-07 19:16:27 +02:00
Stefan Metzmacher
d921200e75 s3:libsmb: use clistr_pull_talloc() for short_name in interpret_long_filename()
metze
2011-07-07 19:16:27 +02:00
Stefan Metzmacher
af66c64e95 s3:libsmb: interpret_long_filename() short_name is always UNICODE
metze
2011-07-07 19:16:27 +02:00
Stefan Metzmacher
eaeeb5ce0e s3:libsmb: add trans2_bytes_push_bytes()
metze
2011-07-07 19:16:27 +02:00
Stefan Metzmacher
ed99caded2 s3:libsmb: make trans2_bytes_push_str() non-static
We should use this and get rid of clistr_push().

metze
2011-07-07 19:16:27 +02:00
Stefan Metzmacher
8a2290667c s3:libsmb: use clistr_pull_talloc() in cli_qfilename()
metze
2011-07-06 17:18:14 +02:00
Stefan Metzmacher
a1df729f7b s3:libsmb: let cli_qfileinfo[_recv]() return recv_flags2
metze
2011-07-06 17:18:13 +02:00
Stefan Metzmacher
2b0cc3c412 s3:libsmb: use clistr_pull_talloc() in cli_get_fs_volume_info()
metze
2011-07-06 17:18:13 +02:00
Stefan Metzmacher
27736bed83 s3:libsmb: the SMB_QUERY_FS_VOLUME_INFO response needs at least 18 data bytes
metze
2011-07-06 17:18:13 +02:00
Stefan Metzmacher
bc98d004c9 s3:libsmb: don't use cli->inbuf in cli_dfs_get_referral()
The rdata buffer returned by cli_trans() doesn't belong to
cli->inbuf, so don't use it.

metze
2011-07-06 17:18:13 +02:00
Stefan Metzmacher
af61f6fce6 s3:libsmb: fix error handling in cli_dfs_get_referral()
We should not return NT_STATUS_OK on error.

metze
2011-07-06 17:18:12 +02:00
Volker Lendecke
26782fbbf3 s3: make cli_resolve_path return NTSTATUS
This looks larger than it is. No parameters needed changing.
2011-07-06 08:35:27 +02:00
Volker Lendecke
80838491e6 s3: Make cli_cm_open return NTSTATUS
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Jul  3 23:57:53 CEST 2011 on sn-devel-104
2011-07-03 23:57:53 +02:00
Volker Lendecke
714e1014c5 s3: Make cli_cm_connect return NTSTATUS 2011-07-03 22:45:26 +02:00
Volker Lendecke
7ca63fb8fe s3: Make "do_connect" return NTSTATUS 2011-07-03 22:45:26 +02:00
Volker Lendecke
3414182af0 s3: Remove a use of cli_errstr 2011-07-03 22:45:25 +02:00
Volker Lendecke
4569a3a75a s3: Remove a use of cli_errstr 2011-07-03 22:45:25 +02:00
Volker Lendecke
8238d89823 s3: Remove a use of cli_errstr 2011-07-03 22:45:25 +02:00
Volker Lendecke
cfbd339b4a s3: Remove a use of cli_errstr 2011-07-03 22:45:25 +02:00
Volker Lendecke
e5ad524902 s3: Remove two uses of cli_errstr
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Jul  3 12:43:32 CEST 2011 on sn-devel-104
2011-07-03 12:43:32 +02:00
Volker Lendecke
c3a6e9b7ce s3: RAP errors are WERROR 2011-07-03 11:31:29 +02:00
Volker Lendecke
c0d168392f s3: Remove some bogus error mappings
The old cli_session_request that used this is gone
2011-07-03 11:31:29 +02:00
Volker Lendecke
c31871264c s3: Allow NULL for arg pwritten in cli_write_andx 2011-07-03 11:31:29 +02:00
Volker Lendecke
25df2fe8e2 S3: Fix some nonempty blank lines 2011-07-03 11:31:29 +02:00
Volker Lendecke
79d27e28ad s3: Fix symlink_reparse_buffer_parse 2011-07-03 11:31:29 +02:00
Volker Lendecke
c1094a8cb0 s3: Add cli_readlink 2011-07-03 11:31:29 +02:00
Volker Lendecke
bbe8e0bcf4 s3: Add cli_symlink 2011-06-24 21:24:17 +02:00
Volker Lendecke
829974c940 s3: Add symlink reparse point marshalling routines 2011-06-24 21:24:17 +02:00
Volker Lendecke
f0ff6f390a Use tevent_req_oom
This fixes a few Coverity errors
2011-06-20 12:33:24 +02:00
Rusty Russell
ca1936fbb2 tdb_compat: use tdb_open_compat.
This is a helper for the common case of opening a tdb with a logging
function, but it doesn't do all the work, since TDB1 and TDB2's log
functions are different types.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
9850f25633 tdb_chainunlock: ignore return value.
TDB2 returns void here.  tdb_chainunlock will *always* return with the
chain unlocked, but it will complain via the log function if it wasn't
locked.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
868d77bc5b tdb_chainlock: check returns for 0, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for != 0 instead of == -1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
6bc59d77b6 tdb_store: check returns for 0, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for != 0 instead of == -1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
1078eb21c4 tdb_delete: check returns for 0, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for != 0 instead of == -1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
058c4f8492 tdb_fetch_compat: use instead of tdb_fetch.
This is a noop for tdb1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
0e4c358e27 tdb_compat.h: divert every tdb build and includes to tdb_compat
We change all the headers and wscript files to use tdb_compat; this
means we have one place to decide whether to use TDB1 or TDB2.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:34 +02:00
Rusty Russell
20687dcd7b smb_share_modes: don't use tdb_jenkins_hash.
It's a nice hash, but this usage has nothing to do with TDB.  So use the
Jenkins hash directly from CCAN instead (it's the same one).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:34 +02:00
Volker Lendecke
9cc68e49ee s3: Fix Coverity ID 2583: RESOURCE_LEAK 2011-06-19 19:36:27 +02:00
Volker Lendecke
59887edd1d s3: Remove unused name_queries
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Jun 19 15:14:38 CEST 2011 on sn-devel-104
2011-06-19 15:14:38 +02:00
Volker Lendecke
809e5ea5ba s3: Fix some type-punned warnings 2011-06-19 14:03:52 +02:00
Volker Lendecke
f811e894c4 s3: Add name_resolve_bcast_send/recv 2011-06-19 14:03:51 +02:00
Volker Lendecke
bc3261f0c5 s3: Fix a memleak in name_resolve_bcast
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Jun 19 12:40:55 CEST 2011 on sn-devel-104
2011-06-19 12:40:55 +02:00
Volker Lendecke
8e02b70767 s3: Add incomplete cli_nttrans_create
secdesc only at this moment
2011-06-19 11:08:12 +02:00
Volker Lendecke
ef816f1c4e s3: Correctly align even 2011-06-19 11:08:12 +02:00
Andrew Tridgell
264409750a s3-util: remove the s3 nterr.c
this is now in common code

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-06-17 17:09:00 +10:00
Andrew Bartlett
1233ba7bf3 libclu/util: Move get_friendly_nt_error_msg() in common.
Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-17 17:08:59 +10:00
Volker Lendecke
c118bcf755 s3: Use resolve_wins_send/recv in resolve_wins
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Jun 12 18:19:41 CEST 2011 on sn-devel-104
2011-06-12 18:19:41 +02:00
Volker Lendecke
0dfcf3ef78 s3: Add resolve_wins_send/recv 2011-06-12 17:07:48 +02:00
Volker Lendecke
12c3c35596 s3: Add query_wins_list_send/recv 2011-06-12 17:07:48 +02:00
Volker Lendecke
f0994c7495 s3: Fix IO_TIMEOUT handling for wins queries 2011-06-12 17:07:47 +02:00
Volker Lendecke
ebf04d79ab s3: Remove "struct ip_service" from resolve_wins 2011-06-12 17:07:47 +02:00
Stefan Metzmacher
fdfb5e95fe s3:libsmb: remove unused cli_state_seqnum infrastructure
metze

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Jun 10 20:37:54 CEST 2011 on sn-devel-104
2011-06-10 20:37:54 +02:00
Stefan Metzmacher
f0ba1afe5f s3:libsmb/clireadwrite: calculate cli_write_max_bufsize() correct based on max_xmit
This is important in order to support DCERPC over ncacn_np against NT4 servers,
where max_xmit is just 4356.

metze
2011-06-10 19:27:05 +02:00
Stefan Metzmacher
73128b7cc7 s3:libsmb/clireadwrite: calculate cli_read_max_bufsize() correct based on max_xmit
This is important in order to support DCERPC over ncacn_np against NT4 servers,
where max_xmit is just 4356.

metze
2011-06-10 19:27:05 +02:00
Stefan Metzmacher
5d06b2197b s3:libsmb/clitrans: correctly transfer the seqnum between secondary and primary requests
This is needed to implement SMB signing correct.

metze
2011-06-10 19:27:05 +02:00
Stefan Metzmacher
1dd24ac06a s3:libsmb/clitrans: fix handling of multi pdu [nt]trans[s][2] calls
We now keep the primary request open for the whole logical request.
The primary request is the one that gets all incoming replies.
While secondary requests are handled as separate one-way requests.

metze
2011-06-10 19:27:05 +02:00
Stefan Metzmacher
10bb088cf1 s3:libsmb/clitrans: use subreq2 as variable for the secondary requests
metze
2011-06-10 19:27:05 +02:00
Stefan Metzmacher
5146c9ba9d s3:libsmb/clitrans: move MID handling to the end of cli_trans_send() and add a comment
metze
2011-06-10 19:27:05 +02:00
Stefan Metzmacher
0a8fd50bd8 s3:libsmb/clitrans: correctly marshall [nt]trans[s][2] requests
We need to align params and data to 4 byte offsets.

This also correctly recalculates the useable space after each step.

metze
2011-06-10 19:27:05 +02:00
Stefan Metzmacher
6f7af1b038 s3:libsmb/clitrans: marshall SMBnttrans[2] as the others
This is just to make the code more readable
and easier to notice how many words we're using in vwv.

metze
2011-06-10 19:27:05 +02:00
Stefan Metzmacher
428a86c92b s3:libsmb/clitrans: use uint32_t for param and data variables
SMBnttrans uses 32-bit values there.

metze
2011-06-10 19:27:05 +02:00
Stefan Metzmacher
2ae565b681 s3:libsmb/clitrans: remove unused secondary_request_ctx
metze
2011-06-10 19:27:05 +02:00
Stefan Metzmacher
3dd1ebd21e s3:libsmb/async_smb: add helpers to get and set the seqnum for signing
This will be used for correct signing in [nt]trans[2][s] requests.

metze
2011-06-10 19:27:05 +02:00
Stefan Metzmacher
a25936f1b1 s3:libsmb/async_smb: don't remove pending requests if the mid is set
If the mid was set explicitly, it means the request expects more than
one reply, so leave it in the pending array.

metze
2011-06-10 19:27:05 +02:00
Stefan Metzmacher
173fc258e4 s3:libsmb/async_smb: call cli_smb_req_unset_pending() instead of destructor directly
metze
2011-06-10 19:27:05 +02:00
Stefan Metzmacher
49cdf171a5 s3:libsmb/async_smb: let cli_smb_recv() initialize output values for one way requests
metze
2011-06-10 19:27:05 +02:00
Günther Deschner
ed10726abc source3/libsmb/proto.h: fix licence/copyright
Guenther
2011-06-10 15:12:32 +02:00
Günther Deschner
005930411c source3/libsmb/nmblib.h: fix licence/copyright
Guenther
2011-06-10 15:12:31 +02:00
Günther Deschner
81b5d8538a source3/libsmb/libsmb.h: fix licence/copyright
Guenther
2011-06-10 15:12:29 +02:00
Günther Deschner
c1058ad476 source3/libsmb/errormap_wbc.h: fix licence/copyright
Guenther
2011-06-10 15:12:27 +02:00
Günther Deschner
1e9f2bdb2f source3/libsmb/clidgram.h: fix licence/copyright
Guenther
2011-06-10 15:12:25 +02:00
Andrew Bartlett
74eed8f3ed s3-param Remove special case for global_myname(), rename to lp_netbios_name()
There is no reason this can't be a normal constant string in the
loadparm system, now that we have lp_set_cmdline() to handle overrides
correctly.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
f348d148b4 s3-param Remove special case for global_scope()
There is no reason this can't be a normal constant string in the
loadparm system.  (Past reasons were that we didn't have lp_set_cmdline())

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
acdf5b0d4c s3-libsmbclient Use workgroup from libsmbclient caller for domain in credentials
This previously set the workgroup, which is a different thing, but
would have been the default if no domain was specified).  This more
clearly sets the information from the credentials file into the
matching field in the credentials structure.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
8d4a8389bb s3-talloc Change TALLOC_MEMDUP() to talloc_memdup()
Using the standard macro makes it easier to move code into common, as
TALLOC_MEMDUP isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
5e26e94092 s3-talloc Change TALLOC_ZERO_ARRAY() to talloc_zero_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
ad0a07c531 s3-talloc Change TALLOC_ZERO_P() to talloc_zero()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_P isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
d5e6a47f06 s3-talloc Change TALLOC_P() to talloc()
Using the standard macro makes it easier to move code into common, as
TALLOC_P isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
3d15137653 s3-talloc Change TALLOC_ARRAY() to talloc_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
73b377432c s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc()
Using the standard macro makes it easier to move code into common, as
TALLOC_REALLOC_ARRAY isn't standard talloc.

Andrew Bartlett
2011-06-09 12:40:08 +02:00
Stefan Metzmacher
957cfd23e1 s3:libsmb/cli_np_tstream: s/TSTREAM_CLI_NP_BUF_SIZE/TSTREAM_CLI_NP_MAX_BUF_SIZE
This isn't the fixed buffer size anymore, as we use dynamic beffer
it's just the maximum size.

metze
2011-06-08 17:46:22 +02:00
Stefan Metzmacher
ad1cf187fd s3:libsmb:cli_np_tstream: use dynamic talloc buffers
Having 8192 bytes on an idle connection is a bit to much,
so we better use dynamic buffers using talloc, which also
avoids a memcpy in the common SMBtrans readv codepath.

metze
2011-06-08 17:46:22 +02:00
Stefan Metzmacher
c3ac298a1f s3:libsmb/cli_np_tstream: use larger buffers to avoid a bug NT4 servers (bug #8195)
NT4 servers return NT_STATUS_PIPE_BUSY if we try a SMBtrans
and the SMBwriteX before hasn't transmited the whole DCERPC fragment.

W2K and above is happy with that.

As a result we try to match the behavior of Windows and older Samba clients,
they use write and read buffers of 4280 bytes instead of 1024 bytes.
On Windows only the SMBtrans based read uses 1024 (while we also use 4280
there).

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Jun  7 20:25:32 CEST 2011 on sn-devel-104
2011-06-07 20:25:32 +02:00
Volker Lendecke
56eab757d0 s3: Remove unused variables
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Jun  7 00:42:51 CEST 2011 on sn-devel-104
2011-06-07 00:42:51 +02:00
Volker Lendecke
976a43c5aa s3: Remove a pointless if-statement
We are here only if we have more than one num_pending

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon Jun  6 18:21:17 CEST 2011 on sn-devel-104
2011-06-06 18:21:17 +02:00
Volker Lendecke
2d90a89942 s3: Make name_resolve_bcast do parallel lookups to all interfaces 2011-06-05 14:08:00 +02:00
Volker Lendecke
fbe7b47c34 s3: Add name_queries_send/recv 2011-06-05 14:08:00 +02:00
Rusty Russell
56e72337b0 lib/util/time.c: timeval_current_ofs_msec
Several places want "milliseconds from current time", and several were
simply doing "msec * 1000" which can (and does in one place) result in
a usec value over 1 a million.

Using a helper to do this is safer and more readable.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-01 10:38:47 +02:00
Andrew Bartlett
c7b9dbea10 s3-libsmb remove ldap_err2string() as common nterrs[] has the constants
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue May 31 08:58:00 CEST 2011 on sn-devel-104
2011-05-31 08:58:00 +02:00