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

2581 Commits

Author SHA1 Message Date
Volker Lendecke
3084d49cc0 Add a bad hack to enable level 2 oplocks in torture_open_connection_share 2009-04-06 21:32:08 +02:00
Volker Lendecke
0c353b5711 Make cli_oplock_ack async 2009-04-06 21:32:08 +02:00
Volker Lendecke
64ce0e4645 Add async oplock waiter 2009-04-06 21:32:08 +02:00
Volker Lendecke
cb120b4df6 Never hand out 0xffff as a mid
This is used for oplock replies
2009-04-06 21:32:07 +02:00
Volker Lendecke
64067f9204 Remove async_req based async libsmb infrastructure 2009-04-06 21:32:07 +02:00
Volker Lendecke
025eb40fbc Convert cli_open to tevent_req 2009-04-06 21:32:07 +02:00
Volker Lendecke
31910810cf Convert cli_close to tevent_req 2009-04-06 21:32:07 +02:00
Volker Lendecke
ad695b2525 Streamline cli_push sync wrapper 2009-04-06 21:32:07 +02:00
Volker Lendecke
097db28c5d Convert cli_write_andx to tevent_req 2009-04-06 21:32:07 +02:00
Volker Lendecke
17b8d05b62 Streamline cli_pull sync wrapper 2009-04-06 21:32:07 +02:00
Volker Lendecke
c23ccff13a Convert cli_read_andx to tevent_req 2009-04-06 21:32:07 +02:00
Volker Lendecke
ca7cd350a6 Convert cli_ntcreate to tevent_req 2009-04-06 21:32:07 +02:00
Volker Lendecke
807328ce6d Convert cli_tcon_andx to tevent_req 2009-04-06 21:32:07 +02:00
Volker Lendecke
03becb5066 Convert cli_negprot to tevent_req 2009-04-06 21:32:06 +02:00
Volker Lendecke
95c792b6af Convert cli_session_setup_guest to tevent_req 2009-04-06 21:32:06 +02:00
Volker Lendecke
7ef78bd7b5 Convert cli_trans to tevent_req 2009-04-06 21:32:06 +02:00
Volker Lendecke
dec928e884 Convert cli_echo to tevent_req 2009-04-06 21:32:06 +02:00
Volker Lendecke
8bdac3615a Add new async libsmb infrastructure
I know this is just yet another iteration, but I like this one much better than
the one that exists right now :-)

It will do trans and echo requests without a _recv helper and without
unnecessary memcpy().
2009-04-06 21:32:06 +02:00
Volker Lendecke
ba408a2c82 Remove async_req dependency from cli_pull_trans 2009-04-05 16:07:41 +02:00
Volker Lendecke
62f12e2322 Fix an uninitialized variable valgrind error
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-03-31 21:19:15 +02:00
Derrell Lipman
c33f3d5cba [Bug 6228] SMBC_open_ctx failure due to path resolve failure doesn't set errno
Fixed.

It turns out there were a number of places where cli_resolve_path() was called
and the error path upon that function failing did not set errno. There were a
couple of places the failure handling code did set errno to ENOENT, so I made
them all consistent, although I think better errno choices for this condition
exist, e.g.  EHOSTUNREACH.

Derrell
2009-03-27 18:02:46 -04:00
Tim Prouty
db5677d071 s3: parse_packet can return NULL which is then dereferenced in match_mailslot_name 2009-03-24 17:05:16 -07:00
Volker Lendecke
c653e8daaf Fix two memleaks in the encryption code
ntlmssp_seal_packet creates its own signature data blob, which we then
have to free.

Jeremy, please check and merge appropriately (Yes, I'm asking you to do the
janitor work, I want you to *look* at this :-))

Volker
2009-03-24 22:00:10 +01:00
Björn Jacke
87b428e424 s3:dsgetdcname: use parentheses in if condition to make negation clear
Signed-off-by: Günther Deschner <gd@samba.org>
2009-03-24 10:20:12 +01:00
Stefan Metzmacher
6af15943c6 s3:libsmb: use new simplified smb_signing code for the client side
We store the seqnum/mid mapping in the cli_request structure
for async requests and in the cli_state structure for sync calls.

We skip the signing check for oplock requests while waiting
for async requests coming in.

metze
2009-03-23 12:21:14 +01:00
Stefan Metzmacher
c16c90a1cb s3:smbd: use new simplified snb_signing code in the server
We keep the seqnum/mid mapping in the smb_request structure.

This also moves one global variable into the
smbd_server_connection struct.

metze
2009-03-23 12:21:13 +01:00
Stefan Metzmacher
2654653f55 s3:libsmb: add a much simplified smb_siging infrastructure
It's the job of the caller to maintain the seqnum/mid mapping.

Hopefully we can use this code in s4 later too.

metze
2009-03-23 12:21:13 +01:00
Stefan Metzmacher
1a48d0793b s3:libsmb: rename smb_signing.c => clisigning.c
This prepares a large simplification of the smb_signing code

metze
2009-03-23 12:21:12 +01:00
Volker Lendecke
298bff5019 Fix connect to port 139 only -- thanks gd for bugging me :-) 2009-03-23 12:06:57 +01:00
Günther Deschner
1524abd8bf s3-krb5: Fix Coverity #722 (RESOURCE_LEAK).
Guenther
2009-03-20 10:41:44 +01:00
Bo Yang
808928c24b Fix crash in async_smb.c 2009-03-20 09:56:15 +01:00
Stefan Metzmacher
88dd6af605 s3:libsmb: always create bytes array in cli_trans code
Otherwise we return NO_MEMORY without a reason for fragmented trans
requests, as talloc_append_blob() returns buf if we append a 0 length
blob. When we pass buf = NULL we'll get back NULL and then assume
NO_MEMORY...

metze
2009-03-19 13:57:21 +01:00
Stefan Metzmacher
880fbc4e8c s3:libsmb: fix smb signing for fragmented trans/trans2/nttrans requests
Before we send the secondary requests we need to remove the
old mid=>seqnum mapping and reset cli->mid and make the new
mid=>seqnum mapping "persistent".

The bug we had in cli_send_trans was this:
The first cli_send_smb() incremented cli->mid
and the secondary requests used the incremented mid,
but as cli->outbuf still had the correct mid,
we send the correct mid to the server. The real problem
was that the cli_send_smb() function stored the seqnum
under the wrong mid.

cli_send_nttrans() was totally broken and now follows the
same logic as cli_send_trans().

The good thing is that in practice the problem is unlikely to happen,
because max_xmit is large enough to avoid secondary requests.

metze
2009-03-19 13:54:22 +01:00
Jeremy Allison
28e03f2011 Allow DFS client paths to work when POSIX pathnames have been
selected (we need to path in pathname /that/look/like/this).
Jeremy.
2009-03-18 20:57:47 -07:00
Günther Deschner
531af136f9 s3: remove POLICY_HND.
Guenther
2009-03-18 23:22:29 +01:00
Jeremy Allison
8dd1faaa29 Remove the global "struct cm_cred_struct" and associated calls, make
callers pass in a struct user_auth_info * instead. This commit causes
smbc_set_credentials() to print out a message telling callers to use
smbc_set_credentials_with_fallback() instead, as smbc_set_credentials()
has a broken API (no SMBCCTX * pointer). No more global variables used
in the connection manager API for client dfs calls.
Jeremy.
2009-03-17 14:53:06 -07:00
Volker Lendecke
20cee26a3d Convert open_socket_out_defer to tevent_req 2009-03-16 19:32:01 +01:00
Volker Lendecke
8afd835cea Fix a malloc/talloc mismatch when cli_initialise() fails 2009-03-15 12:01:20 +01:00
Jeremy Allison
f48a345e4a Remove pwd_cache.c, it was doing nothing. Make user_name, domain, and
password talloc'ed strings within the cli_struct.
Jeremy.
2009-03-13 17:49:24 -07:00
Jeremy Allison
e5136e9849 Remove the static "struct client_connection" mess which is part of
the problem that stops libsmbclient being thread safe. Subsidiary
DFS connections are now hung off a list inside the cli_state struct.
Much more to do in order to get libsmbclient to thread safety, but
this is a good start.
Jeremy.
2009-03-12 17:59:24 -07:00
Stefan Metzmacher
2fdbafbf54 Revert "s3:libsmb: add an option to cli_push to let the caller provide the buffers"
This reverts commit 9579a6f193.

It's confusing to have a boolean to alter the behavior of cli_push
and as the new feature isn't used yet I revert it.

We can readd a extra function later.

metze
2009-03-12 11:03:50 +01:00
Stefan Metzmacher
9579a6f193 s3:libsmb: add an option to cli_push to let the caller provide the buffers
metze
2009-03-10 14:07:56 +01:00
Stefan Metzmacher
c2993f74af s3:libsmb: only treat a return 0 as end of file
metze
2009-03-10 12:46:16 +01:00
Stefan Metzmacher
7fc8086e11 s3:libsmb: fix a lot of cli_push() bugs
There were the following problems:
1.) if window_size was a multiple of the chunk_size,
    we silently dropped the last truncated chunk.
2.) if window_size was 0 pushed only the first chunk
    to the server and silently dropped the rest.
3.) we had only transferred state->num_reqs writes,
    even if there would be more data to send.

metze
2009-03-10 11:03:15 +01:00
Volker Lendecke
e58ade4136 Fix a smbclient segfault against security=share servers 2009-03-07 15:27:13 +01:00
Volker Lendecke
c29826a697 Fix some nonempty blank lines 2009-03-07 15:27:02 +01:00
Stefan Metzmacher
3f3e15ab91 s3:libsmb: merge cli_setup_signing_state() into cli_initialise_ex()
metze
2009-03-06 16:37:22 +01:00
Stefan Metzmacher
6e572d40a9 s3:libsmb: remove cli_setup_signing_state() and add struct cli_state *cli_initialise_ex()
This prepares the next changes.

metze
2009-03-06 16:37:21 +01:00
Stefan Metzmacher
196a5d0388 s3:signing: the seqnum should only be decremented by 1 for ntcancel requests
[MS-SMB] 3.3.5.1 Receiving Any Message says that the seqnum
is incremented by only for ntcancel requests for any other
request it's by incremented by 2, even if it doesn't expect
a response.

metze
2009-03-06 16:37:20 +01:00
Stefan Metzmacher
918e6288fa s3:libsmb: smb signing works the same for extented and non-extended security
This is only cosmetic, but it makes it easier to understand.

metze
2009-03-06 16:18:50 +01:00