summaryrefslogtreecommitdiffstats
path: root/source3/winbindd/winbindd_dual.c
Commit message (Collapse)AuthorAgeFilesLines
* s3-winbind: separate child response sock writeDavid Disseldorp2014-01-201-20/+27
| | | | | | | | | | For consistency with request read side. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Jan 20 14:23:10 CET 2014 on sn-devel-104
* s3-winbind: only pass needed args to child_read_requestDavid Disseldorp2014-01-201-18/+10
| | | | | | | | | | The socket and request are the only arguments required, the entire winbind child state structure is not needed. This allows for the separation of the request and response structures, which is useful for asynchronous conversion. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3:winbindd: make use of trust_pw_change() for periodic password changesStefan Metzmacher2014-01-071-8/+8
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:winbindd: use invalidate_cm_connection() to kill the netlogon connectionStefan Metzmacher2014-01-071-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3-winbindd: Fix DEBUG statement in winbind_msg_offline().Jan Brummer2013-12-091-1/+1
| | | | | | | | | | | | Guenther BUG: https://bugzilla.samba.org/show_bug.cgi?id=10285 Reviewed-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Mon Dec 9 17:28:37 CET 2013 on sn-devel-104
* s3-winbind: Register handlers for domain online/offline messages.Andreas Schneider2013-10-111-0/+5
| | | | | | | 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>
* winbindd: Avoid a fd leak when we can not forkVolker Lendecke2013-04-091-0/+2
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Jim McDonough <jmcd@samba.org> Autobuild-User(master): Jim McDonough <jmcd@samba.org> Autobuild-Date(master): Tue Apr 9 20:27:27 CEST 2013 on sn-devel-104
* winbind: Correctly use names in the domain struct.Andreas Schneider2013-03-051-7/+10
| | | | Reviewed-by: David Disseldorp <ddiss@samba.org>
* winbind: Use talloc for allocating domain, dns, forest and dc name.Andreas Schneider2013-03-051-2/+17
| | | | Reviewed-by: David Disseldorp <ddiss@samba.org>
* winbind: Correctly cast name to messaging_send_buf().Andreas Schneider2013-02-221-3/+3
| | | | Reviewed-by: Alexander Bokovoy <ab@samba.org>
* s3:winbindd: s/event_add_timed/tevent_add_timerStefan Metzmacher2013-02-191-4/+4
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:winbindd: s/struct timed_event/struct tevent_timerStefan Metzmacher2013-02-191-2/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:winbindd: s/struct event_context/struct tevent_contextStefan Metzmacher2013-02-191-2/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* winbind: Handle child requests in a tevent_fdVolker Lendecke2013-01-181-105/+65
| | | | | | | This enables the use of standard tevent_loop_once in the child, which now also uses epoll where available. Reviewed by: Jeremy Allison <jra@samba.org>
* winbind: Introduce "struct child_handler_state"Volker Lendecke2013-01-181-22/+30
| | | | | | | | This will make the next patch simpler. child_handler_state contains the information that the handler for the parent fde needs to pass to process_child_request Reviewed by: Jeremy Allison <jra@samba.org>
* lib/param: Move all enum declarations to lib/paramAndrew Bartlett2012-07-241-0/+1
| | | | | | | | This is in preperation for the parameter table being made common. Andrew Bartlett Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>
* loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.Rusty Russell2012-07-181-2/+2
| | | | | | | | | | 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>
* lib/util: Remove obsolete sys_getpid() and sys_fork().Jelmer Vernooij2012-03-241-3/+3
| | | | | | | | | 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
* lib/util: Remove sys_poll as it is no longer neededAndrew Bartlett2012-02-161-1/+1
| | | | | | | | | | | sys_poll() is only needed if the signal pipe is set up and used, but as no signal handler ever writes to the pipe, this can all be removed. signal based events are now handled via tevent. Andrew Bartlett Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Remove a bunch of calls to procid_self()Volker Lendecke2011-12-121-1/+0
| | | | All callers to messaging_[re]init only used procid_self()
* s3: Fix a winbind race leading to 100% CPUVolker Lendecke2011-08-261-2/+3
| | | | | | | | | | | | | | | | | | | | | | | This fixes a race condition that leads to the winbindd_children list becoming corrupted. It happens when on a busy winbind SIGCHLD is a bit late. Imagine a winbind with multiple requests in the queue for a single child. Child dies, and before the SIGCHLD handler is called we find the socket to be dead. wb_child_request_done is called, receiving an error from wb_simple_trans_recv. It closes the socket. Then immediately the wb_child_request_trigger will do another fork_domain_child before the signal handler is called. This means that we do another fork_domain_child, we have child->sock==-1 at this point. fork_domain_child will do a DLIST_ADD(winbindd_children, child) a second time where the child is already part of that list. This corrupts the list. Then the signal handler kicks in, spinning in for (child = winbindd_children; child != NULL; child = child->next) { forever. Not good. This patch makes sure that both conditions (sock==-1 and not part of the list) for a winbindd_child struct match up. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Fri Aug 26 18:51:24 CEST 2011 on sn-devel-104
* s3: Use sys_write in fork_domain_childVolker Lendecke2011-08-261-1/+1
| | | | | | | Counterpart for last checkin. A lot less likely, but not impossible in a child. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Fri Aug 26 13:14:27 CEST 2011 on sn-devel-104
* s3: Use sys_read in fork_domain_childVolker Lendecke2011-08-261-1/+1
| | | | | | | | | I've seen [2011/08/26 01:44:10.872057, 1] winbindd/winbindd_dual.c:1336(fork_domain_child) fork_domain_child: Could not read child status: nread=-1, error=Interrupted system call on a customer box. Not good.
* Use tevent_req_oomVolker Lendecke2011-06-201-1/+1
| | | | This fixes a few Coverity errors
* s3-talloc Change TALLOC_ZERO_P() to talloc_zero()Andrew Bartlett2011-06-091-1/+1
| | | | | Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_P isn't standard talloc.
* More simple const fixups.Jeremy Allison2011-05-051-2/+2
|
* s3: Properly deal with exited winbind childrenVolker Lendecke2011-05-041-0/+5
| | | | | | | | | | | | When a winbind child exits, we need to immediately close the socket. If not, the next request to that child will be sent to a socket without a listener, leading to a failed request. This failed request will then trigger a proper re-init. This patch avoids the one failed request. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Wed May 4 13:32:16 CEST 2011 on sn-devel-104
* s3: remove various references to server side dcerpc structs (which are not ↵Günther Deschner2011-05-021-1/+0
| | | | | | needed). Guenther
* s3: Avoid a potential 100% CPU loop in winbinddVolker Lendecke2011-04-291-0/+27
| | | | | | | | | | | | | | | | | | | | | In the clustering case if ctdb is unhappy, winbindd_reinit_after_fork fails. This can lead to an endless loop depending on the scheduling of the parent vs child. Parent forks, child is immediately scheduled and exits. Parent gets SIGCHLD, parent is then scheduled before it sends the request out to the child. Parent tries to fork again immediately. The code before this patch did not really take into account that reinit_after_fork can fail. The code now sends the result of winbindd_reinit_after_fork to the parent and the parent only considers the child alive when it got NT_STATUS_OK. This was seen in 3.4 winbind. winbind has changed significantly since then, so it might be possible that this does not happen anymore in exactly this way. But passing up the status of reinit_after_fork and only consider the child alive when that's ok is the correct thing to do anyway. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Fri Apr 29 17:58:19 CEST 2011 on sn-devel-104
* s3: Make winbindd_reinit_after_fork return NTSTATUSVolker Lendecke2011-04-291-8/+11
|
* s3: In winbind, close parent/child socketsVolker Lendecke2011-04-291-2/+11
| | | | This should further reduce fd load in winbind children
* s3-tevent: only include ../lib/util/tevent wrappers where needed.Günther Deschner2011-04-291-0/+1
| | | | | | | Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Fri Apr 29 14:00:30 CEST 2011 on sn-devel-104
* s3-includes: only include ntdomain.h where needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3-messages: make ndr_messaging.h part of messages.h.Günther Deschner2011-03-301-1/+0
| | | | Guenther
* s3-messages: only include messages.h where needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3: Fix Coverity ID 1048, CHECKED_RETURNVolker Lendecke2011-03-211-6/+1
| | | | | | | This is a real bug: tevent_req_set_endtime already calls tevent_req_nomem. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Mon Mar 21 16:29:22 CET 2011 on sn-devel-104
* s3: Use poll in winbindVolker Lendecke2011-02-281-22/+29
|
* nsswitch: make wb_reqtrans a common subsystem.Günther Deschner2011-02-171-1/+1
| | | | Guenther
* s3: Fix a typoVolker Lendecke2011-02-021-1/+1
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Wed Feb 2 18:10:45 CET 2011 on sn-devel-104
* Revert "s3:events: Call all ready fd event handlers on each iteration of the ↵Stefan Metzmacher2011-01-311-3/+3
| | | | | | | | | | main loop" This reverts commit 455fccf86b6544cd17a2571c63a88f8aebff3f74. I'll add a more generic fix for this problem. metze
* s3:winbind: Fork multiple children per domainVolker Lendecke2011-01-211-5/+45
| | | | | | | | | | | | This makes us scale better with many simultaneous winbind requests, some of which might be slow. This implementation breaks offline logons, as the cached credentials are maintained in a child (this needs fixing). So, if the offline logons are active, only allow one DC connection. Probably the offline logon and the scalable file server cases are separate enough so that this patch is useful even with the restriction.
* All calls to event_add_to_select_args() call GetTimeOfDay() andJeremy Allison2010-12-231-4/+1
| | | | | | | | | | | pass this in as the &now parameter. Push this call inside of event_add_to_select_args() to the correct point so it doesn't get called unless needed. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Dec 23 01:08:11 CET 2010 on sn-devel-104
* wb_reqtrans is not used in libwbclientVolker Lendecke2010-12-191-1/+1
|
* libwbclient: Put the wb_reqtrans definitions into wb_reqtrans.hVolker Lendecke2010-12-191-1/+1
|
* s3: Fix bug 7844: Race in winbindVolker Lendecke2010-12-061-4/+8
| | | | | | | | | | | | | | | | If a child dies, the parent process right away closes the socket. This is wrong, with tevent we still have events pending. This works fine for epoll but does not for at least the FreeBSD select variant. Tevent sticks a closed socket into the select masks. This then returns an error EBADF. When this happens, the parent winbind dies instead of forking a new child. This moves the socket close from the SIGCHLD cleanup function to the socket receiver. I could not reproduce the parent death anymore and it did not create an obvious fd leak. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Mon Dec 6 23:21:02 CET 2010 on sn-devel-104
* "bool ? true : false" is a bit pointlessVolker Lendecke2010-11-171-2/+1
|
* libcli/security Provide a common, top level libcli/security/security.hAndrew Bartlett2010-10-121-0/+1
| | | | | | | | | | | | | | This will reduce the noise from merges of the rest of the libcli/security code, without this commit changing what code is actually used. This includes (along with other security headers) dom_sid.h and security_token.h Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Tue Oct 12 05:54:10 UTC 2010 on sn-devel-104
* s3:events: Call all ready fd event handlers on each iteration of the main loopSteven Danneman2010-10-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, only one fd handler was being called per main message loop in all smbd child processes. In the case where multiple fds are available for reading the fd corresponding to the event closest to the beginning of the event list would be run. Obviously this is arbitrary and could cause unfairness. Usually, the first event fd is the network socket, meaning heavy load of client requests can starve out other fd events such as oplock or notify upcalls from the kernel. In this patch, I have changed the behavior of run_events() to unset any fd that it has already called a handler function, as well as decrement the number of fds that were returned from select(). This allows the caller of run_events() to iterate it, until all available fds have been handled. I then changed the main loop in smbd child processes to iterate run_events(). This way, all available fds are handled on each wake of select, while still checking for timed or signalled events between each handler function call. I also added an explicit check for EINTR from select(), which previously was masked by the fact that run_events() would handle any signal event before the return code was checked. This required a signature change to run_events() but all other callers should have no change in their behavior. I also fixed a bug in run_events() where it could be called with a selrtn value of -1, doing unecessary looping through the fd_event list when no fds were available. Also, remove the temporary echo handler hack, as all fds should be treated fairly now.
* samba: share select wrappers.Günther Deschner2010-10-011-0/+1
| | | | Guenther
* s3: Add "smbcontrol winbindd ip-dropped <local-ip>"Volker Lendecke2010-09-301-0/+22
| | | | | | | | This is supposed to improve the winbind reconnect time after an ip address has been moved away from a box. Any kind of HA scenario will benefit from this, because winbindd does not have to wait for the TCP timeout to kick in when a local IP address has been dropped and DC replies are not received anymore.