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

101 Commits

Author SHA1 Message Date
Stefan Metzmacher
451b11251f s3:libsmb: don't pass down FLAG_CASELESS_PATHNAMES and FLAGS2_DFS_PATHNAMES anymore
They're now handled at the smbXcli_conn and smbXcli_tcon layer.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-17 16:14:58 +02:00
Stefan Metzmacher
b9100a7ac4 libcli/smb: pass down smbXcli_tcon to smb1cli_req_create/send() and smb1cli_trans*
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jul 24 21:22:44 CEST 2012 on sn-devel-104
2012-07-24 21:22:44 +02:00
Stefan Metzmacher
20e4392b25 s3:libsmb: make use of cli_state_[g|s]et_tid()
metze
2012-07-24 18:44:04 +02:00
Stefan Metzmacher
43b070d8dd libcli/smb: pass down smbXcli_session to smb1cli_req_create/send() and smb1cli_trans*
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jul 24 00:08:58 CEST 2012 on sn-devel-104
2012-07-24 00:08:58 +02:00
Luk Claes
cdec0c4646 s3:libsmb: use cli_state_{g,s}et_uid instead of smb1.uid directly
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-07-23 22:13:29 +02:00
Luk Claes
3c9c06ac05 s3:libsmb: get rid of cli_state_capabilities
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-28 14:49:46 +02:00
Stefan Metzmacher
dd28b28ede s3:libsmb: implement cli_trans* on top of smb1cli_trans*
metze
2011-11-24 19:02:32 +01:00
Stefan Metzmacher
20df0f34a8 s3:libsmb: verify num_setup for SMBnttrans in cli_pull_trans()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Nov 18 15:13:52 CET 2011 on sn-devel-104
2011-11-18 15:13:52 +01:00
Stefan Metzmacher
d3cb61cf05 s3:libsmb: fix compiler warning in cli_pull_trans()
metze
2011-11-18 13:30:48 +01:00
Stefan Metzmacher
48bcb8c846 s3:libsmb: only align unicode pipe_name (bug #8586)
metze
2011-11-18 13:30:48 +01:00
Stefan Metzmacher
1d531090bc s3:libsmb: make use of map_nt_error_from_unix_common() in clitrans.c
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Oct 26 17:53:15 CEST 2011 on sn-devel-104
2011-10-26 17:53:15 +02:00
Stefan Metzmacher
9a3e5965b4 s3:libsmb: avoid using smb_flg2 in cli_trans.c
metze
2011-10-26 16:18:28 +02:00
Stefan Metzmacher
f3166e75ef s3:libsmb: replace smb_size - 4 with MIN_SMB_SIZE in clitrans.c
metze
2011-10-26 15:44:52 +02:00
Stefan Metzmacher
7221ce9bd5 s3:libsmb: use 'tevent_' instead of 'event_' in clitrans.c
metze
2011-10-26 15:43:08 +02:00
Stefan Metzmacher
f8f7f4e3ab s3:libsmb: make use of smb_buffer_oob() in clitrans.c
metze
2011-10-26 15:41:34 +02:00
Stefan Metzmacher
431b476868 s3:libsmb: use smb_len_nbt() in clitrans.c
metze
2011-10-26 15:41:02 +02:00
Stefan Metzmacher
afda15aa86 s3:libsmb: make use of cli_state_available_size() in cli_trans_format()
metze
2011-09-13 13:16:08 +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
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
Volker Lendecke
0645deb1b4 s3: Do central cli_set_error 2011-05-19 17:31:30 +02:00
Günther Deschner
27022587e3 s3-libsmb: move protos to libsmb/proto.h
Guenther
2011-05-06 16:37:18 +02:00
Günther Deschner
50883cfeb4 s3-tevent: only include ../lib/util/tevent wrappers where needed.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri Apr 29 14:00:30 CEST 2011 on sn-devel-104
2011-04-29 14:00:30 +02:00
Andrew Tridgell
15e84a9a09 charcnv: removed the allow_badcharcnv and allow_bad_conv options to convert_string*()
we shouldn't accept bad multi-byte strings, it just hides problems

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Mar 24 01:47:26 CET 2011 on sn-devel-104
2011-03-24 01:47:26 +01:00
Volker Lendecke
6e684c8460 s3: Remove unused cli_send/receive_trans 2011-01-17 08:03:42 +01:00
Volker Lendecke
2d44a0583b s3: Remove unused cli_send/receive_nt_trans 2011-01-17 08:03:42 +01:00
Günther Deschner
c7fe04abc7 s3-build: only include async headers where needed.
Guenther
2010-09-20 13:54:42 -07:00
Volker Lendecke
0a224bc77b s3: Save the received trans2 from the inbuf in cli_trans 2010-08-05 13:57:29 +02:00
Volker Lendecke
82f6f3920c s3: Explicitly handle inbuf in cli_trans_done 2010-02-22 23:23:20 +01:00
Volker Lendecke
d122bfc064 s3: Add a talloc_move for the inbuf to cli_smb_recv 2010-02-22 23:23:18 +01:00
Volker Lendecke
f4cf1c56a2 s3: Add min_setup, min_param and min_data to cli_trans_recv
Every caller that expects to receive something needs to check if enough was
sent. Make this check mandatory for everyone.

Yes, this makes the parameter list for cli_trans a bit silly, but that's just
the way it is: A silly protocol request :-)

While there, convert some _done functions to tevent_req_simple_finish_ntstatus.
2009-11-14 12:20:12 +01:00
Bo Yang
05379f0125 s3: return proper error code in cli_smb_req_send
Signed-off-by: Bo Yang <boyang@samba.org>
2009-05-13 18:47:00 +08:00
Jeremy Allison
ad9d64ee1b Clean up assignments to iov_base, ensure it's always cast to void *. This should quieten some warnings with picky compilers on the buildfarm.
Jeremy.
2009-05-12 11:45:37 -07:00
Andrew Bartlett
3b3e21bd9b Convert Samba3 to use the common lib/util/charset API
This removes calls to push_*_allocate() and pull_*_allocate(), as well
as convert_string_allocate, as they are not in the common API

To allow transition to a common charcnv in future, provide Samba4-like
strupper functions in source3/lib/charcnv.c

(the actual implementation remains distinct, but the API is now shared)

Andrew Bartlett
2009-04-14 12:53:56 +10:00
Volker Lendecke
7ef78bd7b5 Convert cli_trans to tevent_req 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
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
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
Volker Lendecke
c14b7e648b Split up async_req into a generic and a NTSTATUS specific part 2009-02-01 19:05:39 +01:00
Volker Lendecke
37da26a06e Add the strlen to push to smb_bytes_push_str, return the converted size
The pushed strlen replaces the STR_TERMINATE flag which I personally always
find very confusing.
2009-01-29 21:38:06 +01:00
Volker Lendecke
4abdd3981e Pass "bytes_alignment" up through cli_request_send
This parameter makes smb_spice_chain add padding before the bytes field
2008-12-19 14:53:29 +01:00
Volker Lendecke
7fbb64d726 Simplify async programming a bit with helper routines
Introduce async_req_is_error() and async_req_simple_recv()
2008-12-08 22:09:33 +01:00