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

6121 Commits

Author SHA1 Message Date
Volker Lendecke
5812645f49 s3: Priorize the async echo responder over the client
Without this, an active client connection can starve the echo responder. This
leads to apparently "lost" SMBs.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Jul 28 18:53:38 CEST 2011 on sn-devel-104
2011-07-28 18:53:38 +02:00
Volker Lendecke
4dd0a3b5e2 s3: Remove unused smbd_echo_reader() 2011-07-28 17:42:23 +02:00
Volker Lendecke
710e5d9256 s3: Use smbd_echo_read_send in the async echo handler 2011-07-28 17:42:23 +02:00
Volker Lendecke
27afb8910f s3: Add smbd_echo_read_send/recv
Read a SMB packet in the echo responder, giving the parent one second to step
in
2011-07-28 17:42:23 +02:00
Jeremy Allison
d82256ca11 Use existing ISDOT and ISDOTDOT macros.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Jul 28 02:09:20 CEST 2011 on sn-devel-104
2011-07-28 02:09:20 +02:00
Simo Sorce
759a04e58a s3-rpc_server: Move pipe/handles functions
Put InternalPipes related functions in rpc_handles.c and out of rpc_ncacn_np.c
rpc_handles.c is the only file that really uses them after all and ncacn_np.c
is the wrong place for that stuff.
While ther remove unnecessary wrapper functions now that the InternalPipes
static variable is directly accessible.

Also move all pipes_struct related header stuff in its own rpc_pipes.h header.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-07-21 18:40:23 +02:00
Andrew Bartlett
6622821063 s3-auth Remove seperate guest boolean
Instead, we base our guest calculations on the presence or absense of the
authenticated users group in the token, ensuring that we have only
one canonical source of this important piece of authorization data

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:14 +10:00
Andrew Bartlett
9fcc617ff5 s3-auth Use the common auth_session_info
This patch finally has the same structure being used to describe the
authorization data of a user across the whole codebase.

This will allow of our session handling to be accomplished with common code.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:13 +10:00
Andrew Bartlett
128ae06a61 s3-auth use auth_user_info not netr_SamInfo3 in auth3_session_info
This makes auth3_session_info identical to auth_session_info

The logic to convert the info3 to a struct auth_user_info is
essentially moved up the stack from the named pipe proxy in
source3/rpc_server to create_local_token().

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:13 +10:00
Andrew Bartlett
e2049e77e4 s3-auth Use guest boolean in auth_user_info_unix
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:11 +10:00
Andrew Bartlett
9289537993 s3-auth Use struct auth_user_info_unix for unix_name and sanitized_username
This is closer to the layout of struct auth_session_info in auth.idl

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:11 +10:00
Andrew Bartlett
6d741e918f s3-auth Use *unix_token rather than utok in struct auth3_session_info
This brings this structure one step closer to the struct auth_session_info.

A few SMB_ASSERT calls are added in some key places to ensure that
this pointer is initialised, to make tracing any bugs here easier in
future.

NOTE: Many of the users of this structure should be reviewed, as unix
and NT access checks are mixed in a way that should just be done using
the NT ACL.  This patch has not changed this behaviour however.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:10 +10:00
Andrew Bartlett
f16d8f4eb8 s3-auth Use struct auth3_session_info outside the auth subsystem
This seperation between the structure used inside the auth modules and
in the wider codebase allows for a gradual migration from struct
auth_serversupplied_info -> struct auth_session_info (from auth.idl)

The idea here is that we keep a clear seperation between the structure
before and after the local groups, local user lookup and the session
key modifications have been processed, as the lack of this seperation
has caused issues in the past.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:10 +10:00
Andrew Bartlett
485898458a debug: log early messages to stdout, and keep it open
The --log-stdout option was compromised by the log file descriptors being
closed once the file process forked.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:09 +10:00
Jeremy Allison
ee34c25c8a First part of fix for bug 8310 - toupper_ascii() is broken on big-endian systems
Remove
int toupper_ascii(int c);
int tolower_ascii(int c);
int isupper_ascii(int c);
int islower_ascii(int c);

and replace with their _m equivalents, as they are identical.
2011-07-19 13:19:29 -07:00
Andreas Schneider
8b085c02eb s3-smbd: Pass event and messaging context to smbd_parent_housekeeping(). 2011-07-14 16:10:47 +02:00
Andreas Schneider
68520ec02c s3-smbd: Pass ev_ctx to remove_child_pid(). 2011-07-14 16:10:47 +02:00
Andreas Schneider
7da54eab64 s3-smbd: Pass msg_ctx to smbd_accept_connection. 2011-07-14 16:10:47 +02:00
Andreas Schneider
fa1bba26aa s3-smbd: Pass ev_ctx to smbd_setup_sig_chld_handler(). 2011-07-14 16:10:47 +02:00
Andreas Schneider
55a025e041 s3-smbd: Pass ev_ctx and msg_ctx to smbd_accept_connection(). 2011-07-14 16:10:46 +02:00
Andreas Schneider
0b8f8f18fb s3-smbd: Pass ev_ctx and msg_ctx to open_sockets_smbd(). 2011-07-14 16:10:46 +02:00
Andreas Schneider
a3dc8f71d2 s3-smbd: Pass ev_ctx to smbd_parent_loop(). 2011-07-14 16:10:46 +02:00
Andreas Schneider
4c446c0297 s3-smbd: Create ev_ctx and msg_ctx and use it. 2011-07-14 16:10:45 +02:00
Stefan Metzmacher
0633c0f600 s3:smbd: s/SMBkeepalive/NBSSkeepalive
metze
2011-07-12 09:44:04 +02:00
Stefan Metzmacher
aca920b27c s3:smbd: use PROTOCOL_SMB2_02 instead PROTOCOL_SMB2
metze
2011-07-12 08:18:00 +02:00
Stefan Metzmacher
f5d320ac0f s3:smb2_create: use smbd_calculate_access_mask() instead of smbd_check_open_rights()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Jul 11 22:45:01 CEST 2011 on sn-devel-104
2011-07-11 22:45:01 +02:00
Stefan Metzmacher
a1046389ff s3:smb2_tcon: return the correct maximal_access on the share
metze
2011-07-11 21:33:29 +02:00
Stefan Metzmacher
58eed1b295 s3:smbd: return the real share access mask in the SMBtconX response
metze
2011-07-11 21:33:29 +02:00
Stefan Metzmacher
581d8fa36b s3:smbd: use smbd_calculate_access_mask() also for fake_files
metze
2011-07-11 21:33:29 +02:00
Stefan Metzmacher
896f105ed4 s3:smbd: check the share level access mask in smbd_calculate_access_mask()
I think we should reject invalid access early,
before we might create new files.

Also smbd_check_open_rights() is only called if the file existed.

metze
2011-07-11 21:33:20 +02:00
Stefan Metzmacher
ce66d4e4a8 s3:smbd: make smbd_calculate_access_mask() non-static
metze
2011-07-11 21:23:08 +02:00
Stefan Metzmacher
18f967a248 s3:smbd/msdfs: let create_conn_struct() check the share security descriptor
metze
2011-07-11 21:23:08 +02:00
Jeremy Allison
fe3992541d Move smbd_smb2_request_check_tcon() smbd_smb2_request_check_session() next to their only user and make them static. Add comments.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Jul  8 21:01:40 CEST 2011 on sn-devel-104
2011-07-08 21:01:40 +02:00
Stefan Metzmacher
dbfb88aef3 s3:smb2_server: add some comments about change_to_user() and change_to_root_user()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Jul  8 13:45:46 CEST 2011 on sn-devel-104
2011-07-08 13:45:46 +02:00
Andrew Bartlett
cda8686940 lib/param: Merge struct loadparm_service into common
This is handled by a common header and a .c file that is included into
both loadparm.c files.

In the process, _lp functions were renamed to lp__ to allow the common
function definition declarations to be used by source3 and source4
(which have different macro definitions).

The only parameter to change type is 'strict_locking' which was a
bool, and is now an int, to accommodate the 'Auto' value from source3.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Jul  8 12:35:56 CEST 2011 on sn-devel-104
2011-07-08 12:35:56 +02:00
Andrew Bartlett
6e6aaacedb lib/util Move bitmap.c to lib/util 2011-07-08 11:23:23 +02:00
Jeremy Allison
8dc7029561 Fix bug #8293 - SMB2 doesn't rotate the log files often enough.
Move the num_requests field out of the smb1 struct into the generic
struct smbd_server_connection struct. Use it to count SMB2 requests
as well as SMB1 and ensure that check_log_size() is called every 50
SMB2 requests.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Jul  8 01:14:53 CEST 2011 on sn-devel-104
2011-07-08 01:14:53 +02:00
Stefan Metzmacher
eea210eba7 s3:smb2_server: call change_to_root_user() or smbd_smb2_request_check_tcon()
For all requests which don't operate on a tcon, we should call
change_to_root_user(), to match the SMB1 behavior.

For SMB1 we do the following operations without AS_USER:

/* 0x70 */ { "SMBtcon",reply_tcon,0},
/* 0x71 */ { "SMBtdis",reply_tdis,DO_CHDIR},
/* 0x72 */ { "SMBnegprot",reply_negprot,0},
/* 0x73 */ { "SMBsesssetupX",reply_sesssetup_and_X,0},
/* 0x74 */ { "SMBulogoffX",reply_ulogoffX, 0}, /* ulogoff doesn't give a valid TID */
/* 0x75 */ { "SMBtconX",reply_tcon_and_X,0},
...
/* 0x2b */ { "SMBecho",reply_echo,0},
...
/* 0xa4 */ { "SMBntcancel",reply_ntcancel, 0 },

For SMB2tdis we still call smbd_smb2_request_check_tcon()
as close_cnum() calls change_to_root_user() when needed.

metze

Signed-off-by: Jeremy Allison <jra@samba.org>
2011-07-07 14:17:17 -07:00
Christian Ambach
9a3e2d1c02 s3:smbd fix a compile warning on AIX 5.3
use the correct alias instead of FD directly

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Tue Jul  5 19:51:42 CEST 2011 on sn-devel-104
2011-07-05 19:51:42 +02:00
Volker Lendecke
4deca5d728 s3: Fix bug 8102
We can't allow open with access that has been denied via the share
security descriptor

Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Jul  5 16:21:54 CEST 2011 on sn-devel-104
2011-07-05 16:21:53 +02:00
Volker Lendecke
720fa46f94 s3: Calculate&store the maximum share access mask
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-07-05 13:28:08 +02:00
Volker Lendecke
1c022d2e41 s3: Return "granted" from share_access_check
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-07-05 13:28:03 +02:00
Christian Ambach
ad4a10dd05 s3:smb2 fix smbd crash on premature end of smb2 conn (Bug 8286)
when smbd tries to clean up locks after a premature end of a smb2
connection, lock_db has already been freed and so it crashes

this patch changes the order in which items are freed so that
lock_db is still around when it is needed

Jeremy, Metze, please check

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Mon Jul  4 20:00:26 CEST 2011 on sn-devel-104
2011-07-04 20:00:26 +02:00
Stefan Metzmacher
7c96e96e98 s3:smb2_server: there's no reason to check the session id twice on a smb2_tcon request
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Jul  4 17:34:13 CEST 2011 on sn-devel-104
2011-07-04 17:34:13 +02:00
Stefan Metzmacher
601b138e92 s3:smb2_create: call 'return' after smbd_server_connection_terminate()
This is not strictly needed in the fork process model, but we hopefully
support other models in future.

metze
2011-07-04 16:21:45 +02:00
Andrew Bartlett
c599d075cb s3-lib Move event_add_idle() to source3/lib/events.c
This allows libauth not to depend on smbd_base.

Andrew Bartlett
2011-07-04 18:53:59 +10:00
Andreas Schneider
aee04ef330 s3-smbd: Remove client_address from smbd_server_connection struct.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:40 +10:00
Andreas Schneider
b2511a280a s3-smbd: Remove obsolete smbd_set_server_fd().
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:36 +10:00
Andreas Schneider
2f92ffb1a4 s3-smbd: Replace client_id in smbd session setup.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:30 +10:00
Andreas Schneider
ea2917c7a2 s3-smbd: Replace client_id in smbd session.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:28 +10:00