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

142 Commits

Author SHA1 Message Date
Jeremy Allison
79c8b75671 s3: libsmb: Add uint16_t addtional_flags2 to cli_smb_req_create().
Not yet used.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
2016-08-19 20:03:12 +02:00
Jeremy Allison
a876f915fd s3: libsmb: Add uint16_t additional_flags2 arg to cli_smb_send().
Not yet used.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
2016-08-19 20:03:11 +02:00
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
Stefan Metzmacher
324c51c25b s3:libsmb: don't require a pinbuf in cli_smb_recv() to keep the memory
metze
2012-06-05 17:33:49 +02:00
Luk Claes
aea996dba6 s3:libsmb: get rid of cli_smb_req_*,cli_smb_wct_ofs,cli_smb_chain_send
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Jun  3 23:37:02 CEST 2012 on sn-devel-104
2012-06-03 23:37:02 +02:00
Luk Claes
f7f73c4dba s3:libsmb: get rid of cli_has_async_calls
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-28 14:49:50 +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
Luk Claes
f43231c051 s3:libsmb: remove unused (un)set_pending functions
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-28 14:49:44 +02:00
Stefan Metzmacher
9ebdee2817 s3:libsmb: implement cli_state based functions on top of smbXcli_conn/smbXcli_req
metze
2011-11-24 19:02:31 +01:00
Björn Baumbach
e4934a1e42 s3-libsmb: introduce option to disable dos error mapping
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-11-16 19:02:12 +01:00
Stefan Metzmacher
230cd1e276 s3:libsmb: return NT_STATUS_OK for if a request is not the last one in the chain
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Nov  7 11:38:05 CET 2011 on sn-devel-104
2011-11-07 11:38:05 +01:00
Stefan Metzmacher
597f2ae342 s3:libsmb: make sure have_andx_command() returns false for non AndX commands
metze
2011-11-07 09:18:18 +01:00
Stefan Metzmacher
b20775fb3b s3:libsmb: remember the seqnum on all chained requests
This is needed in order to verify the incoming signature
correctly.

metze
2011-11-07 09:18:10 +01:00
Stefan Metzmacher
20fe7658a7 s3:libsmb: get cmd of the chained request before changing wct_ofs
metze
2011-11-07 09:18:10 +01:00
Stefan Metzmacher
e947acaa8a s3:libsmb: s/event_context/tevent_context/ in async_smb.[ch]
metze
2011-10-25 17:58:33 +02:00
Stefan Metzmacher
242292d4de s3:libsmb: make use of map_nt_error_from_unix_common() in async_smb.c
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Oct 25 03:21:06 CEST 2011 on sn-devel-104
2011-10-25 03:21:06 +02:00
Stefan Metzmacher
6fb13f4c19 s3:libsmb: use HDR_* defines in cli_state_dispatch_smb1()
metze
2011-10-25 01:47:22 +02:00
Stefan Metzmacher
648665a008 s3:libsmb: make use of smb_[set]len_nbt() in async_smb.c
metze
2011-10-25 01:47:21 +02:00
Stefan Metzmacher
d670d060fc s3:libsmb: use HDR_* defines in cli_pull_raw_error()
metze
2011-10-25 01:47:21 +02:00
Stefan Metzmacher
7ebd4337ac libcli/smb: move source3/libsmb/read_smb.* to the toplevel
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Oct 24 10:18:06 CEST 2011 on sn-devel-104
2011-10-24 10:18:06 +02:00
Stefan Metzmacher
75d146d3ed libcli/smb: move smb_seal.c to the toplevel
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Oct 21 10:22:39 CEST 2011 on sn-devel-104
2011-10-21 10:22:39 +02:00
Stefan Metzmacher
81f71e76fd s3:libsmb/async_smb: in cli_state_notify_pending() we always disconnect
So we should always set state->mid = 0.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Oct 20 11:34:23 CEST 2011 on sn-devel-104
2011-10-20 11:34:23 +02:00
Volker Lendecke
fbf1748984 s3: Avoid a winbind 100% cpu loop
When a DC goes down hard, winbind can end up in a 100% CPU loop. The next
(small) RPC request to the DC ends up as a trans2 request. If the connection
goes down, we end up trying to discard the request via the loop in
cli_state_notify_pending(). Because this is a trans2 request,
cli_smb_req_unset_pending will not kick in. Thus the pending array will always
remain at length 1.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Oct 19 01:39:35 CEST 2011 on sn-devel-104
2011-10-19 01:39:35 +02:00
Stefan Metzmacher
2bb17dc23e s3:libsmb: return INTERNAL_ERROR if the request is in bad state when the caller ships it
metze
2011-09-18 05:33:10 +02:00
Stefan Metzmacher
bbe78ca5a2 s3:libsmb: return if tevent_req_set_endtime() fails
tevent_req_set_endtime() already calls tevent_req_nomem().

metze
2011-09-18 05:33:10 +02:00
Stefan Metzmacher
28e3d09916 s3:libsmb: s/cli_encryption_on/cli_state_encryption_on()
metze
2011-09-15 16:17:45 +02:00
Stefan Metzmacher
b02d27ae05 s3:libsmb: move cli->smb1.mid to cli->conn.smb1.mid
metze
2011-09-15 12:12:23 +02:00
Stefan Metzmacher
a6e8167e4a s3:libsmb: return NT_STATUS_CONNECTION_DISCONNECTED instead of NT_STATUS_CONNECTION_INVALID
We should return the same in all places.

metze
2011-09-14 18:03:17 +02:00
Stefan Metzmacher
1dc3ac242a s3:libsmb: let cli_pull_raw_error() return NT_STATUS_OK as DOS-Error success
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Sep 12 19:12:21 CEST 2011 on sn-devel-104
2011-09-12 19:12:21 +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
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