#include "rpc_client/cli_netlogon.h"
#include "idmap.h"
#include "lib/addrchange.h"
-#include "serverid.h"
#include "auth.h"
#include "messages.h"
#include "../lib/util/pidfile.h"
#endif
if (is_parent) {
- struct messaging_context *msg = server_messaging_context();
- struct server_id self = messaging_server_id(msg);
- serverid_deregister(self);
pidfile_unlink(lp_pid_directory(), "winbindd");
}
void *siginfo,
void *private_data)
{
- bool *is_parent = talloc_get_type_abort(private_data, bool);
+ bool *p = talloc_get_type_abort(private_data, bool);
+ bool is_parent = *p;
+
+ TALLOC_FREE(p);
DEBUG(0,("Got sig[%d] terminate (is_parent=%d)\n",
- signum, (int)*is_parent));
- terminate(*is_parent);
+ signum, is_parent));
+ terminate(is_parent);
}
/*
/* install default SIGCHLD handler: validation code uses fork/waitpid */
CatchSignal(SIGCHLD, SIG_DFL);
+ setproctitle("validate cache child");
+
ret = (uint8_t)winbindd_validate_cache_nobackup();
DEBUG(10, ("winbindd_msg_validata_cache: got return value %d\n", ret));
messaging_send_buf(msg_ctx, server_id, MSG_WINBIND_VALIDATE_CACHE, &ret,
}
return;
}
+ smb_set_close_on_exec(sock);
DEBUG(6,("accepted socket %d\n", sock));
static void winbindd_register_handlers(struct messaging_context *msg_ctx,
bool foreground)
{
+ bool scan_trusts = true;
NTSTATUS status;
/* Setup signal handlers */
exit(1);
}
- /* get broadcast messages */
-
- if (!serverid_register(messaging_server_id(msg_ctx),
- FLAG_MSG_GENERAL |
- FLAG_MSG_WINBIND |
- FLAG_MSG_DBWRAP)) {
- DEBUG(1, ("Could not register myself in serverid.tdb\n"));
- exit(1);
- }
-
/* React on 'smbcontrol winbindd reload-config' in the same way
as to SIGHUP signal */
messaging_register(msg_ctx, NULL,
smb_nscd_flush_user_cache();
smb_nscd_flush_group_cache();
- if (lp_allow_trusted_domains()) {
+ if (!lp_winbind_scan_trusted_domains()) {
+ scan_trusts = false;
+ }
+
+ if (!lp_allow_trusted_domains()) {
+ scan_trusts = false;
+ }
+
+ if (IS_DC) {
+ scan_trusts = false;
+ }
+
+ if (scan_trusts) {
if (tevent_add_timer(server_event_context(), NULL, timeval_zero(),
rescan_trusted_domains, NULL) == NULL) {
DEBUG(0, ("Could not trigger rescan_trusted_domains()\n"));
NTSTATUS status;
bool ok;
+ setproctitle_init(argc, discard_const(argv), environ);
+
/*
* Do this before any other talloc operation
*/
daemon_ready("winbindd");
}
+ gpupdate_init();
+
/* Loop waiting for requests */
while (1) {
frame = talloc_stackframe();