diff options
author | Andrew Bartlett <abartlet@samba.org> | 2006-01-31 00:48:57 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2006-01-31 00:48:57 +0000 |
commit | f28390d27054c74234324a7f4d054588b6b63801 (patch) | |
tree | a38887ee901779a87904fd978194ebcccbb6ee8b /source/winbind | |
parent | 5ef6dc429f48b495169e33b69b3f1a691593a845 (diff) | |
download | samba-f28390d27054c74234324a7f4d054588b6b63801.tar.gz samba-f28390d27054c74234324a7f4d054588b6b63801.tar.xz samba-f28390d27054c74234324a7f4d054588b6b63801.zip |
r13244: Allow control of the location of the Samba3-compatible winbindd pipe
in Samba4. This allows us to start winbindd by default, including in
'make test'.
This is via a new 'winbindd socket directory' parameter for utilities
linked against loadparm, as well as a --with-winbindd-socket-dir
option to configure (setting the default and the value for simple
clients).
I hope to add basic winbindd tests, to ensure continued correct
operation, but at least now I don't have to manually change my 'server
services' line.
The other problem with the hard-coded /tmp/.winbind is that RedHat has
moved this in Fedora (to /var/run I think). For this reason, this
functionality should probably be ported to Samba3 as well.
The default for Samba4 is PREFIX/var/run/winbind_pipe.
I have also re-added the paranoia checks from Samba3 for correct
permissions on the socket directory.
Andrew Bartlett
Diffstat (limited to 'source/winbind')
-rw-r--r-- | source/winbind/wb_server.c | 12 | ||||
-rw-r--r-- | source/winbind/wb_server.h | 7 |
2 files changed, 10 insertions, 9 deletions
diff --git a/source/winbind/wb_server.c b/source/winbind/wb_server.c index a08b0803342..9c045585832 100644 --- a/source/winbind/wb_server.c +++ b/source/winbind/wb_server.c @@ -123,9 +123,11 @@ static void winbind_task_init(struct task_server *task) return; } - /* Make sure the directory for NCALRPC exists */ - if (!directory_exist(WINBINDD_DIR)) { - mkdir(WINBINDD_DIR, 0755); + /* Make sure the directory for the Samba3 socket exists, and is of the correct permissions */ + if (!directory_create_or_exist(lp_winbindd_socket_directory(), geteuid(), 0755)) { + task_server_terminate(task, + "Cannot create winbindd pipe directory"); + return; } service = talloc_zero(task, struct wbsrv_service); @@ -143,7 +145,9 @@ static void winbind_task_init(struct task_server *task) /* setup the unprivileged samba3 socket */ listen_socket = talloc(service, struct wbsrv_listen_socket); if (!listen_socket) goto nomem; - listen_socket->socket_path = WINBINDD_SAMBA3_SOCKET; + listen_socket->socket_path = talloc_asprintf(listen_socket, "%s/%s", + lp_winbindd_socket_directory(), + WINBINDD_SAMBA3_SOCKET); if (!listen_socket->socket_path) goto nomem; listen_socket->service = service; listen_socket->privileged = False; diff --git a/source/winbind/wb_server.h b/source/winbind/wb_server.h index 15fee0853ca..7906e52de69 100644 --- a/source/winbind/wb_server.h +++ b/source/winbind/wb_server.h @@ -22,12 +22,9 @@ #include "nsswitch/winbindd_nss.h" -#define WINBINDD_DIR "/tmp/.winbindd/" -#define WINBINDD_SOCKET WINBINDD_DIR"socket" -/* the privileged socket is in smbd_tmp_dir() */ -#define WINBINDD_PRIVILEGED_SOCKET "winbind_socket" -#define WINBINDD_SAMBA3_SOCKET WINBINDD_DIR"pipe" + +#define WINBINDD_SAMBA3_SOCKET "pipe" /* the privileged socket is in smbd_tmp_dir() */ #define WINBINDD_SAMBA3_PRIVILEGED_SOCKET "winbind_pipe" |