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

393 Commits

Author SHA1 Message Date
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
Stefan Metzmacher
8be8d911a8 s3:smbd: allow SMB2 only if we don't use security = share
metze
2009-06-03 10:51:25 +02:00
Stefan Metzmacher
ebc860ebeb s3:smbd: move SMB1 specific stuff into a substructure of smbd_server_connection
metze
2009-05-26 10:48:12 +02:00
Stefan Metzmacher
688945a994 s3:smbd: add infrastructure for SMB2 support
This is disabled by default and activated by
"max protocol = SMB2".

metze
2009-05-20 15:42:24 +02:00
Tim Prouty
6c935f95b3 s3: Fix chained sesssetupAndX/tconn messages
A sesssetupAndX chained with a tconn will not correctly set the TID in
the response header.  I'm seeing an XP client send this chained
sesssetup/tconn when samba has security = share.  Samba's current
behavior is to return a TID of 0 in the smb header rather than the
actual TID.  This patch also updates the UID in the header as well.
2009-05-08 17:09:16 -07:00
Michael Adam
7d6e4c7e95 s3:smbd: fix the fix for mapped IPv4 address handling in release_ip().
It was too late... Thanks Metze for noticing.

Michael
2009-05-08 16:42:56 +02:00
Michael Adam
e86a534fa7 s3: make release_ip() call (ctdb) cope with IPv4 mapped addresses
Michael
2009-05-08 01:18:58 +02:00
Volker Lendecke
c344ad3043 write_data already guarantees everything was written 2009-04-12 14:51:15 +02:00
Stefan Metzmacher
c16c90a1cb s3:smbd: use new simplified snb_signing code in the server
We keep the seqnum/mid mapping in the smb_request structure.

This also moves one global variable into the
smbd_server_connection struct.

metze
2009-03-23 12:21:13 +01:00
Stefan Metzmacher
7716ad68a8 s3:smbd: if we allow trans2 on the IPC$ share, then we have to allow transs2 too.
Otherwise we'll confuse the client signing engine, when we reply an error to each transs2.

metze
2009-03-23 12:21:12 +01:00
Tim Prouty
dea223ba79 make receive_smb_raw_talloc more readable 2009-02-16 00:29:20 -08:00
Jeremy Allison
f6821a15a0 Noted by Vericode analysis. Correctly use chroot().
Jeremy.
2009-02-13 15:02:32 -08:00
todd stecher
54c51a66e3 S3: New module interface for SMB message statistics gathering
This changelist allows for the addition of custom performance
monitoring modules through smb.conf. Entrypoints in the main message
processing code have been added to capture the command, subop, ioctl,
identity and message size statistics.
2009-02-09 13:23:44 -08:00
Volker Lendecke
9941e730ca Fix memleaks in chain_reply for async requests 2009-02-07 19:25:34 +01:00
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