summaryrefslogtreecommitdiffstats
path: root/source/smbd/blocking.c
Commit message (Collapse)AuthorAgeFilesLines
* Some more talloc_tos()Volker Lendecke2008-01-101-5/+5
|
* Fix %d / size_t printf arg missmatch.Jeremy Allison2008-01-051-2/+2
| | | | Jeremy.
* Fix interesting bug found with make valgrindtest. When cancellingJeremy Allison2008-01-041-10/+14
| | | | | | | a lock due to file closure make sure we null out the fsp pointer so it isn't dangling. This is an old bug (not related to the new changes). Jeremy.
* Refactor the crypto code after a very helpful conversationJeremy Allison2008-01-041-13/+21
| | | | | | with Volker. Mostly making sure we have data on the incoming packet type, not stored in the smb header. Jeremy.
* Add new parameter, "min receivefile size" (by default setJeremy Allison2007-10-301-2/+2
| | | | | | | | | to zero). If non-zero, writeX calls greater than this value will be left in the socket buffer for later handling with recvfile (or userspace equivalent). Definition of recvfile for your system is left as an exercise for the reader (I'm working on getting splice working :-). Jeremy.
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-15/+15
| | | | | | | bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy.
* r24809: Consolidate the use of temporary talloc contexts.Volker Lendecke2007-10-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the two functions talloc_stackframe() and talloc_tos(). * When a new talloc stackframe is allocated with talloc_stackframe(), then * the TALLOC_CTX returned with talloc_tos() is reset to that new * frame. Whenever that stack frame is TALLOC_FREE()'ed, then the reverse * happens: The previous talloc_tos() is restored. * * This API is designed to be robust in the sense that if someone forgets to * TALLOC_FREE() a stackframe, then the next outer one correctly cleans up and * resets the talloc_tos(). The original motivation for this patch was to get rid of the sid_string_static & friends buffers. Explicitly passing talloc context everywhere clutters code too much for my taste, so an implicit talloc_tos() is introduced here. Many of these static buffers are replaced by a single static pointer. The intended use would thus be that low-level functions can rather freely push stuff to talloc_tos, the upper layers clean up by freeing the stackframe. The more of these stackframes are used and correctly freed the more exact the memory cleanup happens. This patch removes the main_loop_talloc_ctx, tmp_talloc_ctx and lp_talloc_ctx (did I forget any?) So, never do a tmp_ctx = talloc_init("foo"); anymore, instead, use tmp_ctx = talloc_stackframe() :-) Volker
* r24791: Fix logic error in timeout of blocking lock processing found byJeremy Allison2007-10-101-22/+29
| | | | | | Ronnie. If a lock timeout expires, we must check we can get the lock before responding with failure. Volker is writing a torture test. Jeremy.
* r24702: Remove the old API pointersVolker Lendecke2007-10-101-3/+1
|
* r24404: Remove get_OutBuffer usage from blocking.cVolker Lendecke2007-10-101-27/+14
|
* r24163: Remove the send_trans2_replies_new wrapperVolker Lendecke2007-10-101-1/+1
| | | | | This changes send_trans2_replies to not depend on large buffers anymore and finishes the trans2 conversion.
* r24160: process_trans2 in smbd/blocking.c used send_trans2_replies.Volker Lendecke2007-10-101-6/+11
| | | | | | Fake a struct smb_request here. Volker
* r24070: Apply some constVolker Lendecke2007-10-101-1/+1
|
* r23997: Check in the infrastructure for getting rid of the global ↵Volker Lendecke2007-10-101-1/+1
| | | | | | | | | | | | | | | | | | InBuffer/OutBuffer The complete history of this patch can be found under http://www.samba.org/~vlendec/inbuf-checkin/. Jeremy, Jerry: If possible I would like to see this in 3.2.0. I'm only checking into 3_2 at the moment, as it currently will slow down operations for all non-converted (i.e. all at this moment) operations, as it will copy the talloc'ed inbuf over the global InBuffer. It will need quite a bit of effort to convert everything necessary for the normal operations an XP box does. I have patches for negprot, session setup, tcon_and_X, open_and_X, close. More to come, but I would appreciate some help here. Volker
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-10-101-2/+1
|
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | Jeremy.
* r23510: Tidy calls to smb_panic by removing trailing newlines. Print theJames Peach2007-10-101-2/+2
| | | | failed expression in SMB_ASSERT.
* r23015: Make message_(de)register static to messages.cVolker Lendecke2007-10-101-19/+24
|
* r23014: For all branches, ensure that if we're blocked on a POSIXJeremy Allison2007-10-101-4/+21
| | | | | | | | lock we know nothing about that we retry the lock every 10 seconds instead of waiting for the standard select timeout. This is how we used to (and are supposed to) work. Jeremy.
* r22868: Replace some message_send_pid calls with messaging_send_pid calls. MoreVolker Lendecke2007-10-101-3/+3
| | | | tomorrow.
* r22846: Chunk one to replace message_send_pid with messaging_send: Deep insideVolker Lendecke2007-10-101-4/+7
| | | | | | locking/locking.c we have to send retry messages to timed lock holders. The majority of this patch passes a "struct messaging_context" down there. No functional change, survives make test.
* r22736: Start to merge the low-hanging fruit from the now 7000-line cluster ↵Volker Lendecke2007-10-101-3/+3
| | | | | | | | | patch. This changes "struct process_id" to "struct server_id", keeping both is just too much hassle. No functional change (I hope ;-)) Volker
* r22391: Looks bigger than it is. Make "inbuf" availableJeremy Allison2007-10-101-3/+3
| | | | | | | to all callers of smb_setlen (via set_message() calls). This will allow the server to reflect back the correct encryption context. Jeremy.
* r22389: Start preparing for multiple encryption contexts in theJeremy Allison2007-10-101-5/+7
| | | | | | server. Allow server to reflect back to calling client the encryption context that was sent. Jeremy.
* r21879: Move process_blocking_lock_queue to a timed event.Volker Lendecke2007-10-101-45/+71
| | | | | | | | | | | | | | | | The idea is that we have blocking.c:brl_timeout as a timed event that is present whenever we do have a blocking lock pending. It fires brl_timeout_fn() which calls process_blocking_lock_queue(). Whenever we make changes to blocking_lock_queue, we trigger a recalc_brl_timeout() which sets a new brl_timout event if necessary. This makes the call to blocking_locks_timeout_ms() in setup_select_timeout() unnecessary, this is implicitly done in event_add_to_select_args() from the timed events. Volker
* r21064: The core of this patch isVolker Lendecke2007-10-101-6/+12
| | | | | | | | | | | | | | | | | | | | | | void message_register(int msg_type, void (*fn)(int msg_type, struct process_id pid, - void *buf, size_t len)) + void *buf, size_t len, + void *private_data), + void *private_data) { struct dispatch_fns *dfn; So this adds a (so far unused) private pointer that is passed from message_register to the message handler. A prerequisite to implement a tiny samba4-API compatible wrapper around our messaging system. That itself is necessary for the Samba4 notify system. Yes, I know, I could import the whole Samba4 messaging system, but I want to do it step by step and I think getting notify in is more important in this step. Volker
* r21062: Should fix the build plus make all refactoredJeremy Allison2007-10-101-0/+17
| | | | | functions return NTSTATUS. Jeremy.
* r20237: Replace exit_server with exit_server_cleanly where appropriate. AllJames Peach2007-10-101-3/+3
| | | | | send_smb failures should be clean exits. All times when we exit as a matter of policy should also be clean exits.
* r20124: clean up nested extern declaration warningsHerb Lewis2007-10-101-1/+2
|
* r18605: sync dlinklist.h with samba4, that means DLIST_ADD_END()Stefan Metzmacher2007-10-101-2/+2
| | | | | | | and DLIST_DEMOTE() now take the type of the tmp pointer not the tmp pointer itself anymore. metze
* r17541: When returning a trans2 request, if the "max dataJeremy Allison2007-10-101-1/+2
| | | | | | | | | | | | | | | | | bytes returned" is less than the amount we want to send, return what we can and set STATUS_BUFFER_OVERFLOW (doserror ERRDOS,ERRbufferoverflow). Required by OS/2 to handle EA's that are too large. It's hard to test this in Samba4 smbtorture as the max data bytes returned is hard coded at 0xffff (as it is in the Samba3 client libraries also). I used a custom version of Samba4 smbtorture to test this out. Might add a "max data bytes" param to make this testable in the build farm. Confirmed by "Guenter Kukkukk (sambaos2)" <sambaos2@kukkukk.com> and Andreas Taegener <atsamba11@eideltown.de> that this fixes the issue. Jeremy.
* r17314: Optimisation for POSIX locking. If we're downgradingJeremy Allison2007-10-101-1/+1
| | | | | | | a POSIX lock (applying a read-lock) and we overlap pending read locks then send them an unlock message, we may have allowed them to proceed. Jeremy.
* r17293: After the results from the cluster tests in Germany,Jeremy Allison2007-10-101-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | fix the messaging code to call the efficient calls : save_re_uid() set_effective_uid(0); messaging_op restore_re_uid(); instead of using heavyweight become_root()/unbecome_root() pairs around all messaging code. Fixup the messaging code to ensure sec_init() is called (only once) so that non-root processes still work when sending messages. This is a lighter weight solution to become_root()/unbecome_root() (which swaps all the supplemental groups) and should be more efficient. I will migrate all server code over to using this (a similar technique should be used in the passdb backend where needed). Jeremy.
* r17105: Fix the race Volker found - we had a non-lockedJeremy Allison2007-10-101-197/+64
| | | | | | | | | | | | | | | | | | | | | region between detecting a pending lock was needed and when we added the blocking lock record. Make sure that we hold the lock over all this period. Removed the old code for doing blocking locks on SMB requests that never block (the old SMBlock and friends). Discovered something interesting about the strange NT_STATUS_FILE_LOCK_CONFLICT return. If we asked for a lock with zero timeout, and we got an error of NT_STATUS_FILE_LOCK_CONFLICT, treat it as though it was a blocking lock with a timeout of 150 - 300ms. This only happens when timeout is sent as zero and can be seen quite clearly in ethereal. This is the real replacement for old do_lock_spin() code. Re-worked the blocking lock select timeout to correctly use milliseconds instead of the old second level resolution (far too coarse for this work). Jeremy.
* r17098: Samba3 now cleanly passes Samba4 RAW-LOCK tortureJeremy Allison2007-10-101-38/+166
| | | | | | | | test. Phew - that was painful :-). But what it means is that we now implement lock cancels and I can add lock cancels into POSIX lock handling which will fix the fast/slow system call issue with cifsfs ! Jeremy.
* r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison2007-10-101-20/+20
| | | | | | | to do the upper layer directories but this is what everyone is waiting for.... Jeremy.
* r15083: Using talloc with destructors is nice and all, but in thisJeremy Allison2007-10-101-14/+14
| | | | | | | case it's in a performace critical path and it *hurts* us. Go back to plain malloc/free with an explicit destructor call. Jeremy.
* r15018: Merge Volker's ipc/trans2/nttrans changes overJeremy Allison2007-10-101-63/+214
| | | | | | | | into 3.0. Also merge the new POSIX lock code - this is not enabled unless -DDEVELOPER is defined. This doesn't yet map onto underlying system POSIX locks. Updates vfs to allow lock queries. Jeremy.
* r10656: BIG merge from trunk. Features not copied overGerald Carter2007-10-101-11/+13
| | | | | | | * \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck)
* r7963: Add aio support to 3.0.Jeremy Allison2007-10-101-6/+4
| | | | Jeremy.
* r4088: Get medieval on our ass about malloc.... :-). Take control of all our ↵Jeremy Allison2007-10-101-2/+2
| | | | | | | | | allocation functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy.
* r1980: Re-apply (remember to remove entry from list on delete this time :-).Jeremy Allison2007-10-101-49/+25
| | | | Jeremy.
* r1978: Roll it back until I do it right.... :-).Jeremy Allison2007-10-101-24/+49
| | | | Jeremy.
* r1976: Simplify, use standard dlist interface.Jeremy Allison2007-10-101-49/+24
| | | | Jeremy.
* r1154: Change default setting for case sensitivity to "auto". If set to autoJeremy Allison2007-10-101-1/+1
| | | | | | | | | | | | then is the client supports it (current clients supported are Samba and CIFSVFS - detected by the negprot strings "Samba", "POSIX 2" and a bare "NT LM 0.12" string) then the setting of the per packet flag smb_flag FLAG_CASELESS_PATHNAMES is taken into account per packet. This allows the linux CIFS client to use Samba in a case sensitive manner. Additional command in smbclient "case_sensitive", toggles the flag in subsequent packets. Docs to follow. Jeremy.
* Patch from Stefan Metzmacher <metze@metzemix.de> to fix signing problemsJeremy Allison2003-10-211-1/+1
| | | | | when reverse connecting back to a client for printer notify. Jeremy.
* Ensure cancelling a blocking lock returns the correct error message.Jeremy Allison2003-10-101-1/+1
| | | | | Testing with Samba4 RAW-MUX code. Jeremy.
* Changes to allow Samba3 to pass the Samba4 RAW-READ tests.Jeremy Allison2003-10-091-6/+8
| | | | Jeremy.
* Turns out I had my packet sequences wrong for oplock break code.Jeremy Allison2003-08-071-1/+1
| | | | | | | | | | I was storing the mid of the oplock break - I should have been storing the mid from the open. There are thus 2 types of deferred packet sequence returns - ones that increment the sequence number (returns from oplock causing opens) and ones that don't (change notify returns etc). Running with signing forced on does lead to some interesting tests :-). Jeremy.
* Ensure everywhere we defer an incoming SMB request (blocking lock queue,Jeremy Allison2003-07-241-248/+250
| | | | | | | in oplock break state, change notify queue) we also push the MID onto the deferred signing queue. Tomorrow I will test this with valgrind and oplock tests. Jeremy.