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

418 Commits

Author SHA1 Message Date
Simo Sorce
b32b59d47f s3:smbd make yp cache local.
The my_yp_domain variable is just a static cache needed to avoid
making over and over expensive and potentially blocking calls to
yp_get_default_domain().
Instead of keeping this onto the smbd_server_connection struct, just
keep it local to the only function ever using this variable.

This disentagle this function (and a number of calling functions)
from having to pass around smbd_server_connection and thus having
to link against smbd. It also removes a few ifdefs.

Nothing changes from a global/local pov, as the smbd_server_connection
variable passed around is also a global one.

Signed-off-by: Andreas Schneider <asn@samba.org>
2010-05-31 18:21:29 +02:00
Simo Sorce
d9cffc01be s3:auth use info3 in auth_serversupplied_info
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-28 00:55:53 +02:00
Volker Lendecke
abbf8efb24 s3: Fix a bad memleak in the async echo responder 2010-05-27 18:15:19 +02:00
Günther Deschner
c6ebab846d s3: only include gen_ndr headers where needed.
This shrinks include/includes.h.gch by the size of 7 MB and reduces build time
as follows:

ccache build w/o patch
real    4m21.529s
ccache build with patch
real    3m6.402s

pch build w/o patch
real    4m26.318s
pch build with patch
real    3m6.932s

Guenther
2010-05-06 00:22:59 +02:00
Jeremy Allison
c9a3661c4b Fix the "allow_smb2" bug being set to false that was driving me mad :-).
The first packet from a rebooted Win7 on an SMB2 connection is an SMB1
negprot...

Jeremy.
2010-04-27 22:15:17 -07:00
Stefan Metzmacher
b764145ac8 s3:smbd: keep local and remote tsocket_address per connection
metze
2010-04-27 17:22:31 +02:00
Jeremy Allison
2bbb8c917e Allow smb2 create requests to be cancelled.
Jeremy.
2010-04-23 13:10:15 -07:00
Jeremy Allison
8f67f873ac Make deferred opens (NT_STATUS_SHARING_VIOLATION) work over SMB2.
Makes SMB2Create call re-entrant internally.
Now this infrastructure is in place, oplocks will follow shortly.
Tested with Win7 client and with W2K8R2.

Jeremy.
2010-04-22 23:52:19 -07:00
Jeremy Allison
7984243768 Move to using 64-bit mid values in our internal open file database.
This will allow us to share logic much easier between SMB1 and SMB2
servers.

Jeremy
2010-04-12 21:40:28 -07:00
Jeremy Allison
e15939b456 Plumb SMB2 stubs into all the places we defer SMB1 operations.
Rename functions to be internally consistent. Next step is
to cope queueing single (non-compounded) SMB2 requests to
put some code inside the stubs.

Jeremy.
2010-04-09 19:26:34 -07:00
Jeremy Allison
08b24e923d Stop smb2 from calling into smb1 blocking lock request code.
Allocate a uint16_t internal SMB1 mid for an SMB2 request.
Add a back pointer from the faked up smb_request struct
to the smb2 request.

Getting ready to add restart code for blocking locks,
share mode violations and oplocks in SMB2.

Jeremy.
2010-04-08 22:15:55 -07:00
Jeremy Allison
3413cf7a6b Start to plumb smb2 into the oplock system. Calls dummy functions for now.
Jeremy.
2010-04-07 19:00:44 -07:00
Jeremy Allison
bf90969892 Move initialize_async_io_handler() inside of smbd/aio.c.
Call from actual aio read or write. No reason to call this globally on startup.

Jeremy.
2010-04-01 16:47:59 -07:00
Jeremy Allison
6800fdbb81 Make smbd_lock_socket/smbd_unlock_socket recursive with a ref_count.
As these always call exit_server, make that part of the function.
Use _internal functions for the echo client.

Metze please check !

Jeremy.
2010-03-31 17:40:30 -07:00
Stefan Metzmacher
6f30b9a6ff s3:smbd: handle SMB2 in deadtime_fn() and avoid disconnecting non idle clients
metze
2010-03-31 04:55:47 +02:00
Volker Lendecke
cad0c004ad s3: Implement an asynchronous echo responder process
This replies to echo requests when the main smbd is stuck somewhere

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-03-22 17:15:14 +01:00
Stefan Metzmacher
0c77e3a1ba s3:smbd: don't allow SMB2 if the async echo handler is active
metze
2010-03-22 17:15:14 +01:00
Stefan Metzmacher
453e6af5b8 s3:smbd: don't use recvfile if the echo handler is active
metze
2010-03-22 17:15:13 +01:00
Stefan Metzmacher
b2c107ffbc s3:smbd: pass down trusted_channel via receive_smb_talloc()
metze
2010-03-22 17:15:12 +01:00
Stefan Metzmacher
c1653e3b0e s3:smbd: send keepalive packets under the socket lock
metze
2010-03-22 17:15:11 +01:00
Stefan Metzmacher
977aa660f4 s3:smbd: smbd_[un]lock_socket() while accessing the socket to the client
metze
2010-03-22 17:15:11 +01:00
Stefan Metzmacher
8de8554628 s3:smbd: add smbd_[un]lock_socket() dummies
metze
2010-03-22 17:15:11 +01:00
Stefan Metzmacher
0b7da43da0 s3:smbd: add an option to skip signings checks srv_check_sign_mac for trusted channels
metze
2010-03-22 17:15:10 +01:00
Volker Lendecke
b7898148c1 s3: Make init_smb_request return bool
Centralize the exit_server_cleanly()
2010-03-11 15:18:07 +01:00
Volker Lendecke
25452a2268 s3: Fix a NULL pointer dereference
Found by Laurent Gaffie <laurent.gaffie@gmail.com>.

Thanks!

Volker
2010-03-09 22:00:44 +01:00
Volker Lendecke
8905b599b4 s3: Fix some nonempty blank lines 2010-01-23 14:35:37 +01:00
Volker Lendecke
9b4b9d26f1 s3: Initialize the seqnum in "init_smb_request"
This makes it a bit more obvious for me that the signing sequence number is
tied to the SMB request.
2010-01-21 14:08:27 +01:00
Volker Lendecke
33e397f9fd s3: Make "init_smb_request" static to process.c 2010-01-21 14:08:27 +01:00
Volker Lendecke
b6f446ca35 s3: Move smb_splice_chain to smbd/process.c, its only user 2009-12-22 13:54:43 +01:00
Jeremy Allison
74deee3cc9 Rename reply_doserror() -> reply_force_doserror().
Rewrite all calls to reply_nterror(NT_STATUS_DOS()) to
reply_force_doserror() and update the comment in smbd/error.c

Jeremy.
2009-12-21 11:16:38 -08:00
Jeremy Allison
642101ac23 Remove all calls to reply_doserror - turn them into
correct reply_nterror calls. Next rename reply_doserror ->
reply_force_doserror and plumb in when NT_STATUS_DOS is
used.
Jeremy.
2009-12-21 11:05:25 -08:00
Günther Deschner
89e02ef1f3 s3-smbd: no drsuapi server stubs yet in s3. Fixes the build, sorry.
Guenther
2009-11-26 20:26:01 +01:00
Günther Deschner
3d679a3b5f s3-rpc: Avoid including every pipe's client and server stubs everywhere in samba.
Guenther
2009-11-26 20:03:17 +01:00
Volker Lendecke
0f8e2a6ebb Revert "s3: Move the global variable Protocol to struct smbd_server_connection"
This reverts commit c85a4c9ba4.
2009-11-23 16:34:59 +01:00
Volker Lendecke
c85a4c9ba4 s3: Move the global variable Protocol to struct smbd_server_connection 2009-11-21 20:49:17 +01:00
Jeremy Allison
8a6b90d401 Fix for CVE-2009-2906.
Summary:
Specially crafted SMB requests on
authenticated SMB connections can send smbd
into a 100% CPU loop, causing a DoS on the
Samba server.
2009-10-01 14:32:36 +02:00
Zack Kirsch
5e9aade516 s3 onefs: Add some debugging/asserts to give more info when there is bad deferred open state.
Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-09-24 11:19:00 -07:00
Jeremy Allison
43c766a14a Fix bug 6673 - smbpasswd does not work with "unix password sync = yes".
Revert change from 3.3 -> 3.4 with read_socket_with_timeout changed
from sys_read() to sys_recv(). read_socket_with_timeout() is called
with non-fd's (with a pty in chgpasswd.c and with a disk file in
lib/dbwrap_file.c via read_data()). recv works for the disk file,
but not the pty. Change the name of read_socket_with_timeout() to
read_fd_with_timeout() to make this clear (and add comments).
Jeremy.
2009-09-06 21:38:50 -07:00
Stefan Metzmacher
59c3f5e3ca s3:smbd: move dptr globals into struct smbd_server_connection
metze
2009-08-07 14:18:17 +02:00
Volker Lendecke
5135ebd6f0 Fix a valgrind error in chain_reply
construct_reply() references the request after chain_reply has freed it.
2009-07-27 16:15:54 +02:00
Volker Lendecke
c116652a30 In chain_reply, copy the subrequests' error to the main request 2009-07-24 17:17:08 +02:00
Jeremy Allison
55b4231c77 Move the initialization of smbd_server_conn from smbd/process,
after the accept and fork, to smbd_init_globals(), so it's
done immediately on server startup. This is needed as some
messages are sent to all active smbd processes (including
the master listening daemon). If it gets a message that
forces it to scan it's current connections (ie. conn_find())
then it discovers that sconn->smb1.tcons.Connections dereferences
null (as sconn == NULL in the parent) and crashes. Yes,
I could fix all cases where sconn is used and explicitly
check for NULL but this fix is easier. It means that
the smbd_event_context() is initialized in the master
daemon and then re-initialized after fork, but that
should be being done correctly in every fork call anyway.
Without this change the previous fix 6a9e003910
still panics in the reproducible test case for bug
6564, as this is one case where such a message
(MSG_SMB_CONF_UPDATED) is sent to the parent. Metze
please check. This change passes valgrind.
Jeremy.
2009-07-17 17:57:48 -07:00
Jeremy Allison
d57e67f9eb Revert this commit :
s3: Make smbd aware of permission change of usershare. Since usershare are relatively volatile and
non-previledge users must disconnect from smbd and reconnect to it to make share permission in effect.

For now. This is a feature request and I think we need
to design it a little differently so as not to touch
core change_to_user() code.

Jeremy.
2009-07-14 11:25:45 -07:00
Bo Yang
9ef6af73b3 s3: Make smbd aware of permission change of usershare. Since usershare are relatively volatile and non-previledge users must disconnect from smbd and reconnect to it to make share permission in effect. 2009-07-15 17:05:45 +08:00
Aravind Srinivasan
5a4d618109 s3: forward MSG_DEBUG from smbd parent to all children
Before 3.3, an smbcontrol debug message sent to the target "smbd" would
actually be sent to all running processes including nmbd and winbindd.
This behavior was changed in 3.3 so that the "smbd" target would only
send a message to the process found in smbd.pid, while the "all" target
would send a message to all processes.

The ability to set the debug level of all processes within a single
daemon, without specifying each pid is quite useful.  This was implemented
in winbindd in 065760ed.  This patch does the same thing for smbd.

Upon receiving a MSG_DEBUG the parent smbd will rebroadcast it to all of
its children.

The printing process has been added to the list of smbd child processes,
and we now always track the number of smbd children regardless of the
"max smbd processes" setting.
2009-06-22 19:09:37 -07:00
Stefan Metzmacher
c862018008 s3:smbd: move tcon specific globals to struct smbd_server_connection
metze
2009-06-03 17:54:38 +02:00
Stefan Metzmacher
75d03970b7 s3:smbd: move more session specific globals to struct smbd_server_connection
metze
2009-06-03 17:54:37 +02:00
Stefan Metzmacher
356f0336e5 s3:smbd: move some session specific globals to struct smbd_server_connection
metze
2009-06-03 17:54:37 +02:00
Stefan Metzmacher
f554af1871 s3:smbd: move already_got_session to struct smbd_server_connection
metze
2009-06-03 17:54:37 +02:00
Stefan Metzmacher
d9843b3db4 s3:smbd: move max_recv to struct smbd_server_connection
metze
2009-06-03 17:54:37 +02:00