summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-05-17 19:34:32 +1000
committerStefan Metzmacher <metze@samba.org>2010-05-31 21:36:55 +0200
commit61eb56be4ea1f4eb26f63b985aeb52cdb1183328 (patch)
tree22df8a98d7a653c8a94e1d0aa19e3bf1e7556c61 /source3/winbindd/winbindd.c
parente5ebc52e9fd45346a74e2c421f2471b5e6cab998 (diff)
downloadsamba-61eb56be4ea1f4eb26f63b985aeb52cdb1183328.tar.gz
samba-61eb56be4ea1f4eb26f63b985aeb52cdb1183328.tar.bz2
samba-61eb56be4ea1f4eb26f63b985aeb52cdb1183328.zip
s3:winbind tidy up connecting the winbind sockets.
By putting this code inline in winbindd_setup_listeners() we remove 2 static variables and simplify the code. By putting the get_winbind_priv_pipe_dir() in the same file, we allow it to be reimplemented in s3compat. Andrew Bartlett Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/winbindd/winbindd.c')
-rw-r--r--source3/winbindd/winbindd.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index 5e041fb57b..c899360a61 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -938,6 +938,20 @@ static void winbindd_listen_fde_handler(struct tevent_context *ev,
new_connection(s->fd, s->privileged);
}
+/*
+ * Winbindd socket accessor functions
+ */
+
+const char *get_winbind_pipe_dir(void)
+{
+ return lp_parm_const_string(-1, "winbindd", "socket dir", WINBINDD_SOCKET_DIR);
+}
+
+char *get_winbind_priv_pipe_dir(void)
+{
+ return lock_path(WINBINDD_PRIV_SOCKET_SUBDIR);
+}
+
static bool winbindd_setup_listeners(void)
{
struct winbindd_listen_state *pub_state = NULL;
@@ -951,7 +965,8 @@ static bool winbindd_setup_listeners(void)
}
pub_state->privileged = false;
- pub_state->fd = open_winbindd_socket();
+ pub_state->fd = create_pipe_sock(
+ get_winbind_pipe_dir(), WINBINDD_SOCKET_NAME, 0755);
if (pub_state->fd == -1) {
goto failed;
}
@@ -972,7 +987,8 @@ static bool winbindd_setup_listeners(void)
}
priv_state->privileged = true;
- priv_state->fd = open_winbindd_priv_socket();
+ priv_state->fd = create_pipe_sock(
+ get_winbind_priv_pipe_dir(), WINBINDD_SOCKET_NAME, 0750);
if (priv_state->fd == -1) {
goto failed;
}