winbind: Allow winbindd to be run from inside "samba"
[obnox/samba/samba-obnox.git] / source3 / winbindd / winbindd.c
index e384be18c1c6632b8ba667a044c285ff0b2039cc..a1647c947fab0c4d396e4e9afc2a54965e10bfc2 100644 (file)
@@ -1460,7 +1460,8 @@ int main(int argc, const char **argv)
         */
        dump_core_setup("winbindd", lp_logfile(talloc_tos()));
 
-       if (lp_server_role() == ROLE_ACTIVE_DIRECTORY_DC) {
+       if (lp_server_role() == ROLE_ACTIVE_DIRECTORY_DC
+           && !lp_parm_bool(-1, "server role check", "inhibit", false)) {
                DEBUG(0, ("server role = 'active directory domain controller' not compatible with running the winbindd binary. \n"));
                DEBUGADD(0, ("You should start 'samba' instead, and it will control starting the internal AD DC winbindd implementation, which is not the same as this one\n"));
                exit(1);
@@ -1566,6 +1567,10 @@ int main(int argc, const char **argv)
 
        winbindd_register_handlers(winbind_messaging_context(), !Fork);
 
+       if (!messaging_parent_dgm_cleanup_init(winbind_messaging_context())) {
+               exit(1);
+       }
+
        status = init_system_session_info();
        if (!NT_STATUS_IS_OK(status)) {
                exit_daemon("Winbindd failed to setup system user info", map_errno_from_nt_status(status));