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

579 Commits

Author SHA1 Message Date
Michael Adam
ba482e6b8d s3:smbd: make smbd_open_one_socket() static
Michael
2009-01-29 15:42:10 +01:00
Stefan Metzmacher
3ee1acdc8e s3:smbd: ignore open_socket_in() failures
This restores the pre e0232934fb
behavior.

metze
2009-01-29 15:33:47 +01:00
Stefan Metzmacher
e0232934fb s3:smbd: wait for new connection via fd events
metze
2009-01-27 15:28:12 +01:00
Stefan Metzmacher
bf2347bd7d s3:smbd: make mdns registration event driven.
metze
2009-01-27 15:28:11 +01:00
Stefan Metzmacher
e11e82318c s3:smbd: make inetd code path more clear
metze
2009-01-27 15:28:11 +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
Stefan Metzmacher
6a2b7f9815 s3:smbd: we should setup the client socket in the same way in all code pathes
We should behave the same in inetd, interactive and deamon modes.

metze
2009-01-27 15:28:07 +01:00
Stefan Metzmacher
7d93d3d4b8 s3:namecache: remove unused namecache_shutdown() function
metze
2009-01-27 15:28:06 +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
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
520f88143b Remove some unused code 2009-01-20 16:41:32 +01:00
Stefan Metzmacher
dc6edf1ab4 s3:cluster: fix ctdb ipv6 support
We need to use CTDB_CONTROL_TCP_CLIENT instead of CTDB_CONTROL_TCP_ADD.

CTDB_CONTROL_TCP_CLIENT has support for 2 modes in newer ctdb versions:

- with struct ctdb_control_tcp it only supports ipv4.
- with struct ctdb_control_tcp_addr it supports ipv4 and ipv6.

You need new header files which defines struct ctdb_control_tcp_addr,
but at runtime it should be fine to work against older
ctdb versions (<= 1.0.68).

metze
2009-01-16 15:16:59 +01:00
Michael Adam
39ec8791f8 s3: make better use of ccache by not including version.h in every C-file.
version.h changes rather frequently. Since it is included via includes.h,
this means each C file will be a cache miss. This applies to the following
situations:

* When building a new package with a new Samba version

* building in a git branch after calling mkversion.sh
  after a new commit (i.e. virtually always)

This patch improves the situation in the following way:

* remove inlude "version.h" from includes.h

* Use samba_version_string() instead of SAMBA_VERSION_STRING
  in files that use no other macro from version.h instead of
  SAMBA_VERSION_STRING.

* explicitly include "version.h" in those files that use more
  macros from "version.h" than just SAMBA_VERSION_STRING.

Michael
2009-01-15 22:56:01 +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
Stefan Metzmacher
defb574c25 s3:smbd: variables in a main() don't need to be static
metze
2009-01-08 12:22:21 +01:00
Stefan Metzmacher
7a5d07a1c1 s3:smbd: open_sockets_smbd() don't need a static variable arrount atexit()
open_sockets_smbd() is only called once.

metze
2009-01-08 12:22:21 +01:00
Bo Yang
022e2f8199 clean event context after child is forked.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-01-05 15:07:31 +01:00
Tim Prouty
99c68fa23e s3 build: Fix warning 2008-12-30 12:53:34 -08:00
Stefan Metzmacher
465176b7e2 s3:cluster: register the client connection via CTDB_CONTROL_TCP_ADD
This means we correctly pass IPv6 addresses too.
(CTDB_CONTROL_TCP_CLIENT was IPv4 only)

metze
2008-12-30 16:18:08 +01:00
Yasuma Takeda
611ef42053 Fix bug #5944 - nmbd does not boot if socket adress = "" is defined in smb.conf 2008-12-05 13:37:51 -08:00
Jeremy Allison
8962be69c7 Make us clean under valgrind --leak-check=full by using talloc_autofree_context() instead of NULL.
Remove the code in memcache that does a TALLOC_FREE on stored pointers. That's a disaster waiting
to happen. If you're storing talloc'ed pointers, you can't know their lifecycle and they should
be deleted when their parent context is deleted, so freeing them at some arbitrary point later
will be a double-free.
Jeremy.
2008-11-06 20:48:13 -08:00
Jelmer Vernooij
6a2caa34b2 Remove sys_chroot() - libreplace already provides an alternative. 2008-11-01 03:46:09 +01:00
Günther Deschner
9289537c90 s3-build: fix the build of smbd.
Guenther
2008-10-18 21:45:49 +02:00
Jelmer Vernooij
2d89b52be8 Use separate make variables for libutil and libcrypto. 2008-10-18 14:28:40 +02:00
Jeremy Allison
f6c883b4b0 Simply our main loop processing. A lot :-). Correctly use events for all the previous "special" cases.
A step on the way to adding signals to the events and being able to merge the S3 event system with
the S4 one.
Jeremy.
2008-10-03 14:18:35 -07:00
Jeremy Allison
0595ecb3a6 Fix for bug #5688 from SATOH Fumiyasu <fumiyas@osstech.co.jp>. LPQ process is orphaned if socket address parameter is invalid.
If the "socket address" parameter is a null string that is an invalid value for Samba 3.2 but valid for Samba 3.0.
Jeremy.
(This used to be commit c65726d418)
2008-08-14 11:22:47 +02:00
Michael Adam
f284cde4b9 smbd: prevent smbd from panicing with "clustering = no" but --with-cluster-support
Michael
(This used to be commit a687949d19)
2008-08-13 11:54:13 +02:00
Andrew Tridgell
1a4e299c70 added a explanatory comment on tcon check
(This used to be commit f2ab2cebb9)
2008-08-13 11:54:12 +02:00
Andrew Tridgell
416fa081ab ensure we exit with non-zero status on EOF on socket, so the parent
can trigger a brlock db cleanup
(This used to be commit bbd49f9e1c)
2008-08-13 11:54:12 +02:00
Andrew Tridgell
b5f4373be5 fixed child exit handling and IP release handling
(This used to be commit 6fe27d296c)
2008-08-13 11:54:12 +02:00
Andrew Tridgell
4b2399d5c0 log unclean shutdowns
(This used to be commit 30b83245a2)
2008-08-13 11:54:12 +02:00
Andrew Tridgell
2f09edb492 register the ctdbd reconfigure message
(This used to be commit 9d3217bb28)
2008-08-13 11:54:12 +02:00
Andrew Tridgell
0f41961e4f first cut at adding full transactions for ctdb to samba3
(This used to be commit f91a3e0f7b)
2008-08-13 11:54:08 +02:00
Michael Adam
59634c91ec smbd: untangle logic in smbd_messaging_context() slightly.
Michael
(This used to be commit fae4c21b14)
2008-06-26 12:31:10 +02:00
Michael Adam
8b6d41b3b0 smbd: don't panic if messaging_init() fails but return NULL
leaving panic or more appropriate action to callers.
This can for instance happen in a clustered setup, when
ctdb is not running. This allows for a more defined behaviour,
reducing chicken-egg-problems.

Michael
(This used to be commit 3b6541ff48)
2008-06-26 12:31:10 +02:00
Jeremy Allison
6811dc3fc2 Allow server manager to close open files selected by id.
Jeremy.
(This used to be commit 7eeed8bb41)
2008-05-27 11:25:46 -07:00
Volker Lendecke
0c4093a234 Fix CLEAR_IF_FIRST handling of messages.tdb
We now open messages.tdb even before we do the become_daemon. become_daemon()
involves a fork and an immediate exit of the parent, thus the
parent_is_longlived argument must be set to false in this case. The parent is
not really long lived :-)
(This used to be commit 4f4781c6d1)
2008-04-23 22:18:26 +02:00
Stefan Metzmacher
2df0ade13a smbd: create the messaging conntext earlier
metze
(This used to be commit 658d847533)
2008-04-18 15:00:19 +02:00
Stefan Metzmacher
f2067658df smbd: call reinit_after_fork() in the needed places
metze
(This used to be commit 425b3513a4)
2008-04-18 14:43:08 +02:00
Stefan Metzmacher
b7a141f8a7 smbd: merge "smbd:backgroundqueue=no" option from the v3-0-ctdb tree
metze
(This used to be commit 16d295d466)
2008-04-18 14:43:07 +02:00
Michael Adam
a9ff941f41 registry: rename init_registry() to registry_init_full() for consistency.
Michael
(This used to be commit 14d82708d4)
2008-04-13 15:33:48 +02:00
Michael Adam
281e610ff3 registry: change init_registry() to return WERROR instead of bool.
Michael
(This used to be commit 0b196095db)
2008-04-13 15:33:48 +02:00
Stefan Metzmacher
e21b283d67 dbwrap: wait for tdb2 change notifies in smbd, nmbd and winbindd
metze
(This used to be commit 64450cc1e4)
2008-04-12 09:14:10 +02:00
Alexander Bokovoy
c2bb4b51c1 Destroy DMAPI session when main smbd daemon exits.
DMAPI session is precious resource maintained at kernel level. We open one of them and use across multiple smbd daemons
but once last of them exits, DMAPI session needs to be destroyed. There are some HSM implementations which fail to
shutdown when opened DMAPI sessions left. Ensure we shutdown our session when it is really not needed anymore.
This is what recommended by DMAPI specification anyway.
(This used to be commit a0cefd4400)
2008-04-08 15:19:01 +04:00
root
3d2ec80693 Port 3c1f1f0797e from 3-0-ctdb
We need to inform ctdb about the client's TCP connection so that after a fail
over ctdbd can trigger the client to reconnect very quickly
(This used to be commit ddc989886d)
2008-03-20 16:54:05 +01:00
Andrew Tridgell
f152fe2103 [samba-3-0-ctdb.tridge @ tridge@samba.org-20070602053809-kpw5kjkcyjs8yjbl]
suppress that darn message
(cherry picked from commit 542e46a21898f6fcc8a0aeb63925607a60e0b99f)
(This used to be commit 5e8c624c9c)
2008-03-18 17:12:08 +01:00
Tim Potter
a8fbb92146 Check return code of secrets_init() function.
(This used to be commit 2b1eead269)
2008-02-18 10:15:44 +01:00
Alexander Bokovoy
c17c64530e Merge DMAPI fixes from CTDB Samba
(This used to be commit cf1f90ad7a)
2008-01-18 17:34:21 +03:00