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

74 Commits

Author SHA1 Message Date
Stefan Metzmacher
e23785ae37 s3:smbd: introduce 'struct smbXsrv_client' in order to prepare multi-channel support
This structure is supposed to hold the global state shared between
multiple connections from the same client.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Stefan Metzmacher
45807028d4 lib/util: move memcache.[ch] to the toplevel 'samba-util' library
This is generic enough that it could be used in all code.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jul 18 15:43:33 CEST 2014 on sn-devel-104
2014-07-18 15:43:33 +02:00
Michael Adam
8eab264470 s3:smbd: move initialization of the smbd_shim from smbd_init_globals() to main()
This is in preparation of adding server exit hooks to the shim.

Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:14:58 +02:00
Jeremy Allison
56b7525125 Sigh :-(. Removing optimization prematurely is the root of all evil :-(.
Sorry for the mistake, but the LastDir singleton cache in vfs_ChDir()
actually plays an important role. When we're processing a stream of
SMB1/SMB2/SMB3 requests we don't want to add a chdir()/getcwd()
system call pair on every request if they're all on the same connection
and dealing with the same base path.

I did some testing with a program that times 1,000,000 chdir()
requests vs. 1,000,000 strcmp requests and it's a penalty of 10x
doing the system calls.

Just because it's old code, doesn't mean it's bad :-(.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 13 21:31:42 CEST 2012 on sn-devel-104
2012-09-13 21:31:42 +02:00
Jeremy Allison
a8676e69a6 Remove ancient "optimization" global LastDir. 2012-09-12 22:06:06 +02:00
Volker Lendecke
ff701ceae2 s3: Add vfs_aio_posix
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-07-18 15:41:36 -07:00
Volker Lendecke
66eb7bc6ec s3: Remove the unused completion handling from aio.c
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-07-18 15:38:15 -07:00
Volker Lendecke
f5dc8837d9 s3: Properly handle shutdown with the _send/_recv based aio
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-07-18 15:37:28 -07:00
Volker Lendecke
5df1fda0f5 s3: Restore async i/o with the "native" AIO interface
eff3609 moved the async signal handler initialization to later in the process
to enable aio_fork and aio_pthread on platforms without realtime signals. This
commit broke the use of the native aio interface. aio_pending_size is
initialized to 0, so aio.c will not allow async i/0 at all if modules do not
set that variable correctly. Initialize to 100 right from the start.

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

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jun 26 14:08:22 CEST 2012 on sn-devel-104
2012-06-26 14:08:22 +02:00
Andrew Bartlett
d2f6d0ba1e build: Rationalise AIO support in configure, ensure on by default
With this change, the define to check for AIO is HAVE_AIO, consistant
with other subsystems.

It is now also on by default in the autoconf build, as it has been for waf.

Andrew Bartlett
2012-06-06 08:23:10 +02:00
Stefan Metzmacher
e17fa58d6e s3:smbd: move global smbd_msg_state to smbXsrv_connection
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri May 25 11:01:27 CEST 2012 on sn-devel-104
2012-05-25 11:01:27 +02:00
Stefan Metzmacher
167cccbc19 s3:smbd: move global koplocks to smbd_server_connection
metze
2012-05-25 09:05:35 +02:00
Stefan Metzmacher
469a2c8e7c s3:smbd: move global oplocks vars to smbd_server_connection
metze
2012-05-25 09:05:34 +02:00
Stefan Metzmacher
b5e9ece1f3 s3:smbd: remove global 'smbd_server_conn' !!!
For now we still use a global 'global_smbXsrv_connection'
in order to pass the connection state to exit_server*().

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu May 24 20:07:20 CEST 2012 on sn-devel-104
2012-05-24 20:07:20 +02:00
Stefan Metzmacher
19078b9b05 s3:smbd/globals: remove unused msg_ctx_to_sconn()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Dec 15 14:24:59 CET 2011 on sn-devel-104
2011-12-15 14:24:59 +01:00
Stefan Metzmacher
1515f7db00 s3:smbd: remove unused smbd_messaging_context()
metze
2011-12-14 08:15:30 +01:00
Stefan Metzmacher
78582da8b5 s3:smbd/server: maintain the list of child processes under smbd_parent_context
metze
2011-12-14 08:15:06 +01:00
Stefan Metzmacher
6d15ca3482 s3:smbd/globals: change 'int am_parent' into 'struct smbd_parent_context *am_parent'
This is a short term solution on the way to get rid of 'am_parent' completely.

metze
2011-12-14 08:14:44 +01:00
Volker Lendecke
5efd7e16c2 s3: Move can_delete_directory to smbd/, remove shim
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Dec 13 19:00:37 CET 2011 on sn-devel-104
2011-12-13 19:00:37 +01:00
Stefan Metzmacher
1ce9c0ea32 s3:smbd: remember the event context on smbd_server_connection
metze
2011-12-12 14:35:42 +01:00
Andrew Bartlett
38de149e9b s3-seal Remove struct smb_srv_trans_enc_ctx
This structure added no value, particularly after the move to gensec.

It was added at a time when auth_ntlmssp_state was not available in
the client.  This changed a while back (the wrapper was extended with
client calls), and the move to gensec again reinforced that we do not
need the extra complexity.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-10-21 08:50:02 +02:00
Volker Lendecke
223fbc9c62 s3: Fix some nonempty blank lines 2011-08-10 19:56:09 +02:00
Simo Sorce
9ce6416673 s3-printing: Rework how the background process is started
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:04 +02:00
Volker Lendecke
d20e968cff s3: Move deferred_open_queue to smbd_server_connection 2011-08-02 19:18:09 +02:00
Simo Sorce
2e8a85ec72 s3:smbd - Move printing queue stuff
This way we can properly deal with pcap updates in the background queue process
if it is enabled (on by default) and not perform these actions in the main
smbd process.

Signed-off-by: Günther Deschner <gd@samba.org>
2011-08-02 15:28:03 +02: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
Andrew Bartlett
b373d0e777 s3-build: Provide a run-time shim to work around duplicate symbols
The become_root() and similar 'smbd' functions that are used widely in
Samba libraries had 'dummy' copies in dummysmbd.c and dummyroot.c.

These have been replaced by a runtime plugin mechanim, which ensures
that standlone binaries still do nothing, while in smbd the correct
function is used.

This avoids having these as duplicate symbols in the smbd binary,
which can cause unpredictable behaviour.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-21 15:54:51 +10:00
Rusty Russell
0e4c358e27 tdb_compat.h: divert every tdb build and includes to tdb_compat
We change all the headers and wscript files to use tdb_compat; this
means we have one place to decide whether to use TDB1 or TDB2.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:34 +02:00
Andrew Bartlett
e5dd03d199 s3-globals Remove smbd_event_context() (use server_event_context())
This has been a wrapper around server_event_context() for some time
now, and removing this from dummmysmbd.c assists with library
dependencies.

Andrew Bartlett
2011-05-31 00:32:07 +02:00
Andrew Tridgell
45e26fdeec s3-smbd: expose smbd_set_server_fd()
this allows the fd to be setup by subsystems that want to use the s3
server core code

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Sun May  8 12:01:13 CEST 2011 on sn-devel-104
2011-05-08 12:01:13 +02:00
Günther Deschner
d8cfca3a9b s3: only include tdb headers where needed.
Guenther
2011-05-06 10:48:10 +02:00
Günther Deschner
b2af281e50 s3-messages: only include messages.h where needed.
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
8c24ebf371 s3: include smbd/smbd.h where needed.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
6c8b820b9b s3-globals: silence build warning in smbd_messaging_context().
Guenther
2011-03-23 19:24:35 +01:00
David Disseldorp
0b188e7784 s3-printing: Initiate pcap reload from parent smbd
Since commit 7022554, smbds share a printcap cache (printer_list.tdb),
therefore ordering of events between smbd processes is important when
updating printcap cache information. Consider the following two process
example:
1) smbd1 receives HUP or printcap cache time expiry
2) smbd1 checks whether pcap needs refresh, it does
3) smbd1 marks pcap as refreshed
4) smbd1 forks child1 to obtain cups printer info
5) smbd2 receives HUP or printcap cache time expiry
6) smbd2 checks whether pcap needs refresh, it does not (due to step 3)
7) smbd2 reloads printer shares prior to child1 completion (stale pcap)
8) child1 completion, pcap cache (printer_list.tdb) is updated by smbd1
9) smbd1 reloads printer shares based on new pcap information

In this case both smbd1 and smbd2 are reliant on the pcap update
performed on child1 completion.
The prior commit "reload shares after pcap cache fill" ensures that
smbd1 only reloads printer shares following pcap update, however smbd2
continues to present shares based on stale pcap data.

This commit addresses the above problem by driving pcap cache and
printer share updates from the parent smbd process.
1) smbd0 (parent) receives a HUP or printcap cache time expiry
2) smbd0 forks child0 to obtain cups printer info
3) child0 completion, pcap cache (printer_list.tdb) is updated by smbd0
4) smbd0 reloads printer shares
5) smbd0 notifies child smbds of pcap update via message_send_all()
6) child smbds read fresh pcap data and reload printer shares

This architecture has the additional advantage that only a single
process (the parent smbd) requests printer information from the printcap
backend.

Use time_mono in housekeeping functions As suggested by Björn Jacke.
2011-01-07 15:37:39 -08:00
Jeremy Allison
781c4aabb8 Move error reporting of messaging context creation fail into
the daemons themselves. Allows client utilities to silently
fail to create a messaging context due to access denied on the
messaging tdb (which I need for the following patch).

Jeremy.
2010-11-14 04:39:05 +00:00
Volker Lendecke
fb2f0c5bdd s3: Add msg_ctx_to_sconn 2010-10-03 18:17:08 +02:00
Volker Lendecke
49b4d2e652 s3: Remove some remaining files.c globals to sconn 2010-09-28 07:36:18 +02:00
Volker Lendecke
5e26e4d30f s3: Move "Files" to smbd_server_connection 2010-09-28 07:36:15 +02:00
Volker Lendecke
f83e7d8f8c s3: Remove "server_fd" global variable 2010-09-28 07:36:15 +02:00
Günther Deschner
aba1bf4b5e s3-build: only include memcache.h where needed.
Guenther
2010-08-26 00:20:28 +02:00
Volker Lendecke
d3a0ff311e s3: Make char_flags and base_reverse const arrays
This moves those arrays from dynamic to static, shared memory, removing them
from globals.c.

I did it by dumping the result of init_tables() with dump_data(). Some massage
by an editor macro made it the initializer.
2010-08-24 22:45:41 +02:00
Volker Lendecke
2d81721a3f s3: Move "trans_num" to smbd_server_connection 2010-08-24 21:06:41 +02:00
Jeremy Allison
5bdb8b472c Revert "Remove the global char *LastDir."
Volker pointed out I'd missed the "last directory" cache
part of this code. Return us to caching the directory we're
in (reduces sys call load).

Mea maxima culpa.

Jeremy.

This reverts commit 2f30aea332.
2010-07-13 09:30:35 -07:00
Simo Sorce
5e576a53ab s3:lib make server contexts generic
Pair-programmed-with: Andreas Schneider <asn@samba.org>
2010-06-10 17:30:45 -04:00
Jeremy Allison
b5638a0560 Don't use the autofree context for the globals. This causes child smbd's forked
by modules to crash due to destructors being called (found when using the vfs_aio_fork
module with smb2).

Jeremy.
2010-06-10 13:17:35 -07:00
Andreas Schneider
fad86ddf55 s3-smbd: Remove unneeded dependency of map_username to globals.c.
Reviewed-by: Simo Sorce <idra@samba.org>
2010-06-04 12:12:08 -04:00
Andrew Bartlett
59422efca9 s3:smbd move messaging_context and memcache into globals.c
This helps vfstest, which previously had duplicate copies of these functions.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-05-28 18:08:27 +02:00
Jeremy Allison
895b99fd6b Be more forgiving on client oplock break failure (as Windows does). Remove a global.
Jeremy.
2010-05-13 11:33:02 -07:00
Jeremy Allison
ebf6340bb5 Move the global blocking lock records into the smb1 state.
Jeremy
2010-04-29 16:50:15 -07:00