#include "s3compat_wrapper.h"
#include "source3/winbindd/winbindd.h"
-/* Unlike the smbd init functions, this is only run in the winbindd child, because it calls winbind_off() */
+/* Unlike the smbd init functions, this is only run in the winbindd
+ * child, because it calls winbind_off() - and we don't want that in a
+ * process that runs any of the smbd code */
_PUBLIC_ void s3compat_initialise_winbindd(const char *config_file)
{
talloc_stackframe();
- /* glibc (?) likes to print "User defined signal 1" and exit if a
- SIGUSR[12] is received before a handler is installed */
-
- CatchSignal(SIGUSR1, SIG_IGN);
- CatchSignal(SIGUSR2, SIG_IGN);
-
set_remote_machine_name("winbindd", False);
/* Set environment variable so we don't recursively call ourselves.
mkdir(lp_lockdir(), 0755);
}
- /* Unblock all signals we are interested in as they may have been
- blocked by the parent process. */
-
- BlockSignals(False, SIGINT);
- BlockSignals(False, SIGQUIT);
- BlockSignals(False, SIGTERM);
- BlockSignals(False, SIGUSR1);
- BlockSignals(False, SIGUSR2);
- BlockSignals(False, SIGHUP);
- BlockSignals(False, SIGCHLD);
-
- /* Don't use winbindd_reinit_after_fork here as
- * we're just starting up and haven't created any
- * winbindd-specific resources we must free yet. JRA.
- */
-
- if (!NT_STATUS_IS_OK(reinit_after_fork(winbind_messaging_context(),
- winbind_event_context(),
- false))) {
- DEBUG(0,("reinit_after_fork() failed\n"));
- exit(1);
- }
-
winbindd_register_handlers();
DEBUG(0,("s3compat_winbindd: initialised samba3 version: %s\n",
samba_version_string()));
}
+/* Call into the source3/winbindd per-client code here, as we have
+ * already bound to the sockets and accepted the connection at this
+ * point */
_PUBLIC_ void s3compat_winbindd_accepted_new_connection(int accepted_sock, bool privileged)
{
winbindd_accepted_new_connection(accepted_sock, privileged);