summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd.c
diff options
context:
space:
mode:
authorJames Peach <jpeach@samba.org>2007-04-24 18:19:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:19:40 -0500
commit3dff331a1d50f2e83e2fd87ee6b1df3106d5cda7 (patch)
tree20f317c0115919755a2de1929d630735361bf560 /source3/nsswitch/winbindd.c
parentf4affb4382d4895589d0eceda765ae5bdc1df855 (diff)
downloadsamba-3dff331a1d50f2e83e2fd87ee6b1df3106d5cda7.tar.gz
samba-3dff331a1d50f2e83e2fd87ee6b1df3106d5cda7.tar.bz2
samba-3dff331a1d50f2e83e2fd87ee6b1df3106d5cda7.zip
r22507: Wrap the method of obtaining sockets to listen on.
(This used to be commit e027322b769b896184484155fef7c2ba247412a4)
Diffstat (limited to 'source3/nsswitch/winbindd.c')
-rw-r--r--source3/nsswitch/winbindd.c48
1 files changed, 1 insertions, 47 deletions
diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c
index 0dade53521..ed4a23681b 100644
--- a/source3/nsswitch/winbindd.c
+++ b/source3/nsswitch/winbindd.c
@@ -26,7 +26,6 @@
#include "includes.h"
#include "winbindd.h"
-#include "smb_launchd.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
@@ -34,7 +33,6 @@
BOOL opt_nocache = False;
extern BOOL override_logfile;
-static BOOL unlink_winbindd_socket = True;
struct event_context *winbind_event_context(void)
{
@@ -121,15 +119,8 @@ static void flush_caches(void)
static void terminate(void)
{
- pstring path;
-
- /* Remove socket file */
- if (unlink_winbindd_socket) {
- pstr_sprintf(path, "%s/%s",
- WINBINDD_SOCKET_DIR, WINBINDD_SOCKET_NAME);
- unlink(path);
- }
+ winbindd_release_sockets();
idmap_close();
trustdom_cache_shutdown();
@@ -719,43 +710,6 @@ static BOOL remove_idle_client(void)
return False;
}
-static BOOL winbindd_init_sockets(int *public_sock, int *priv_sock,
- int *idle_timeout_sec)
-{
- struct smb_launch_info linfo;
-
- if (smb_launchd_checkin_names(&linfo, "WinbindPublicPipe",
- "WinbindPrivilegedPipe", NULL)) {
- if (linfo.num_sockets != 2) {
- DEBUG(0, ("invalid launchd configuration, "
- "expected 2 sockets but got %d\n",
- linfo.num_sockets));
- return False;
- }
-
- *public_sock = linfo.socket_list[0];
- *priv_sock = linfo.socket_list[1];
- *idle_timeout_sec = linfo.idle_timeout_secs;
-
- unlink_winbindd_socket = False;
-
- smb_launchd_checkout(&linfo);
- return True;
- } else {
- *public_sock = open_winbindd_socket();
- *priv_sock = open_winbindd_priv_socket();
- *idle_timeout_sec = -1;
-
- if (*public_sock == -1 || *priv_sock == -1) {
- DEBUG(0, ("failed to open winbindd pipes: %s\n",
- errno ? strerror(errno) : "unknown error"));
- return False;
- }
-
- return True;
- }
-}
-
/* Process incoming clients on listen_sock. We use a tricky non-blocking,
non-forking, non-threaded model which allows us to handle many
simultaneous connections while remaining impervious to many denial of