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

46 Commits

Author SHA1 Message Date
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
Stefan Metzmacher
44d655b33f s3:smbd: add echo handler information to struct smbd_server_connection
metze
2010-03-22 17:15:12 +01:00
Volker Lendecke
d6a6872506 s3: Abstract access to sessionid.tdb, similar to conn_tdb.c 2010-03-01 17:53:22 +01:00
Jeremy Allison
2f30aea332 Remove the global char *LastDir.
This is no longer used for anything.
2010-01-12 14:48:23 -08: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
16836f9e9e We now pass the Microsoft SMB2 fileio test with EA's and streams...
Jeremy.
2009-09-17 09:29:07 -07:00
Stefan Metzmacher
59c3f5e3ca s3:smbd: move dptr globals into struct smbd_server_connection
metze
2009-08-07 14:18:17 +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
Stefan Metzmacher
f62a331045 s3:smbd: move global notify_changes_by_mid to smbd_server_connection
metze
2009-07-02 09:10:58 +02: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
e16e7146b3 s3:smbd: move negprot related globals to struct smbd_server_connection
metze
2009-06-03 17:54:37 +02:00
Stefan Metzmacher
f20ded603b s3:smbd: move pending_auth_data list to struct smbd_server_connection
metze
2009-06-03 17:54:36 +02:00
Stefan Metzmacher
52f2f9449f s3:smbd: remove unused global 'orig_inbuf'
metze
2009-05-26 16:36:25 +02:00
Tim Prouty
e4675ce8db s3: Add extid to the dev/inode pair
This extends the file_id struct to add an additional generic uint64_t
field: extid.  For backwards compatibility with dev/inodes stored in
xattr_tdbs and acl_tdbs, the ext id is ignored for these databases.
This patch should cause no functional change on systems that don't use
SMB_VFS_FILE_ID_CREATE to set the extid.

Existing code that uses the smb_share_mode library will need to be
updated to be compatibile with the new extid.
2009-02-19 20:58:26 -08: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
b8c416fe2a s3:smbd: convert aio to use tevent_signal
metze
2009-01-27 15:28:09 +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
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
aeb798c325 s3:smbd: handle incoming smb requests via event handlers
We use a fd event and receive incoming smb requests
when the fd becomes readable. It's not completely
nonblocking yet, but it should behave like the old code.

We use timed events to trigger retries for deferred open calls.

metze
2009-01-09 08:45:40 +01:00
Stefan Metzmacher
3dde0cbb76 s3:smbd: move all globals and static variables in globals.[ch]
The goal is to move all this variables into a big context structure.

metze
2009-01-08 12:22:21 +01:00