summaryrefslogtreecommitdiff
path: root/source3/smbd/process.c
AgeCommit message (Collapse)AuthorFilesLines
2010-10-07s3: Fix the async echo responder for netbios keepalivesVolker Lendecke1-10/+23
This fixes a crash in the echo responder when the client started to send the NetBIOS-Level 0x85-style keepalive packets. We did not correctly check the packet length, so the code writing the signing seqnum overwrote memory after the malloc'ed area for the 4 byte keepalive packet. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Oct 7 19:47:35 UTC 2010 on sn-devel-104
2010-10-06s3: Make the write end of the echo responder pipe non-blockingVolker Lendecke1-0/+1
Without this, we can get a writable pipe end, but the writev call on the pipe will block. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Wed Oct 6 13:57:30 UTC 2010 on sn-devel-104
2010-10-01s3:events: Call all ready fd event handlers on each iteration of the main loopSteven Danneman1-19/+16
Previously, only one fd handler was being called per main message loop in all smbd child processes. In the case where multiple fds are available for reading the fd corresponding to the event closest to the beginning of the event list would be run. Obviously this is arbitrary and could cause unfairness. Usually, the first event fd is the network socket, meaning heavy load of client requests can starve out other fd events such as oplock or notify upcalls from the kernel. In this patch, I have changed the behavior of run_events() to unset any fd that it has already called a handler function, as well as decrement the number of fds that were returned from select(). This allows the caller of run_events() to iterate it, until all available fds have been handled. I then changed the main loop in smbd child processes to iterate run_events(). This way, all available fds are handled on each wake of select, while still checking for timed or signalled events between each handler function call. I also added an explicit check for EINTR from select(), which previously was masked by the fact that run_events() would handle any signal event before the return code was checked. This required a signature change to run_events() but all other callers should have no change in their behavior. I also fixed a bug in run_events() where it could be called with a selrtn value of -1, doing unecessary looping through the fd_event list when no fds were available. Also, remove the temporary echo handler hack, as all fds should be treated fairly now.
2010-10-01samba: share select wrappers.Günther Deschner1-0/+1
Guenther
2010-09-28s3: Attempt to fix bug 7518Volker Lendecke1-6/+6
If select returns -1, we can't rely on the fd sets. The current code might loop endlessly because when putting an invalid fd (the closed socket?) on the read set, a select implementation might choose not to touch it but directly return with EINVAL. Thus run_events will see the socket readable, which leads to a "return true", and thus a NT_STATUS_RETRY -> same game again. We should never get into this situation, but to me the logfiles given in bug 7518 do not reveal enough information to understand how this can happen.
2010-09-28s3: Increase the debuglevel for connection termination msgsVolker Lendecke1-2/+2
2010-09-28s3: Remove two calls to procid_self()Volker Lendecke1-2/+4
2010-09-28s3: Remove "server_fd" global variableVolker Lendecke1-7/+4
2010-09-26Fix bug #7698 - Assert causes smbd to panic on invalid NetBIOS session request.Jeremy Allison1-1/+1
Found by the CodeNomicon test suites at the SNIA plugfest. http://www.codenomicon.com/ If an invalid NetBIOS session request is received the code in name_len() in libsmb/nmblib.c can hit an assert. Re-write name_len() and name_extract() to use "buf/len" pairs and always limit reads. Jeremy.
2010-09-20s3-build: only include ctdbd_conn.h where needed.Günther Deschner1-0/+1
Guenther
2010-09-20s3-build: only include async headers where needed.Günther Deschner1-0/+1
Guenther
2010-09-05s3: On Solaris, iov_len is an intVolker Lendecke1-1/+3
We can't use &iov.iov_len passing it to a size_t *
2010-08-31s3: messaging_ctdbd_connection() was only called with procid_self()Volker Lendecke1-1/+1
Eventually we'll get this right...
2010-08-29s3: Fix an uninitialized variableVolker Lendecke1-1/+1
2010-08-29s3: Fix the build without clusterVolker Lendecke1-0/+4
2010-08-29s3: Remove two uses of smbd_server_fd()Volker Lendecke1-1/+1
Actually, this is a bit cheating. But those two files depend on smbd_server_conn anyway, it does not make things worse.
2010-08-29s3: Remove smbd_server_fd() from smbd_register_ipsVolker Lendecke1-3/+4
2010-08-29s3: Lift smbd_server_fd() from msg_release_ip()Volker Lendecke1-4/+4
2010-08-29s3: Lift smbd_server_fd() from release_ip()Volker Lendecke1-11/+27
2010-08-29s3: Pass sconn to check_reloadVolker Lendecke1-4/+4
This removes a use of smbd_server_fd()
2010-08-29s3: Pass sconn instead of msg_ctx to housekeeping_fnVolker Lendecke1-6/+5
2010-08-28s3:smbd: s/sa_len/sa_socklen , because sa_len is a macro on IRIXStefan Metzmacher1-7/+7
metze
2010-08-24s3: Move "trans_num" to smbd_server_connectionVolker Lendecke1-4/+3
2010-08-24s3: Make srv_send_smb take an sconn instead of a sock fdVolker Lendecke1-11/+11
2010-08-22s3: Replace calls to check_access by allow_accessVolker Lendecke1-4/+6
We already have both the name and address of the client stored now
2010-08-18s3: Lift smbd_server_fd from reload_services()Volker Lendecke1-3/+3
2010-08-17s3: Lift smbd_server_fd() from receive_smb_raw_tallocVolker Lendecke1-5/+5
2010-08-17s3: Lift smbd_server_fd() from read_smb_length_return_keepaliveVolker Lendecke1-1/+5
2010-08-17s3: Lift smbd_server_fd() from read_fd_with_timeout()Volker Lendecke1-1/+16
2010-08-17s3: Remove smbd_server_fd() from write_data()Volker Lendecke1-3/+20
This completely removes the DEBUG(0, ..) error message from write_data(). I've gone through all callers of write_data() and made sure that they have their own equivalent error message printing.
2010-08-16s3: Remove smbd_server_fd() from smbd_processVolker Lendecke1-8/+8
2010-08-16s3: Remove smbd_server_fd() from smbd_echo_loopVolker Lendecke1-1/+1
2010-08-16s3: Remove smbd_server_fd() from smbd_echo_readerVolker Lendecke1-2/+2
2010-08-16s3: Remove smbd_server_fd() from smbd_echo_replyVolker Lendecke1-5/+3
2010-08-16s3: Remove smbd_server_fd() from keepalive_fnVolker Lendecke1-1/+1
2010-08-16s3: Remove smbd_server_fd() from smbd_server_connection_handlerVolker Lendecke1-1/+1
2010-08-16s3: Remove smbd_server_fd() from smbd_server_connection_read_handlerVolker Lendecke1-2/+2
2010-08-16s3: Remove smbd_server_fd() from chain_replyVolker Lendecke1-2/+2
2010-08-16s3: Remove smbd_server_fd() from construct_replyVolker Lendecke1-2/+2
2010-08-16s3: Remove smbd_server_fd() from switch_messageVolker Lendecke1-1/+1
2010-08-16s3: Remove smbd_server_fd() from smbd_server_connection_loop_onceVolker Lendecke1-2/+2
2010-08-16s3: Remove smbd_server_fd() from receive_smb_raw_talloc_partial_readVolker Lendecke1-1/+1
2010-08-16s3: Remove get_client_fd()Volker Lendecke1-1/+1
2010-08-13s3: Fix some error messagesVolker Lendecke1-1/+1
2010-08-13s3-smbd: Move rpc services init to smbd parent.Andreas Schneider1-42/+1
The move to the parent makes it possible to use an internal rpc pipe really early and as we migrated serveral parts of samba to rpc function this is required. This should speed up the fork of a smbd a bit cause the rpc services are already running. We still have several problems here which aren't solved. We don't have a dependency tree here. For example we have to make sure that the registry is initialized before we can use the winreg pipe. The spoolss server requires winreg, so we have to start winreg before we can start the spoolss server. I'm sure there are more dependencies. Signed-off-by: Simo Sorce <idra@samba.org>
2010-08-12s3: Reduce the load on the echo handlerVolker Lendecke1-0/+2
If the parent is fast enough, the echo handler should not step in. When the socket becomes readable, the echo handler goes to sleep for a second. If within that second, the parent has picked up the SMB request from the net, the echo handler will just go back to select().
2010-08-12s3: Slightly simplify the logic in smbd_server_echo_handlerVolker Lendecke1-1/+4
2010-08-12s3: Slightly simplify the logic in smbd_server_connection_handlerVolker Lendecke1-1/+4
2010-08-12s3: ?true:false is a *bit* pointless :-)Volker Lendecke1-1/+1
2010-08-08s3: Remove the smbd_messaging_context from spoolss_init_cbVolker Lendecke1-2/+4