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

181 Commits

Author SHA1 Message Date
Michael Adam
476672b647 dlist: remove unneeded type argument from DLIST_ADD_END()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-02-06 21:48:17 +01:00
Richard Sharpe
6abd986704 Convert all uses of uint8/16/32 to _t in source3/smbd.
Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-06 04:14:14 +02:00
Stefan Metzmacher
4b9f17eca7 s3:smbd: pass smbXsrv_connection to srv_send_smb()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Volker Lendecke
823215bf98 smbd: "err" is no longer set in get_lock_offset
This was only referenced in the !HAVE_LONGLONG section

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-22 15:32:39 +02:00
Volker Lendecke
5a1fb2eb0d smbd: brl_lock_cancel does not need "blr" anymore
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-04 06:31:16 +02:00
Volker Lendecke
f038cf739d smbd: do_lock does not need "blr" anymore
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-04 06:31:16 +02:00
Volker Lendecke
c886e66232 smbd: brl_lock does not need "blr" anymore
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-04 06:31:16 +02:00
Volker Lendecke
27ef395771 smbd: Remove an outdated comment
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-04 06:31:16 +02:00
Jeremy Allison
954401f8b2 s3: smbd: Locking - re-add pending lock records if we fail to acquire a lock (and the lock hasn't timed out).
Keep the blocking lock record and the pending lock records consistent
if we are dealing with multiple blocking lock requests in one SMB1 LockingX
request.

Ensure we re-add the records under the record lock, to avoid race
conditions.

Bug #10684 - SMB1 blocking locks can fail notification on unlock, causing client timeout.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2014-07-03 21:41:12 +02:00
Jeremy Allison
cc9de6eb09 s3: smbd: Locking - treat lock timeout the same as any other error.
Allows the special case in process_blocking_lock_queue()
that talks back to the client to be removed.

Bug #10684 - SMB1 blocking locks can fail notification on unlock, causing client timeout.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2014-07-03 21:41:12 +02:00
Jeremy Allison
12be57ef3b s3: smbd: Locking - add and use utility function lock_timed_out().
Bug #10684 - SMB1 blocking locks can fail notification on unlock, causing client timeout.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2014-07-03 21:41:12 +02:00
Jeremy Allison
517fa80bd3 s3: smbd: Locking - convert to using utility macro used elsewhere.
Bug #10684 - SMB1 blocking locks can fail notification on unlock, causing client timeout.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2014-07-03 21:41:12 +02:00
Volker Lendecke
e533bf3ef1 smbd: Fix blank line endings 2013-09-11 08:27:10 +02:00
Jeremy Allison
50a288cb6a Add the ability to send an NTSTATUS result back with a trans2 reply so we can return a parameter block with an error code.
This is needed when returning a STATUS_INVALID_NAME result (tested
from Windows 2012).

Bug 9992 - Windows error 0x800700FE when copying files with xattr names containing ":"

Signed-off-by: Jeremy Allison <jra@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-07-19 17:52:39 +10:00
Stefan Metzmacher
ae1cb5ca04 s3:smbd: s/struct timed_event/struct tevent_timer
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:56 +01:00
Stefan Metzmacher
415e8e0513 s3:smbd: s/struct event_context/struct tevent_context
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:51 +01:00
Volker Lendecke
64c0367335 s3: Fix a crash in reply_lockingX_error
A timed brlock with 2 locks comes in and the second one blocks,
file is closed. smbd_cancel_pending_lock_requests_by_fid sets
blr->fsp to NULL. reply_lockingX_error (called via
MSG_SMB_BLOCKING_LOCK_CANCEL) deferences blr->fsp because
blr->lock_num==1 (the second one blocked).

This patch fixes the bug by only undoing the locks if fsp!=NULL.
fsp==NULL is the close case where everything is undone anyway.

Thanks to Peter Somogyi, somogyi@hu.ibm.com for this bug report.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Aug  8 04:12:04 CEST 2012 on sn-devel-104
2012-08-08 04:12:04 +02:00
Michael Adam
ee6580c67f s3:smbd: change blocking.c to use fsp_fnum_dbg() for fsp->fnum logging.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-15 03:28:14 +02:00
Volker Lendecke
3b2c9bebc0 s3: Replace chain_reply
This is a new implementation of our andx handling code. The old
code was quite involved in that it was called from within the reply_
handlers. This leads to pretty complex faking of smb_request
structures to give them the same environment, independent of whether
they are called directly or from within chain_reply.

chain_reply needs to go because it blocks really async handling of
chained requests.
2012-03-10 15:34:11 +01:00
Volker Lendecke
90b33a05e9 s3: Make sure the andX chains are ended correctly
Normally chain_reply took care of this. This will go away soon.
2012-03-10 15:34:11 +01:00
Volker Lendecke
de870e979b s3: Introduce "req" helper var in reply_lockingX_success
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Wed Feb 29 03:08:53 CET 2012 on sn-devel-104
2012-02-29 03:08:53 +01:00
Stefan Metzmacher
704cf10645 s3:smbd: avoid using sconn_server_id()
metze
2011-12-16 13:19:32 +01:00
Stefan Metzmacher
500d703977 s3:smbd/blocking: use talloc_get_type_abort() as private_data can't be NULL
metze
2011-12-14 12:00:07 +01:00
Stefan Metzmacher
f426eb13c9 s3:smbd/blocking: pass smbd_server_connection as private_data to process_blocking_lock_cancel_message()
metze
2011-12-13 12:36:34 +01:00
Stefan Metzmacher
d1e0997614 s3:smbd/blocking: pass smbd_server_connection as private_data to received_unlock_msg()
metze
2011-12-12 20:14:41 +01:00
Stefan Metzmacher
1909cb0724 s3:smbd/blocking: avoid usage of server_event_context()
metze
2011-12-12 14:35:42 +01:00
Andrew Bartlett
b373d0e777 s3-build: Provide a run-time shim to work around duplicate symbols
The become_root() and similar 'smbd' functions that are used widely in
Samba libraries had 'dummy' copies in dummysmbd.c and dummyroot.c.

These have been replaced by a runtime plugin mechanim, which ensures
that standlone binaries still do nothing, while in smbd the correct
function is used.

This avoids having these as duplicate symbols in the smbd binary,
which can cause unpredictable behaviour.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-21 15:54:51 +10: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
e5dd03d199 s3-globals Remove smbd_event_context() (use server_event_context())
This has been a wrapper around server_event_context() for some time
now, and removing this from dummmysmbd.c assists with library
dependencies.

Andrew Bartlett
2011-05-31 00:32:07 +02:00
Jeremy Allison
4f41be356a Fix many const compiler warnings. 2011-05-05 10:41:59 -07:00
Günther Deschner
ab36d597e7 s3-messages: make ndr_messaging.h part of messages.h.
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
b2af281e50 s3-messages: only include messages.h where needed.
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
8c24ebf371 s3: include smbd/smbd.h where needed.
Guenther
2011-03-30 01:13:08 +02:00
Volker Lendecke
e128b23165 s3: Remove smbd_server_conn from process_blocking_lock_cancel_message 2010-10-03 18:17:09 +02:00
Volker Lendecke
c0eb35c0a2 s3: Remove smbd_server_conn from smb1 receive_unlock_msg 2010-10-03 18:17:09 +02:00
Volker Lendecke
1808dd0a85 s3: Make srv_send_smb take an sconn instead of a sock fd 2010-08-24 21:06:41 +02:00
Volker Lendecke
774bae74d1 s3: Remove smbd_server_fd from blocking_lock_reply_error 2010-08-16 22:39:16 +02:00
Volker Lendecke
9115beb88c s3: Remove smbd_server_fd from generic_blocking_lock_error 2010-08-16 22:39:16 +02:00
Volker Lendecke
02a42a0a1d s3: Remove procid_self() from blocking_lock_cancel_smb1() 2010-07-05 11:06:28 +02:00
Volker Lendecke
f60c6f55c9 s3: Remove procid_self() from process_blocking_lock_queue() 2010-07-05 11:06:28 +02:00
Volker Lendecke
a9aa582de5 s3: Remove procid_self() from remove_pending_lock_requests_by_mid_smb1() 2010-07-05 11:06:28 +02:00
Volker Lendecke
a07c1586ba s3: Remove procid_self() from cancel_pending_lock_requests_by_fid() 2010-07-05 11:06:28 +02:00
Volker Lendecke
c49f6a681d s3: Remove procid_self() from generic_blocking_lock_error() 2010-07-05 11:06:28 +02:00
Volker Lendecke
d42806a013 s3: Remove procid_self() from push_blocking_lock_request() 2010-07-05 11:06:28 +02:00
Volker Lendecke
eb29f84b5f s3: Remove smbd_messaging_context() from blocking_lock_cancel_smb1() 2010-07-05 11:06:28 +02:00
Volker Lendecke
dd48e0afe0 s3: Remove smbd_messaging_context() from process_trans2() 2010-07-05 11:06:28 +02:00
Volker Lendecke
ae75a90b18 s3: Remove smbd_messaging_context() from process_lockingX() 2010-07-05 11:06:27 +02:00
Volker Lendecke
e606b27114 s3: Remove smbd_messaging_context() from reply_lockingX_error() 2010-07-05 11:06:27 +02:00
Volker Lendecke
fef875f64f s3: Remove smbd_messaging_context() from push_blocking_lock_request() 2010-07-05 11:06:27 +02:00
Volker Lendecke
5dc2fe5fdc s3: Explicitly pass sconn to process_blocking_lock_queue_smb2 2010-06-12 15:42:57 +02:00