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

355 Commits

Author SHA1 Message Date
Volker Lendecke
d94e9c802c Remove the global variable "chain_size" 2009-01-31 11:09:39 +01:00
Stefan Metzmacher
52f6a4436f s3:smbd: make kernel oplocks event driven
And use signal events for Linux oplocks.

metze
2009-01-27 15:28:10 +01:00
Stefan Metzmacher
4a22713495 s3:smbd: remove pointless respond_to_all_remaining_local_messages() function
This the process_kernel_oplock() function never response to messages,
it only generates messages to ourself.

metze
2009-01-27 15:28:10 +01:00
Stefan Metzmacher
ac61f650ae s3:smbd: use signal events for SIGTERM, SIGHUP and SIGCHLD
metze
2009-01-27 15:28:07 +01:00
Stefan Metzmacher
27f812f3a8 s3:smbd: move all code that handles a client connection into smbd_process()
metze
2009-01-27 15:28:07 +01:00
Volker Lendecke
c0fea1f0f7 Fix chain_reply for pipe reads
The caller might have over-allocated reply->outbuf. Deal with that.

Sorry, Günther, for giving you so much pain ...

Volker
2009-01-25 12:18:34 +01:00
Stefan Metzmacher
830b31a41a s3:smbd: we don't need to call message_dispatch() anymore it's event triggered now
metze
2009-01-22 12:37:31 +01:00
Stefan Metzmacher
196028ab7b s3:smbd: restructure kernel oplocks code
This converts the irix oplocks code to use a fd event
and removes the last special case for file descriptors
for the main sys_select().

metze
2009-01-22 12:37:29 +01:00
Stefan Metzmacher
048f8dba14 s3: always call run_events() before and after sys_select()
And always setup the fd events.

metze
2009-01-22 12:37:29 +01:00
Volker Lendecke
55dfad40af "userdom_struct" does not need "full_name" anymore -- unused 2009-01-20 23:10:16 +01:00
Stefan Metzmacher
fcf9f72e04 s3:smbd: call message_dispatch() before processing incoming PDUs
This is a hack to fix races which happen with the RAW-RENAME and RAW-OPLOCK
tests. We should try to remove it later.

metze
2009-01-20 00:40:56 +01:00
Volker Lendecke
0d7ca8e89e remove the old chain_reply code 2009-01-16 13:00:45 +01:00
Volker Lendecke
ddaa65ef6e Correctly calculate the offset for read&x 2009-01-16 13:00:44 +01:00
Volker Lendecke
ba981128ac Add a new implementation of chain_reply
This the global variable "orig_inbuf" in the old chain_reply code. This global
variable was one of the reasons why we had the silly restriction to not allow
async requests within a request chain.
2009-01-16 13:00:28 +01:00
Volker Lendecke
d9c40172bf Fix a type-punned error 2009-01-10 13:05:35 +01:00
Volker Lendecke
50aa8a4ac8 Fix a C++ warning 2009-01-10 13:05:34 +01:00
Stefan Metzmacher
aeb798c325 s3:smbd: handle incoming smb requests via event handlers
We use a fd event and receive incoming smb requests
when the fd becomes readable. It's not completely
nonblocking yet, but it should behave like the old code.

We use timed events to trigger retries for deferred open calls.

metze
2009-01-09 08:45:40 +01:00
Stefan Metzmacher
3dde0cbb76 s3:smbd: move all globals and static variables in globals.[ch]
The goal is to move all this variables into a big context structure.

metze
2009-01-08 12:22:21 +01:00
Stefan Metzmacher
c34d5f445a s3:events: change event_add_timed() prototype to match samba4
metze
2009-01-05 15:07:35 +01:00
Jeremy Allison
2c0faaf5d9 Fix bug #6009 - Setting "min receivefile size = 1" breaks writes.
Jeremy.
2009-01-04 11:47:16 -08:00
Volker Lendecke
1ce9525be2 Replace "goto again" by "return NT_STATUS_RETRY" in receive_message_or_smb
This gives lower-level routines the chance to indicate a retry condition
2008-12-31 19:33:25 +01:00
Volker Lendecke
ae0c6cff25 Remove the direct inbuf reference from construct_reply_common() 2008-12-19 18:08:47 +01:00
Volker Lendecke
5a33e906f6 Make "construct_reply_common" static 2008-11-08 10:42:29 +01:00
Volker Lendecke
b9211deba8 Fix the build 2008-11-05 10:48:43 +01:00
Volker Lendecke
b8125663d9 Make "inbuf" a talloc child of "smb_request" for normal smb requests
This is necessary if we want to keep the whole smb_request for deferred ops.
The explicit settings of req->inbuf will be removed once all those deferring
operations are converted to store the whole request and not just the inbuf.
2008-11-04 20:52:06 +01:00
Volker Lendecke
e4897a5376 Add construct_reply_common_req wrapper
The goal is to remove the remaining direct calls to construct_reply_common.
2008-11-04 20:52:06 +01:00
Volker Lendecke
0953688012 Trigger (and fix) a bug in Samba3 making smbd an infinite data source
A deferred open directly followed by a ulogoffX makes smbd3 send an infinite
stream of ERRinvuid replies :-(
2008-11-04 09:41:15 +01:00
Volker Lendecke
7808a2594c Remove some inbuf references by adding "cmd" to smb_request 2008-11-02 23:17:01 +01:00
Volker Lendecke
2bab73a18d Remove a bunch of direct inbuf references by adding "vwv" to smb_request 2008-11-02 16:58:19 +01:00
Volker Lendecke
7bdb571ec4 Remove a bunch of direct inbuf references by adding "buf" to smb_request 2008-11-01 19:41:08 +01:00
Volker Lendecke
7f9d6f80ef Add a "buflen" struct member to smb_request
This removes some explicit inbuf references and also removes a pointless check
in reply_echo. The buflen can never be more than 64k, this is just a 16 bit
value.
2008-11-01 19:41:07 +01:00
Volker Lendecke
7a0ed93169 Remove unused extern declaration 2008-11-01 19:41:07 +01:00
Volker Lendecke
48d3a1d2fb "fn_new"->"fn" in smb_messages[], we got beyond that :-) 2008-10-19 21:51:17 +02:00
Volker Lendecke
1510b7b8c9 Use a direct compare instead of calling strncmp in valid_smb_header 2008-10-19 21:51:16 +02:00
Volker Lendecke
ac647d03ac Move the global hosts_allow() check out of the processing loop 2008-10-19 21:51:16 +02:00
Jelmer Vernooij
4746f79d50 Use {u,}int64_t instead of SMB_BIG_{U,}INT. 2008-10-14 01:59:36 +02:00
Volker Lendecke
a781b78417 Remove smb_np_struct 2008-10-13 20:59:33 +02:00
Volker Lendecke
d65afbe55f Remove the chain_fsp global 2008-10-13 19:32:39 +02:00
Jeremy Allison
f6c883b4b0 Simply our main loop processing. A lot :-). Correctly use events for all the previous "special" cases.
A step on the way to adding signals to the events and being able to merge the S3 event system with
the S4 one.
Jeremy.
2008-10-03 14:18:35 -07:00
Volker Lendecke
227718cd1a Fix Coverity ID 587
The following test program prints "8" on 64-bit :-)

static void print_size(const char lenbuf[4])
{
        printf("sizeof(lenbuf) = %d\n", (int)sizeof(lenbuf));
}
int main(void)
{
        const char lenbuf[4];
        print_size(lenbuf);
        return 0;
}

Jeremy, please check :-)

Volker
(This used to be commit 9daea0ccfd)
2008-09-01 13:51:11 +02:00
Volker Lendecke
1a7b6fe34d fix smb_len calculation for chained requests
I think chain_reply() is one of the most tricky parts of Samba. This recursion
needs to go away, we need to sequentially walk the chain list.
(This used to be commit af2b01d851)
2008-08-10 18:24:33 +02:00
Volker Lendecke
12b6c1f57d Fix andx offset calculation for more than 2 chained requests
Untested code is broken code.... Test follows later, it's quite an intrusive
change to libsmb/
(This used to be commit 0ff16e8573)
2008-08-10 18:24:32 +02:00
Volker Lendecke
5cd8a42720 Factor out create_outbuf, creating an outbuf just given an inbuf
(This used to be commit 50427cbf63)
2008-06-28 10:38:51 +02:00
Jeremy Allison
d36434f312 Security fix for CVE-2008-1105: Boundary failure when parsing SMB responses
can result in a buffer overrun.
Jeremy.
(This used to be commit 23b825e9d2)
2008-05-28 09:31:42 -07:00
Jeremy Allison
8ca459e067 Fix bug #5477 - recvfile code was broken.
Jeremy.
(This used to be commit 830337f054)
2008-05-20 12:09:48 -07:00
Volker Lendecke
bec1dfab27 Remove "userdom_struct user" from "struct user_struct"
(This used to be commit 420de03523)
2008-05-05 18:28:59 +02:00
Volker Lendecke
a4c0812af0 Fix some "ignoring asprintf result" warnings
(This used to be commit 155d62ddfd)
2008-04-14 13:13:46 +02:00
Jeremy Allison
8b04a33500 Ok, final move of this code :-). I think I've found the correct
place for it now where it will cause minimal disruption (only
call the extra message_dispatch just before reading the next
smb off the wire).
Jeremy.
(This used to be commit da2c19c481)
2008-03-31 17:01:27 -07:00
Jeremy Allison
6913f10134 Move the message_dispatch() call after the check for errno on
the select return. We don't want the call to message_dispatch
to mess up the errno value.
Jeremy.
(This used to be commit 26a74d01bb)
2008-03-31 16:56:21 -07:00
Jeremy Allison
e11cd466e1 Reduce the race condition in Samba4 in RAW-RENAME test. We rename a file
using trans2 setfileinfo on one connection, and then check the
file name has changed on the other. In Samba we achieve this by
sending a local message to the other process. This change causes
us to re-scan for incoming messages after we've woken up from the
select (which is cheap if there are no pending messages). This reduces
the race significantly. Volker please review.
Jeremy.
(This used to be commit a7499e994a)
2008-03-31 16:46:20 -07:00