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

499 Commits

Author SHA1 Message Date
Volker Lendecke
fa0de39551 s3: Lift smbd_server_conn from receive_smb_raw_talloc_partial_read 2010-10-14 13:53:07 +02:00
Volker Lendecke
cac60a7041 s3: Remove some explicit smbd_server_conn refs in process_smb() 2010-10-14 13:53:06 +02:00
Volker Lendecke
81bdb5910c s3: Rename "conn" to the more used "sconn" in process_smb() 2010-10-14 13:53:06 +02:00
Volker Lendecke
fd9effce2b s3: Fix the async echo responder for netbios keepalives
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-07 19:47:35 +00:00
Volker Lendecke
342c79e265 s3: Make the write end of the echo responder pipe non-blocking
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-06 13:57:30 +00:00
Steven Danneman
455fccf86b s3:events: Call all ready fd event handlers on each iteration of the main loop
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-01 13:31:33 -07:00
Günther Deschner
b38d0542e1 samba: share select wrappers.
Guenther
2010-10-01 22:30:22 +02:00
Volker Lendecke
a3e211ca3f s3: Attempt to fix bug 7518
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-28 19:22:50 +02:00
Volker Lendecke
51bc104c5c s3: Increase the debuglevel for connection termination msgs 2010-09-28 10:40:17 +02:00
Volker Lendecke
790ad3d1a4 s3: Remove two calls to procid_self() 2010-09-28 07:36:18 +02:00
Volker Lendecke
f83e7d8f8c s3: Remove "server_fd" global variable 2010-09-28 07:36:15 +02:00
Jeremy Allison
03841f9e44 Fix bug #7698 - Assert causes smbd to panic on invalid NetBIOS session request.
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-26 03:01:03 -07:00
Günther Deschner
8e16d6dbdf s3-build: only include ctdbd_conn.h where needed.
Guenther
2010-09-20 13:54:50 -07:00
Günther Deschner
c7fe04abc7 s3-build: only include async headers where needed.
Guenther
2010-09-20 13:54:42 -07:00
Volker Lendecke
df19469295 s3: On Solaris, iov_len is an int
We can't use &iov.iov_len passing it to a size_t *
2010-09-05 16:41:28 +02:00
Volker Lendecke
5648c3f67e s3: messaging_ctdbd_connection() was only called with procid_self()
Eventually we'll get this right...
2010-08-31 17:07:41 +02:00
Volker Lendecke
fbf3d03550 s3: Fix an uninitialized variable 2010-08-29 23:14:49 +02:00
Volker Lendecke
f687d43454 s3: Fix the build without cluster 2010-08-29 23:14:49 +02:00
Volker Lendecke
e784e160ec s3: Remove two uses of smbd_server_fd()
Actually, this is a bit cheating. But those two files depend on
smbd_server_conn anyway, it does not make things worse.
2010-08-29 21:55:25 +02:00
Volker Lendecke
744cc26451 s3: Remove smbd_server_fd() from smbd_register_ips 2010-08-29 21:55:24 +02:00
Volker Lendecke
5bbc4df168 s3: Lift smbd_server_fd() from msg_release_ip() 2010-08-29 21:55:24 +02:00
Volker Lendecke
467208e9f4 s3: Lift smbd_server_fd() from release_ip() 2010-08-29 21:55:24 +02:00
Volker Lendecke
70df6fcb2a s3: Pass sconn to check_reload
This removes a use of smbd_server_fd()
2010-08-29 21:55:24 +02:00
Volker Lendecke
babfe23717 s3: Pass sconn instead of msg_ctx to housekeeping_fn 2010-08-29 21:55:24 +02:00
Stefan Metzmacher
db6d1c6276 s3:smbd: s/sa_len/sa_socklen , because sa_len is a macro on IRIX
metze
2010-08-28 08:28:01 +02:00
Volker Lendecke
2d81721a3f s3: Move "trans_num" to smbd_server_connection 2010-08-24 21:06:41 +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
70c5bed4b2 s3: Replace calls to check_access by allow_access
We already have both the name and address of the client stored now
2010-08-22 14:28:34 +02:00
Volker Lendecke
ac7b63384d s3: Lift smbd_server_fd from reload_services() 2010-08-18 11:18:21 +02:00
Volker Lendecke
a58cea0026 s3: Lift smbd_server_fd() from receive_smb_raw_talloc 2010-08-17 22:44:03 +02:00
Volker Lendecke
1f0afe1aed s3: Lift smbd_server_fd() from read_smb_length_return_keepalive 2010-08-17 22:44:03 +02:00
Volker Lendecke
9671547d17 s3: Lift smbd_server_fd() from read_fd_with_timeout() 2010-08-17 22:44:03 +02:00
Volker Lendecke
40ae8b74b6 s3: Remove smbd_server_fd() from write_data()
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-17 12:46:53 +02:00
Volker Lendecke
68e86969fa s3: Remove smbd_server_fd() from smbd_process 2010-08-16 22:39:25 +02:00
Volker Lendecke
0bd39c73be s3: Remove smbd_server_fd() from smbd_echo_loop 2010-08-16 22:39:25 +02:00
Volker Lendecke
2cd643865d s3: Remove smbd_server_fd() from smbd_echo_reader 2010-08-16 22:39:25 +02:00
Volker Lendecke
a23483310d s3: Remove smbd_server_fd() from smbd_echo_reply 2010-08-16 22:39:25 +02:00
Volker Lendecke
bb867df269 s3: Remove smbd_server_fd() from keepalive_fn 2010-08-16 22:39:25 +02:00
Volker Lendecke
a2bf46e9ec s3: Remove smbd_server_fd() from smbd_server_connection_handler 2010-08-16 22:39:25 +02:00
Volker Lendecke
8e7a92bc24 s3: Remove smbd_server_fd() from smbd_server_connection_read_handler 2010-08-16 22:39:25 +02:00
Volker Lendecke
6737c3dd32 s3: Remove smbd_server_fd() from chain_reply 2010-08-16 22:39:25 +02:00
Volker Lendecke
b9d052c728 s3: Remove smbd_server_fd() from construct_reply 2010-08-16 22:39:24 +02:00
Volker Lendecke
61989a9e54 s3: Remove smbd_server_fd() from switch_message 2010-08-16 22:39:24 +02:00
Volker Lendecke
ee796255ce s3: Remove smbd_server_fd() from smbd_server_connection_loop_once 2010-08-16 22:39:24 +02:00
Volker Lendecke
95b232a008 s3: Remove smbd_server_fd() from receive_smb_raw_talloc_partial_read 2010-08-16 22:39:24 +02:00
Volker Lendecke
96ae457023 s3: Remove get_client_fd() 2010-08-16 13:13:10 +02:00
Volker Lendecke
ad871b73a2 s3: Fix some error messages 2010-08-13 22:53:06 +02:00
Andreas Schneider
aff002e829 s3-smbd: Move rpc services init to smbd parent.
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-13 12:20:10 -04:00
Volker Lendecke
f7e14a8e5e s3: Reduce the load on the echo handler
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-12 13:32:16 +02:00
Volker Lendecke
c672797a0a s3: Slightly simplify the logic in smbd_server_echo_handler 2010-08-12 13:31:51 +02:00