Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/winbindd/winbindd.c

    r597 r740  
    2424
    2525#include "includes.h"
     26#include "popt_common.h"
    2627#include "winbindd.h"
    27 #include "../../nsswitch/libwbclient/wbc_async.h"
     28#include "nsswitch/winbind_client.h"
     29#include "nsswitch/wb_reqtrans.h"
     30#include "ntdomain.h"
     31#include "../librpc/gen_ndr/srv_lsa.h"
     32#include "../librpc/gen_ndr/srv_samr.h"
     33#include "secrets.h"
     34#include "idmap.h"
     35#include "lib/addrchange.h"
     36#include "serverid.h"
     37#include "auth.h"
     38#include "messages.h"
    2839
    2940#undef DBGC_CLASS
    3041#define DBGC_CLASS DBGC_WINBIND
    3142
     43static bool client_is_idle(struct winbindd_cli_state *state);
    3244static void remove_client(struct winbindd_cli_state *state);
    3345
     
    3749extern bool override_logfile;
    3850
    39 struct event_context *winbind_event_context(void)
    40 {
    41         static struct event_context *ctx;
    42 
    43         if (!ctx && !(ctx = event_context_init(NULL))) {
    44                 smb_panic("Could not init winbind event context");
    45         }
    46         return ctx;
    47 }
    48 
    4951struct messaging_context *winbind_messaging_context(void)
    5052{
    51         static struct messaging_context *ctx;
    52 
    53         if (ctx == NULL) {
    54                 ctx = messaging_init(NULL, server_id_self(),
    55                                      winbind_event_context());
    56         }
    57         if (ctx == NULL) {
    58                 DEBUG(0, ("Could not init winbind messaging context.\n"));
    59         }
    60         return ctx;
     53        struct messaging_context *msg_ctx = server_messaging_context();
     54        if (likely(msg_ctx != NULL)) {
     55                return msg_ctx;
     56        }
     57        smb_panic("Could not init winbindd's messaging context.\n");
     58        return NULL;
    6159}
    6260
     
    113111                DEBUG(2, ("\tclient list:\n"));
    114112                for(tmp = winbindd_client_list(); tmp; tmp = tmp->next) {
    115                         DEBUGADD(2, ("\t\tpid %lu, sock %d\n",
    116                                   (unsigned long)tmp->pid, tmp->sock));
    117                 }
    118         }
    119 }
    120 
    121 /* Print winbindd status to log file */
    122 
    123 static void print_winbindd_status(void)
    124 {
    125         winbindd_status();
     113                        DEBUGADD(2, ("\t\tpid %lu, sock %d (%s)\n",
     114                                     (unsigned long)tmp->pid, tmp->sock,
     115                                     client_is_idle(tmp) ? "idle" : "active"));
     116                }
     117        }
    126118}
    127119
     
    135127
    136128        if (!wcache_invalidate_cache()) {
     129                DEBUG(0, ("invalidating the cache failed; revalidate the cache\n"));
     130                if (!winbindd_cache_validate_and_initialize()) {
     131                        exit(1);
     132                }
     133        }
     134}
     135
     136static void flush_caches_noinit(void)
     137{
     138        /*
     139         * We need to invalidate cached user list entries on a SIGHUP
     140         * otherwise cached access denied errors due to restrict anonymous
     141         * hang around until the sequence number changes.
     142         * NB
     143         * Skip uninitialized domains when flush cache.
     144         * If domain is not initialized, it means it is never
     145         * used or never become online. look, wcache_invalidate_cache()
     146         * -> get_cache() -> init_dc_connection(). It causes a lot of traffic
     147         * for unused domains and large traffic for primay domain's DC if there
     148         * are many domains..
     149         */
     150
     151        if (!wcache_invalidate_cache_noinit()) {
    137152                DEBUG(0, ("invalidating the cache failed; revalidate the cache\n"));
    138153                if (!winbindd_cache_validate_and_initialize()) {
     
    177192
    178193        if (is_parent) {
     194                serverid_deregister(procid_self());
    179195                pidfile_unlink();
    180196        }
     
    255271
    256272        DEBUG(1,("Reloading services after SIGHUP\n"));
    257         flush_caches();
     273        flush_caches_noinit();
    258274        reload_services_file(file);
    259275}
     
    321337                                      void *private_data)
    322338{
    323         print_winbindd_status();
     339        winbindd_status();
    324340}
    325341
     
    373389        uint8 ret;
    374390        pid_t child_pid;
     391        NTSTATUS status;
    375392
    376393        DEBUG(10, ("winbindd_msg_validate_cache: got validate-cache "
     
    399416        /* child */
    400417
    401         if (!winbindd_reinit_after_fork(NULL)) {
     418        status = winbindd_reinit_after_fork(NULL, NULL);
     419        if (!NT_STATUS_IS_OK(status)) {
     420                DEBUG(1, ("winbindd_reinit_after_fork failed: %s\n",
     421                          nt_errstr(status)));
    402422                _exit(0);
    403423        }
     
    419439} dispatch_table[] = {
    420440
    421         /* PAM auth functions */
    422 
    423         { WINBINDD_PAM_AUTH, winbindd_pam_auth, "PAM_AUTH" },
    424         { WINBINDD_PAM_AUTH_CRAP, winbindd_pam_auth_crap, "AUTH_CRAP" },
    425         { WINBINDD_PAM_CHAUTHTOK, winbindd_pam_chauthtok, "CHAUTHTOK" },
    426         { WINBINDD_PAM_LOGOFF, winbindd_pam_logoff, "PAM_LOGOFF" },
    427         { WINBINDD_PAM_CHNG_PSWD_AUTH_CRAP, winbindd_pam_chng_pswd_auth_crap, "CHNG_PSWD_AUTH_CRAP" },
    428 
    429441        /* Enumeration functions */
    430442
     
    439451        { WINBINDD_DOMAIN_NAME, winbindd_domain_name, "DOMAIN_NAME" },
    440452        { WINBINDD_DOMAIN_INFO, winbindd_domain_info, "DOMAIN_INFO" },
     453        { WINBINDD_DC_INFO, winbindd_dc_info, "DC_INFO" },
    441454        { WINBINDD_NETBIOS_NAME, winbindd_netbios_name, "NETBIOS_NAME" },
    442455        { WINBINDD_PRIV_PIPE_DIR, winbindd_priv_pipe_dir,
     
    473486        { WINBINDD_LOOKUPSID, "LOOKUPSID",
    474487          winbindd_lookupsid_send, winbindd_lookupsid_recv },
     488        { WINBINDD_LOOKUPSIDS, "LOOKUPSIDS",
     489          winbindd_lookupsids_send, winbindd_lookupsids_recv },
    475490        { WINBINDD_LOOKUPNAME, "LOOKUPNAME",
    476491          winbindd_lookupname_send, winbindd_lookupname_recv },
     
    483498        { WINBINDD_GID_TO_SID, "GID_TO_SID",
    484499          winbindd_gid_to_sid_send, winbindd_gid_to_sid_recv },
     500        { WINBINDD_SIDS_TO_XIDS, "SIDS_TO_XIDS",
     501          winbindd_sids_to_xids_send, winbindd_sids_to_xids_recv },
    485502        { WINBINDD_GETPWSID, "GETPWSID",
    486503          winbindd_getpwsid_send, winbindd_getpwsid_recv },
     
    529546        { WINBINDD_PING_DC, "PING_DC",
    530547          winbindd_ping_dc_send, winbindd_ping_dc_recv },
     548        { WINBINDD_PAM_AUTH, "PAM_AUTH",
     549          winbindd_pam_auth_send, winbindd_pam_auth_recv },
     550        { WINBINDD_PAM_LOGOFF, "PAM_LOGOFF",
     551          winbindd_pam_logoff_send, winbindd_pam_logoff_recv },
     552        { WINBINDD_PAM_CHAUTHTOK, "PAM_CHAUTHTOK",
     553          winbindd_pam_chauthtok_send, winbindd_pam_chauthtok_recv },
     554        { WINBINDD_PAM_CHNG_PSWD_AUTH_CRAP, "PAM_CHNG_PSWD_AUTH_CRAP",
     555          winbindd_pam_chng_pswd_auth_crap_send,
     556          winbindd_pam_chng_pswd_auth_crap_recv },
    531557
    532558        { 0, NULL, NULL, NULL }
     
    538564        { WINBINDD_ALLOCATE_GID, "ALLOCATE_GID",
    539565          winbindd_allocate_gid_send, winbindd_allocate_gid_recv },
    540         { WINBINDD_SET_MAPPING, "SET_MAPPING",
    541           winbindd_set_mapping_send, winbindd_set_mapping_recv },
    542         { WINBINDD_REMOVE_MAPPING, "SET_MAPPING",
    543           winbindd_remove_mapping_send, winbindd_remove_mapping_recv },
    544         { WINBINDD_SET_HWM, "SET_HWM",
    545           winbindd_set_hwm_send, winbindd_set_hwm_recv },
    546566        { WINBINDD_CHANGE_MACHACC, "CHANGE_MACHACC",
    547567          winbindd_change_machine_acct_send, winbindd_change_machine_acct_recv },
     568        { WINBINDD_PAM_AUTH_CRAP, "PAM_AUTH_CRAP",
     569          winbindd_pam_auth_crap_send, winbindd_pam_auth_crap_recv },
    548570
    549571        { 0, NULL, NULL, NULL }
     
    557579        struct winbindd_async_dispatch_table *atable;
    558580
    559         state->mem_ctx = talloc_init("winbind request");
     581        state->mem_ctx = talloc_named(state, 0, "winbind request");
    560582        if (state->mem_ctx == NULL)
    561583                return;
     
    713735        }
    714736
    715         DEBUG(10,("winbind_client_response_written[%d:%s]: deliverd response to client\n",
    716                   (int)state->pid, state->cmd_name));
     737        DEBUG(10,("winbind_client_response_written[%d:%s]: delivered response "
     738                  "to client\n", (int)state->pid, state->cmd_name));
    717739
    718740        TALLOC_FREE(state->mem_ctx);
     
    758780        len = sizeof(sunaddr);
    759781
    760         do {
    761                 sock = accept(listen_sock, (struct sockaddr *)(void *)&sunaddr,
    762                               &len);
    763         } while (sock == -1 && errno == EINTR);
    764 
    765         if (sock == -1)
    766                 return;
     782        sock = accept(listen_sock, (struct sockaddr *)(void *)&sunaddr, &len);
     783
     784        if (sock == -1) {
     785                if (errno != EINTR) {
     786                        DEBUG(0, ("Faild to accept socket - %s\n",
     787                                  strerror(errno)));
     788                }
     789                return;
     790        }
    767791
    768792        DEBUG(6,("accepted socket %d\n", sock));
     
    862886}
    863887
     888/* Is a client idle? */
     889
     890static bool client_is_idle(struct winbindd_cli_state *state) {
     891  return (state->response == NULL &&
     892          !state->pwent_state && !state->grent_state);
     893}
     894
    864895/* Shutdown client connection which has been idle for the longest time */
    865896
     
    871902
    872903        for (state = winbindd_client_list(); state; state = state->next) {
    873                 if (state->response == NULL &&
    874                     !state->pwent_state && !state->grent_state) {
     904                if (client_is_idle(state)) {
    875905                        nidle++;
    876906                        if (!last_access || state->last_access < last_access) {
     
    904934                                          struct winbindd_listen_state);
    905935
    906         while (winbindd_num_clients() >
    907                WINBINDD_MAX_SIMULTANEOUS_CLIENTS - 1) {
     936        while (winbindd_num_clients() > lp_winbind_max_clients() - 1) {
    908937                DEBUG(5,("winbindd: Exceeding %d client "
    909938                         "connections, removing idle "
    910                          "connection.\n",
    911                          WINBINDD_MAX_SIMULTANEOUS_CLIENTS));
     939                         "connection.\n", lp_winbind_max_clients()));
    912940                if (!remove_idle_client()) {
    913941                        DEBUG(0,("winbindd: Exceeding %d "
    914942                                 "client connections, no idle "
    915943                                 "connection found\n",
    916                                  WINBINDD_MAX_SIMULTANEOUS_CLIENTS));
     944                                 lp_winbind_max_clients()));
    917945                        break;
    918946                }
    919947        }
    920948        new_connection(s->fd, s->privileged);
     949}
     950
     951/*
     952 * Winbindd socket accessor functions
     953 */
     954
     955const char *get_winbind_pipe_dir(void)
     956{
     957        return lp_parm_const_string(-1, "winbindd", "socket dir", WINBINDD_SOCKET_DIR);
     958}
     959
     960char *get_winbind_priv_pipe_dir(void)
     961{
     962        return lock_path(WINBINDD_PRIV_SOCKET_SUBDIR);
    921963}
    922964
     
    934976
    935977        pub_state->privileged = false;
    936         pub_state->fd = open_winbindd_socket();
     978        pub_state->fd = create_pipe_sock(
     979                get_winbind_pipe_dir(), WINBINDD_SOCKET_NAME, 0755);
    937980        if (pub_state->fd == -1) {
    938981                goto failed;
     
    955998
    956999        priv_state->privileged = true;
    957         priv_state->fd = open_winbindd_priv_socket();
     1000        priv_state->fd = create_pipe_sock(
     1001                get_winbind_priv_pipe_dir(), WINBINDD_SOCKET_NAME, 0750);
    9581002        if (priv_state->fd == -1) {
    9591003                goto failed;
     
    9841028{
    9851029        return !opt_nocache;
     1030}
     1031
     1032void winbindd_register_handlers(void)
     1033{
     1034        /* Setup signal handlers */
     1035
     1036        if (!winbindd_setup_sig_term_handler(true))
     1037                exit(1);
     1038        if (!winbindd_setup_sig_hup_handler(NULL))
     1039                exit(1);
     1040        if (!winbindd_setup_sig_chld_handler())
     1041                exit(1);
     1042        if (!winbindd_setup_sig_usr2_handler())
     1043                exit(1);
     1044
     1045        CatchSignal(SIGPIPE, SIG_IGN);                 /* Ignore sigpipe */
     1046
     1047        /*
     1048         * Ensure all cache and idmap caches are consistent
     1049         * and initialized before we startup.
     1050         */
     1051        if (!winbindd_cache_validate_and_initialize()) {
     1052                exit(1);
     1053        }
     1054
     1055        /* get broadcast messages */
     1056
     1057        if (!serverid_register(procid_self(),
     1058                               FLAG_MSG_GENERAL|FLAG_MSG_DBWRAP)) {
     1059                DEBUG(1, ("Could not register myself in serverid.tdb\n"));
     1060                exit(1);
     1061        }
     1062
     1063        /* React on 'smbcontrol winbindd reload-config' in the same way
     1064           as to SIGHUP signal */
     1065        messaging_register(winbind_messaging_context(), NULL,
     1066                           MSG_SMB_CONF_UPDATED, msg_reload_services);
     1067        messaging_register(winbind_messaging_context(), NULL,
     1068                           MSG_SHUTDOWN, msg_shutdown);
     1069
     1070        /* Handle online/offline messages. */
     1071        messaging_register(winbind_messaging_context(), NULL,
     1072                           MSG_WINBIND_OFFLINE, winbind_msg_offline);
     1073        messaging_register(winbind_messaging_context(), NULL,
     1074                           MSG_WINBIND_ONLINE, winbind_msg_online);
     1075        messaging_register(winbind_messaging_context(), NULL,
     1076                           MSG_WINBIND_ONLINESTATUS, winbind_msg_onlinestatus);
     1077
     1078        messaging_register(winbind_messaging_context(), NULL,
     1079                           MSG_DUMP_EVENT_LIST, winbind_msg_dump_event_list);
     1080
     1081        messaging_register(winbind_messaging_context(), NULL,
     1082                           MSG_WINBIND_VALIDATE_CACHE,
     1083                           winbind_msg_validate_cache);
     1084
     1085        messaging_register(winbind_messaging_context(), NULL,
     1086                           MSG_WINBIND_DUMP_DOMAIN_LIST,
     1087                           winbind_msg_dump_domain_list);
     1088
     1089        messaging_register(winbind_messaging_context(), NULL,
     1090                           MSG_WINBIND_IP_DROPPED,
     1091                           winbind_msg_ip_dropped_parent);
     1092
     1093        /* Register handler for MSG_DEBUG. */
     1094        messaging_register(winbind_messaging_context(), NULL,
     1095                           MSG_DEBUG,
     1096                           winbind_msg_debug);
     1097
     1098        netsamlogon_cache_init(); /* Non-critical */
     1099
     1100        /* clear the cached list of trusted domains */
     1101
     1102        wcache_tdc_clear();
     1103
     1104        if (!init_domain_list()) {
     1105                DEBUG(0,("unable to initialize domain list\n"));
     1106                exit(1);
     1107        }
     1108
     1109        init_idmap_child();
     1110        init_locator_child();
     1111
     1112        smb_nscd_flush_user_cache();
     1113        smb_nscd_flush_group_cache();
     1114
     1115        if (lp_allow_trusted_domains()) {
     1116                if (tevent_add_timer(winbind_event_context(), NULL, timeval_zero(),
     1117                              rescan_trusted_domains, NULL) == NULL) {
     1118                        DEBUG(0, ("Could not trigger rescan_trusted_domains()\n"));
     1119                        exit(1);
     1120                }
     1121        }
     1122
     1123}
     1124
     1125struct winbindd_addrchanged_state {
     1126        struct addrchange_context *ctx;
     1127        struct tevent_context *ev;
     1128        struct messaging_context *msg_ctx;
     1129};
     1130
     1131static void winbindd_addr_changed(struct tevent_req *req);
     1132
     1133static void winbindd_init_addrchange(TALLOC_CTX *mem_ctx,
     1134                                     struct tevent_context *ev,
     1135                                     struct messaging_context *msg_ctx)
     1136{
     1137        struct winbindd_addrchanged_state *state;
     1138        struct tevent_req *req;
     1139        NTSTATUS status;
     1140
     1141        state = talloc(mem_ctx, struct winbindd_addrchanged_state);
     1142        if (state == NULL) {
     1143                DEBUG(10, ("talloc failed\n"));
     1144                return;
     1145        }
     1146        state->ev = ev;
     1147        state->msg_ctx = msg_ctx;
     1148
     1149        status = addrchange_context_create(state, &state->ctx);
     1150        if (!NT_STATUS_IS_OK(status)) {
     1151                DEBUG(10, ("addrchange_context_create failed: %s\n",
     1152                           nt_errstr(status)));
     1153                TALLOC_FREE(state);
     1154                return;
     1155        }
     1156        req = addrchange_send(state, ev, state->ctx);
     1157        if (req == NULL) {
     1158                DEBUG(0, ("addrchange_send failed\n"));
     1159                TALLOC_FREE(state);
     1160                return;
     1161        }
     1162        tevent_req_set_callback(req, winbindd_addr_changed, state);
     1163}
     1164
     1165static void winbindd_addr_changed(struct tevent_req *req)
     1166{
     1167        struct winbindd_addrchanged_state *state = tevent_req_callback_data(
     1168                req, struct winbindd_addrchanged_state);
     1169        enum addrchange_type type;
     1170        struct sockaddr_storage addr;
     1171        NTSTATUS status;
     1172
     1173        status = addrchange_recv(req, &type, &addr);
     1174        TALLOC_FREE(req);
     1175        if (!NT_STATUS_IS_OK(status)) {
     1176                DEBUG(10, ("addrchange_recv failed: %s, stop listening\n",
     1177                           nt_errstr(status)));
     1178                TALLOC_FREE(state);
     1179                return;
     1180        }
     1181        if (type == ADDRCHANGE_DEL) {
     1182                char addrstr[INET6_ADDRSTRLEN];
     1183                DATA_BLOB blob;
     1184
     1185                print_sockaddr(addrstr, sizeof(addrstr), &addr);
     1186
     1187                DEBUG(3, ("winbindd: kernel (AF_NETLINK) dropped ip %s\n",
     1188                          addrstr));
     1189
     1190                blob = data_blob_const(addrstr, strlen(addrstr)+1);
     1191
     1192                status = messaging_send(state->msg_ctx,
     1193                                        messaging_server_id(state->msg_ctx),
     1194                                        MSG_WINBIND_IP_DROPPED, &blob);
     1195                if (!NT_STATUS_IS_OK(status)) {
     1196                        DEBUG(10, ("messaging_send failed: %s - ignoring\n",
     1197                                   nt_errstr(status)));
     1198                }
     1199        }
     1200        req = addrchange_send(state, state->ev, state->ctx);
     1201        if (req == NULL) {
     1202                DEBUG(0, ("addrchange_send failed\n"));
     1203                TALLOC_FREE(state);
     1204                return;
     1205        }
     1206        tevent_req_set_callback(req, winbindd_addr_changed, state);
    9861207}
    9871208
     
    10131234        poptContext pc;
    10141235        int opt;
    1015         TALLOC_CTX *frame = talloc_stackframe();
     1236        TALLOC_CTX *frame;
     1237        NTSTATUS status;
     1238
     1239        /*
     1240         * Do this before any other talloc operation
     1241         */
     1242        talloc_enable_null_tracking();
     1243        frame = talloc_stackframe();
    10161244
    10171245        /* glibc (?) likes to print "User defined signal 1" and exit if a
     
    10991327                }
    11001328        }
    1101         setup_logging("winbindd", log_stdout);
     1329        if (log_stdout) {
     1330                setup_logging("winbindd", DEBUG_STDOUT);
     1331        } else {
     1332                setup_logging("winbindd", DEBUG_FILE);
     1333        }
    11021334        reopen_logs();
    11031335
     
    11371369                return False;
    11381370        }
    1139 
    1140         /* Enable netbios namecache */
    1141 
    1142         namecache_enable();
    11431371
    11441372        /* Unblock all signals we are interested in as they may have been
     
    11541382
    11551383        if (!interactive)
    1156                 become_daemon(Fork, no_process_group);
     1384                become_daemon(Fork, no_process_group, log_stdout);
    11571385
    11581386        pidfile_create("winbindd");
     
    11741402         */
    11751403
    1176         if (!NT_STATUS_IS_OK(reinit_after_fork(winbind_messaging_context(),
    1177                                                winbind_event_context(),
    1178                                                false))) {
     1404        status = reinit_after_fork(winbind_messaging_context(),
     1405                                   winbind_event_context(),
     1406                                   procid_self(), false);
     1407        if (!NT_STATUS_IS_OK(status)) {
    11791408                DEBUG(0,("reinit_after_fork() failed\n"));
    11801409                exit(1);
    11811410        }
    11821411
    1183         /* Setup signal handlers */
    1184 
    1185         if (!winbindd_setup_sig_term_handler(true))
    1186                 exit(1);
    1187         if (!winbindd_setup_sig_hup_handler(NULL))
    1188                 exit(1);
    1189         if (!winbindd_setup_sig_chld_handler())
    1190                 exit(1);
    1191         if (!winbindd_setup_sig_usr2_handler())
    1192                 exit(1);
    1193 
    1194         CatchSignal(SIGPIPE, SIG_IGN);                 /* Ignore sigpipe */
    1195 
    1196         /*
    1197          * Ensure all cache and idmap caches are consistent
    1198          * and initialized before we startup.
    1199          */
    1200         if (!winbindd_cache_validate_and_initialize()) {
    1201                 exit(1);
    1202         }
    1203 
    1204         /* get broadcast messages */
    1205         claim_connection(NULL,"",FLAG_MSG_GENERAL|FLAG_MSG_DBWRAP);
    1206 
    1207         /* React on 'smbcontrol winbindd reload-config' in the same way
    1208            as to SIGHUP signal */
    1209         messaging_register(winbind_messaging_context(), NULL,
    1210                            MSG_SMB_CONF_UPDATED, msg_reload_services);
    1211         messaging_register(winbind_messaging_context(), NULL,
    1212                            MSG_SHUTDOWN, msg_shutdown);
    1213 
    1214         /* Handle online/offline messages. */
    1215         messaging_register(winbind_messaging_context(), NULL,
    1216                            MSG_WINBIND_OFFLINE, winbind_msg_offline);
    1217         messaging_register(winbind_messaging_context(), NULL,
    1218                            MSG_WINBIND_ONLINE, winbind_msg_online);
    1219         messaging_register(winbind_messaging_context(), NULL,
    1220                            MSG_WINBIND_ONLINESTATUS, winbind_msg_onlinestatus);
    1221 
    1222         messaging_register(winbind_messaging_context(), NULL,
    1223                            MSG_DUMP_EVENT_LIST, winbind_msg_dump_event_list);
    1224 
    1225         messaging_register(winbind_messaging_context(), NULL,
    1226                            MSG_WINBIND_VALIDATE_CACHE,
    1227                            winbind_msg_validate_cache);
    1228 
    1229         messaging_register(winbind_messaging_context(), NULL,
    1230                            MSG_WINBIND_DUMP_DOMAIN_LIST,
    1231                            winbind_msg_dump_domain_list);
    1232 
    1233         /* Register handler for MSG_DEBUG. */
    1234         messaging_register(winbind_messaging_context(), NULL,
    1235                            MSG_DEBUG,
    1236                            winbind_msg_debug);
    1237 
    1238         netsamlogon_cache_init(); /* Non-critical */
    1239 
    1240         /* clear the cached list of trusted domains */
    1241 
    1242         wcache_tdc_clear();     
    1243 
    1244         if (!init_domain_list()) {
    1245                 DEBUG(0,("unable to initialize domain list\n"));
    1246                 exit(1);
    1247         }
    1248 
    1249         init_idmap_child();
    1250         init_locator_child();
    1251 
    1252         smb_nscd_flush_user_cache();
    1253         smb_nscd_flush_group_cache();
     1412        winbindd_register_handlers();
     1413
     1414        status = init_system_info();
     1415        if (!NT_STATUS_IS_OK(status)) {
     1416                DEBUG(1, ("ERROR: failed to setup system user info: %s.\n",
     1417                          nt_errstr(status)));
     1418                exit(1);
     1419        }
     1420
     1421        rpc_lsarpc_init(NULL);
     1422        rpc_samr_init(NULL);
     1423
     1424        winbindd_init_addrchange(NULL, winbind_event_context(),
     1425                                 winbind_messaging_context());
    12541426
    12551427        /* setup listen sockets */
     
    12581430                DEBUG(0,("winbindd_setup_listeners() failed\n"));
    12591431                exit(1);
    1260         }
    1261 
    1262         if (lp_allow_trusted_domains()) {
    1263                 if (tevent_add_timer(winbind_event_context(), NULL, timeval_zero(),
    1264                               rescan_trusted_domains, NULL) == NULL) {
    1265                         DEBUG(0, ("Could not trigger rescan_trusted_domains()\n"));
    1266                         exit(1);
    1267                 }
    12681432        }
    12691433
Note: See TracChangeset for help on using the changeset viewer.