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

241 Commits

Author SHA1 Message Date
David Disseldorp
d428aa65d3 winbindd: don't leak state_path onto talloc tos
Also check for allocation failures.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-03 23:46:05 +01:00
Jeremy Allison
f9588675ea s3: winbindd: On new client connect, prune idle or hung connections older than "winbind request timeout"
Bug 3204 winbindd: Exceeding 200 client connections, no idle connection found

https://bugzilla.samba.org/show_bug.cgi?id=3204

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jul 29 23:31:14 CEST 2014 on sn-devel-104
2014-07-29 23:31:14 +02:00
Volker Lendecke
f5efddb9ae lib: directory_create_or_exist() does not use "uid" parameter
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-28 22:04:13 +02:00
Andrew Bartlett
faa4452df7 s3-winbind rename winbindd_update_rodc_dns to be for more generic irpc
Change-Id: I385ef8bd766848becc42e58694207dc94cd07a89
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-11 10:18:26 +02:00
Andrew Bartlett
f4ab082d2b librpc/idl: Merge wbint.idl with winbind.idl so we can forward IRPC requests to internal winbind calls
Change-Id: Iba3913d5a1c7f851b93f37e9beb6dbb20fbf7e55
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-11 10:18:26 +02:00
Andrew Bartlett
223fbdaf38 s3-winbindd: Listen on IRPC and do forwarded DNS updates on an RODC
Change-Id: Ib87933c318f510d95f7008e122216d73803ede68
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-11 10:18:26 +02:00
Andrew Bartlett
cb79cc342e s3-winbindd: Register winbindd with irpc
Change-Id: Ie3c7109fef6982d95e8cad06870334565352e329
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-06-11 10:18:26 +02:00
Andrew Bartlett
77b04f1df6 winbind: Allow winbindd to be run from inside "samba"
Change-Id: I6b90a9b62ba5821e0feedb23cd20642078ba0ca6
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Apr 29 05:28:39 CEST 2014 on sn-devel-104
2014-04-29 05:28:39 +02:00
Jeremy Allison
eaa45a5780 s3: winbindd: Call dgram cleanup init background setup.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-04-23 22:33:09 +02:00
Alexander Bokovoy
7496954a94 winbindd: use exit_daemon() to pass startup status to systemd
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10517

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-04-23 02:29:08 +02:00
Alexander Bokovoy
aa8c8a7b5b add systemd integration
Add --with-systemd / --without-systemd options to check whether
libsystemd-daemon library is available and use it to report service
startup status to systemd for smbd/winbindd/nmbd and AD DC.

The problem it solves is correct reporting of the Samba services
at the point when they are ready to serve clients, important for
high availability software integration.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10517

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-04-23 02:29:08 +02:00
Stefan Metzmacher
c3699d1c44 s3:winbindd: avoid argv related const warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:43 +02:00
Andrew Bartlett
0c7ed5a8ab param: No longer have a special case for lp_configfile
This parameter is renamed because it does not normally return the current smb.conf file, but
instead returns the next one, as found in a config file = directive, to be loaded.

This avoids a conflict with the lpcfg_configfile from lib/param, which does refer to the
current smb.conf path.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-02-12 13:17:13 +13:00
Garming Sam
ca20ddbe91 param: rename lp function and variable from 'piddir' to 'pid_directory'
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:11 -08:00
Garming Sam
63c24977ba param: rename lp function and variable from 'lockdir' to 'lock_directory'
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:10 -08:00
Stefan Metzmacher
07126b6fb2 s3:winbindd: call rpccli_pre_open_netlogon_creds() in the parent
This opens the CLEAR_IF_FIRST tdb in the long living parent.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-01-07 12:47:08 +01:00
Michael Adam
5eae612c72 s3:winbindd: use cluster_probe_ok()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-17 23:22:50 +02:00
Volker Lendecke
fbee5795ab smbd/winbindd: Do an early check if ctdbd is functional
This will avoid panic calls when smbd and winbind is started in cluster
mode before ctdb is functional. It still logs something sane at debug
level 0, but it does not panic and core anymore.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-17 23:20:45 +02:00
Andrew Bartlett
e512491552 s3-winbindd: Remove undocumented winbindd:socket dir parameter
This uses the documeted "winbindd socket directory" parameter instead.

This came about due to the merge of the two smb.conf tables in s3 and
s4 for the Samba 4.0 release.  The s4 code used a real parameter,
which caused this to be documented, whereas no automatic procedure
existed to notice the parametric option and the need to document that.
The fact that this was not used consistently in both codebases is one
of the many areas of technical debt we still need to pay off here.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-10-15 10:58:45 +13:00
Andreas Schneider
fc59416220 s3-winbind: Register handlers for domain online/offline messages.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10194

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-11 11:50:08 +02:00
Jeremy Allison
59462f2e01 winbindd and nmbd don't set their umask to zero on startup like smbd does.
Fix this - we already control tightly what permissions are
on the files we create. Ensure we don't get surprised.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Jun 27 02:02:24 CEST 2013 on sn-devel-104
2013-06-27 02:02:24 +02:00
Jeremy Allison
d4091c5809 Fix bug #9166 - Starting smbd or nmbd with stdin from /dev/null results in "EOF on stdin"
Only install the stdin handler if it's a pipe or fifo.

Signed-off-by: Jeremy Allison <jra@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-06-20 13:41:01 +02:00
Stefan Metzmacher
450ebe97d1 s3:winbindd: avoid usage of procid_self()
metze

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-18 13:15:10 +02:00
Stefan Metzmacher
5a2aaafee7 s3:winbindd: make use of samba_tevent_context_init()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:49 +01:00
Volker Lendecke
3e830e44d3 winbind: Use standard tevent_context_init
This makes winbind use epoll instead of poll

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-18 09:16:58 -08:00
Andreas Schneider
a3bbf1bf34 s3-winbind: Check if we created the directories correctly.
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-21 13:55:59 +01:00
Volker Lendecke
a44e58a31e s3: Fix a typo in a debug message
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Dec 12 16:40:23 CET 2012 on sn-devel-104
2012-12-12 16:40:23 +01:00
Volker Lendecke
96356219d6 s3: Remove a call to procid_self()
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Oct 19 23:15:04 CEST 2012 on sn-devel-104
2012-10-19 23:15:04 +02:00
Volker Lendecke
d2069eb677 s3: Add "msg_ctx" param to winbindd_register_handlers() 2012-10-19 21:29:14 +02:00
Volker Lendecke
cf1d69ae0b s3: Make winbindd_register_handlers static 2012-10-19 21:29:13 +02:00
Volker Lendecke
aad669b53e s3: Fix some blank line endings
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Sep 27 07:57:03 CEST 2012 on sn-devel-104
2012-09-27 07:57:03 +02:00
Andrew Bartlett
8c71dc3505 param: Add startup checks for valid server role/binary combinations
This should eliminate confusion from our users about what they can
expect to successfully run.

Andrew Bartlett
2012-08-23 15:02:26 +02:00
Herb Lewis
21e67bdcee Fix bug #9104 - winbindd can mis-identify idle clients - can cause crashes and NDR parsing errors.
A connection is idle when both struct winbindd_cli_state->request AND
struct winbindd_cli_state->response are NULL. Otherwise we can flag
as idle a connection in the state of having sent the request to
the winbindd child (request != NULL) but not yet received a reply
(response == NULL).

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Aug 21 01:31:46 CEST 2012 on sn-devel-104
2012-08-21 01:31:46 +02:00
Jeremy Allison
aaeb3f5d9b Ensure we update last_access on the winbindd child struct on each request. 2012-08-13 10:35:41 -07:00
Jeremy Allison
e8dbf2889f Move everything to use the common pidfile functions.
The extra code in source3/lib/pidfile.c is no longer needed.
2012-07-19 16:36:18 -07:00
Jeremy Allison
0d24370c76 Make the s3 pidfile use the common code inside lib/util/pidfile.c 2012-07-19 16:08:49 -07:00
Jeremy Allison
2922fdaaf0 Move source4/smbd/pidfile into lib/util in preparation for making it in common. 2012-07-19 15:41:52 -07: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
Matthieu Patou
17d5fbde43 s3-winbindd: add comments about dump_core_setup
This patch is related to change 0ea7152ff4
Comments are added to explain why we call dump_core_setup 3 times.

Autobuild-User(master): Matthieu Patou <mat@samba.org>
Autobuild-Date(master): Mon Jun 11 21:21:11 CEST 2012 on sn-devel-104
2012-06-11 21:21:11 +02:00
Matthieu Patou
0ea7152ff4 s3-winbindd: call dump_core_setup after command line option has been parsed
Without this fix in some situations winbindd can't coredump.
Such cases append when samba is compiled in a custom prefix (ie.
/home/build/mat/prod/1/) in this case get_dyn_LOGFILEBASE or basename(lp_logfile)
before the configuration file and the command line is parsed will be something like /home/build/mat/prod/1/var
which might not exists on the host where you run it (where it's most
probably more "normal" directories).
Specifying --log-basename didn't help as dump_core_setup is called before the command line and
the config file is read so it didn't help getting a correct value in dump_core_setup.
We fix this issue by calling dump_core_setup() also after the command
line has been read and also after the configfile has been parsed so that
the final location for the coredump is coherent with the final logile
location.

Autobuild-User(master): Matthieu Patou <mat@samba.org>
Autobuild-Date(master): Fri Jun  8 06:33:33 CEST 2012 on sn-devel-104
2012-06-08 06:33:33 +02:00
Jeremy Allison
8fd02fa2d6 Forward port of Richard Sharpe's <realrichardsharpe@gmail.com> fix for bug #8970 - Possible memory leaks in the samba master process. 2012-05-31 16:08:44 -07:00
Andreas Schneider
78af4738e7 s3-auth: Rename to init_system_session_info().
Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Tue May 15 13:56:00 CEST 2012 on sn-devel-104
2012-05-15 13:56:00 +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
Michael Adam
c80f70390c s3:smbd: let smbd/nmbd/winbindd child processes terminate if the parent process died.
This applies to all child processes making use of reinit_after_fork().
It is implemented by establishing a pipe between parent and child.
The child watches for EOF on the read end of the pipe, indidcating
an exited parent.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-03-15 18:41:37 +01:00
Ira Cooper
0c3474b45e s3: piddir creation fix part 2.
Since the piddir got moved from the lockdir by default, the default piddir
wasn't getting created, stopping some configurations from running.

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-03-07 11:01:57 -08:00
Andrew Bartlett
769cee44a2 s3-winbindd: Add stdin handler for winbind
This will help avoid runaway processes in the test env, particularly when
the whole selftest.pl is killed.

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
Andreas Schneider
b8c3bfa55b s3-lib: If we create a pipe socket, don't start to listen.
The create_pipe_sock() function should only create the socket as the
name states and not start to listen on it too. We should start to listen
on in the individual places as we need different backlog values.

Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Mon Aug 29 13:21:43 CEST 2011 on sn-devel-104
2011-08-29 13:21:43 +02:00
Simo Sorce
b706fd37f6 s3-messaging: Fix messaging classes.
This has been broken since ff0ac5b0 (May 2007).
Basically all messages were belonging to the General class except for CTDB
messages.
This fixed the message_send_all() function to correctly compute the class, and
fixes registrations to include all they need to cope with the fact not all
messages are of calss general (registrations rotted a bit because as long as
FLAG_MSG_GENERAL was defined the process woould receive all messages).

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-11 14:58:01 +02:00
Michael Adam
a6fe4d20f1 s3:winbindd: use lp_load_global() - winbindd does not need shares or IPC$ 2011-07-28 11:17:42 +02:00