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

30 Commits

Author SHA1 Message Date
Christof Schmitt
96c48b3c06 s3: Move call to prctl_set_comment to reinit_after_fork
This save a few lines of code.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2015-09-24 08:00:16 +02:00
Günther Deschner
4234cbb694 s3-rpc_server: Fix inteface typo.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun  4 03:51:29 CEST 2015 on sn-devel-104
2015-06-04 03:51:29 +02:00
Ralph Boehme
9e7cf87a30 s3:smbd: use smbd_reinit_after_fork
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-22 23:00:20 +02:00
Michael Adam
e197ddcfa6 s3:lsasd: use lp_load() wrapper lp_load_global()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2015-04-22 13:57:29 +02:00
Andreas Schneider
5ea154bf25 s3-rpc_server: Refactor lsasd_create_sockets().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Oct 21 12:49:44 CEST 2013 on sn-devel-104
2013-10-21 12:49:44 +02:00
Volker Lendecke
b58df3d2bc lsasd: Fix CID 1107233 Double close
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-10-21 08:55:31 +00:00
Andrew Bartlett
88e6342936 s3-lsad: Cast getpid() result to unsigned int for GNU/Solaris build
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-15 10:39:05 -07:00
Andreas Schneider
f06a0352e5 s3-daemons: Set the comment field of the daemons.
PR_SET_NAME sets the comm field of a process. This way we can give
processes a name and they are easier to identify.

$ ps afx -o pid,comm
29447 smbd
29452  \_ epmd
29453  \_ lsasd-master
29455  |   \_ lsasd-child
29457  |   \_ lsasd-child
29459  |   \_ lsasd-child
29461  |   \_ lsasd-child
29463  |   \_ lsasd-child
29454  \_ spoolssd-master
29456      \_ lpqd
29458      \_ spoolssd-child
29460      \_ spoolssd-child
29462      \_ spoolssd-child
29465      \_ spoolssd-child
29466      \_ spoolssd-child
29467      \_ spoolssd-child
29468      \_ spoolssd-child
29469      \_ spoolssd-child
29470      \_ spoolssd-child
29471      \_ spoolssd-child

Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-03-05 23:29:48 +01:00
Andreas Schneider
f573826f18 s3-lsasd: Don't leak file descriptors.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-02-22 16:36:13 +01:00
Volker Lendecke
9a2db48e7e s3: Remove some calls to procid_self
The goal is to have procid_self handling completely in the messaging_context.

Signed-off-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Oct 19 20:39:56 CEST 2012 on sn-devel-104
2012-10-19 20:39:56 +02:00
Rusty Russell
fe72740e82 loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.
They use talloc_tos() internally: hoist that up to the callers, some
of whom don't want to us talloc_tos().

A simple patch, but hits a lot of files.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 15:07:23 +09:30
Stefan Metzmacher
13cfe2504e s3:rpc_server/lsasd: remove dependency to libgen.h and basename()
metze
2012-06-19 17:04:29 +02:00
Jelmer Vernooij
c0288e0612 lib/util: Remove obsolete sys_getpid() and sys_fork().
The performance of these is minimal (these days) and they can return
invalid results when used as part of applications that do not use
sys_fork().

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Mar 24 21:55:41 CET 2012 on sn-devel-104
2012-03-24 21:55:40 +01:00
Andrew Bartlett
14d31376aa s3-lsasd: Fix debug messages on registration failure
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Mon Mar  5 09:50:17 CET 2012 on sn-devel-104
2012-03-05 09:50:17 +01:00
Andrew Bartlett
b07d504ca4 change low FDs are handled in Samba
We now only close fds 0, 1, 2 when we are a forked daemon, and take
care not to close a file descriptor that we might need for foreground
stdin monitoring.

This should fix stdout logging in the lsa and epmapper deamons (ie in
make test).

Andrew Bartlett
2012-03-04 10:14:34 +01:00
Volker Lendecke
0f9d14820e s3: Remove a bunch of calls to procid_self()
All callers to messaging_[re]init only used procid_self()
2011-12-12 21:50:25 +01:00
Volker Lendecke
6d2f65ba7f s3: Fix an uninitialized variable
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Aug 24 00:34:04 CEST 2011 on sn-devel-104
2011-08-24 00:34:04 +02:00
Volker Lendecke
0d3dc8e2d1 s3: Fix the build on FreeBSD
lsasd.c uses basename(3), which according to susv3
requires libgen.h and without which the FreeBSD build breaks.
2011-08-23 23:01:07 +02:00
Andreas Schneider
1152aa8e03 s3-passdb: Keep caches coherent
When deleting a user send a message to all interested parties so they can
purge their caches. Otherwise some processes may positively respond with a
cached getpwnam, when the user have actully been removed.

Without this some tests that remove and then immediately create users are
flakey.

Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:08:25 -04:00
Andreas Schneider
0f4ee5d1b7 s3-lsasd: Listen on \PIPE\lsass.
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:08:24 -04:00
Andreas Schneider
8efdac83ff s3-lsasd: Add missing ncalrpc listeners.
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:07 -04:00
Simo Sorce
2c45954622 s3-lsasd: Remove useless check
If we *really* are a bout to exit (PF_WORKER_EXITING) then the event will not
be called as the loop will exit. Otherwise PF_SRV_MSG_EXIT may not  be honoured
for a long time if we have cients connected, therefore keep handling SIGHUP
properly in those cases.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:06 -04:00
Simo Sorce
cce8c72eb1 s3-lsasd: Listen on parent messages
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:06 -04:00
Simo Sorce
98d2bf052e s3-lsasd: Send a message to the parent when we accept a connection
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:06 -04:00
Simo Sorce
89dde6b7fc s3-lsasd: User new prefork helpers to simplify code.
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:05 -04:00
Simo Sorce
e3736f826b s3-prefork: Fix worker flags handling.
We can't have a clear idea of wether the worker is IDLE or BUSY.
The only things we can tell is if it is Alive, whether it is currently
Accepting connections or wether it is Exiting soon.

Remove PF_WORKER_IDLE, PF_WORKER_BUSY and replace their use with
PF_WORKER_ALIVE. Also properly assign PF_WORKER_ACCEPTING so that
users of the API can rely on the flag.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:05 -04:00
Simo Sorce
ee0c69a25e s3-prefork: do not use a lock_fd, just race on accept()
We used a lock mimicking what apache does for preforked children.
But it doesn't work properly in our case because we do not stop once a request
has been served. Clients are allowed to perform multiple requests and keep the
connection open.
This means that if we allow multiple clients per children, then a child could
take the lock and then be asked to do a long or even locking operation by a
client it already is serving. This woulkd cause the whole server to deadlock,
as the child is now busy and also holding on the lock.
Using a race on accept() by having a tevent_fd on the listening socket wait
for read events we never deadlock. At most we cause a bit of contention among
children. But in the generic case connections are much less frequent for us as
clients tend to be long lived. So the little contention we may have is not a
big deal.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:05 -04:00
Simo Sorce
c538b01225 s3-lsasd: Use prefrok utils to manage children
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:04 -04:00
Simo Sorce
5b3eb835f6 s3-lsasd: Import fixes from spoolssd
Properly rotate log files in children by using a gloabl lsasd_child_id
variable.
Simplify code by using a global lsasd_pool variable, we can never use
more than one prefork pool in the same process anyway.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:03 -04:00
Andreas Schneider
0364bf025c s3-lsasd: Create a lsa service daemon.
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:02 -04:00