~ubuntu-branches/ubuntu/lucid/krb5/lucid-updates

« back to all changes in this revision

Viewing changes to src/windows/identity/kmm/kmm_registrar.c

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hartman
  • Date: 2010-01-13 19:00:37 UTC
  • mfrom: (13.4.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100113190037-hrvrxs7cftafjotm
Tags: 1.8+dfsg~alpha1-4
* Add replaces to deal with moving files from krb5-multidev to
  libkrb5-dev, Closes: #565217 
* This is definitely the getting all the conflicts combinations right is
  tricky series of releases.  Sorry about the wasted cycles.

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
 
93
93
/*! \internal
94
94
  \brief Message handler for the registrar thread. */
95
 
khm_boolean KHMAPI kmmint_reg_cb(khm_int32 msg_type, 
96
 
                                 khm_int32 msg_sub_type, 
 
95
khm_boolean KHMAPI kmmint_reg_cb(khm_int32 msg_type,
 
96
                                 khm_int32 msg_sub_type,
97
97
                                 khm_ui_4 uparam,
98
98
                                 void *vparam)
99
99
{
173
173
 
174
174
    p->tid_thread = GetCurrentThreadId();
175
175
 
176
 
    rv = (*p->p.msg_proc)(KMSG_SYSTEM, KMSG_SYSTEM_INIT, 
 
176
    rv = (*p->p.msg_proc)(KMSG_SYSTEM, KMSG_SYSTEM_INIT,
177
177
                          0, (void *) &(p->p));
178
178
    _report_mr1(KHERR_INFO, MSG_PB_INIT_RV, _int32(rv));
179
179
 
282
282
        p->state = KMM_PLUGIN_STATE_EXITED;
283
283
 
284
284
    /* the following call will automatically release the plugin */
285
 
    kmq_post_message(KMSG_KMM, KMSG_KMM_I_REG, 
 
285
    kmq_post_message(KMSG_KMM, KMSG_KMM_I_REG,
286
286
                     KMM_REG_EXIT_PLUGIN, (void *) p);
287
287
 
288
288
    TlsSetValue(tls_kmm, (LPVOID) 0);
353
353
            p->state = KMM_PLUGIN_STATE_FAIL_NOT_REGISTERED;
354
354
            goto _exit;
355
355
        }
356
 
        
 
356
 
357
357
        if(KHM_FAILED(kmm_get_plugin_config(p->p.name, 0, &csp_plugin))) {
358
358
            _report_mr0(KHERR_ERROR, MSG_IP_NOT_REGISTERED);
359
359
 
378
378
 
379
379
    p->n_depends = 0;
380
380
    p->n_unresolved = 0;
381
 
    
 
381
 
382
382
    do {
383
383
        wchar_t * deps = NULL;
384
384
        wchar_t * d;
385
385
        khm_size sz = 0;
386
386
 
387
 
        if(khc_read_multi_string(csp_plugin, L"Dependencies", 
 
387
        if(khc_read_multi_string(csp_plugin, L"Dependencies",
388
388
                                 NULL, &sz) != KHM_ERROR_TOO_LONG)
389
389
            break;
390
390
 
391
391
        deps = PMALLOC(sz);
392
 
        if(KHM_FAILED(khc_read_multi_string(csp_plugin, L"Dependencies", 
 
392
        if(KHM_FAILED(khc_read_multi_string(csp_plugin, L"Dependencies",
393
393
                                            deps, &sz))) {
394
394
            if(deps)
395
395
                PFREE(deps);
473
473
    if(csp_plugins != NULL)
474
474
        khc_close_space(csp_plugins);
475
475
 
476
 
    _report_mr2(KHERR_INFO, MSG_IP_STATE, 
 
476
    _report_mr2(KHERR_INFO, MSG_IP_STATE,
477
477
                _dupstr(p->p.name), _int32(p->state));
478
478
 
479
479
    _end_task();
480
 
    
 
480
 
481
481
    return;
482
482
 
483
483
    /* jump here if an error condition happens before the plugin
489
489
    if(csp_plugins != NULL)
490
490
        khc_close_space(csp_plugins);
491
491
 
492
 
    _report_mr2(KHERR_WARNING, MSG_IP_EXITING, 
 
492
    _report_mr2(KHERR_WARNING, MSG_IP_EXITING,
493
493
                _dupstr(p->p.name), _int32(p->state));
494
494
    _end_task();
495
495
 
512
512
 
513
513
  In addition to terminating the thread, and removing p from the
514
514
  linked list and hashtable, it also frees up p.
515
 
   
 
515
 
516
516
  \note Should only be called from the context of the registrar thread. */
517
517
void kmmint_exit_plugin(kmm_plugin_i * p) {
518
518
    int np;
654
654
 
655
655
        ct = (FtToInt(&fct) - tm) / 10000000i64;
656
656
 
657
 
        if(tm > 0 && 
 
657
        if(tm > 0 &&
658
658
           ct > fail_reset_time) {
659
659
            i = 0;
660
660
            khc_write_int32(csp_mod, L"FailureCount", 0);
666
666
        /* did we exceed the max failure count?  However, we ignore
667
667
           the max failure count if the reason why it didn't load the
668
668
           last time was because the module wasn't found. */
669
 
        if(i > max_fail_count && 
 
669
        if(i > max_fail_count &&
670
670
           last_reason != KMM_MODULE_STATE_FAIL_NOT_FOUND) {
671
671
            /* failed too many times */
672
672
            _report_mr0(KHERR_INFO, MSG_IM_MAX_FAIL);
676
676
        }
677
677
    }
678
678
 
679
 
    if(khc_read_string(csp_mod, KMM_VALNAME_IMAGEPATH, NULL, &sz) == 
 
679
    if(khc_read_string(csp_mod, KMM_VALNAME_IMAGEPATH, NULL, &sz) ==
680
680
       KHM_ERROR_TOO_LONG) {
681
681
        if(m->path)
682
682
            PFREE(m->path);
683
683
        m->path = PMALLOC(sz);
684
684
        khc_read_string(csp_mod, KMM_VALNAME_IMAGEPATH, m->path, &sz);
685
685
    } else {
686
 
        /* 
687
 
         * If there is no image path, then the module has not been 
 
686
        /*
 
687
         * If there is no image path, then the module has not been
688
688
         * installed.  Do not report an error and bother the user.
689
689
         *   _report_mr0(KHERR_ERROR, MSG_IM_NOT_REGISTERED);
690
690
         */
831
831
    if(csp_mods)
832
832
        khc_close_space(csp_mods);
833
833
 
834
 
    _report_mr2(KHERR_INFO, MSG_IM_MOD_STATE, 
 
834
    _report_mr2(KHERR_INFO, MSG_IM_MOD_STATE,
835
835
                _dupstr(m->name), _int32(m->state));
836
836
 
837
837
    kmmint_remove_from_module_queue();
900
900
void kmmint_exit_module(kmm_module_i * m) {
901
901
    kmm_plugin_i * p;
902
902
 
903
 
    /*  Exiting a module happens in two stages.  
 
903
    /*  Exiting a module happens in two stages.
904
904
 
905
905
        If the module state is running (there are active plugins) then
906
906
        those plugins must be exited.  This has to be done from the
942
942
               (p->flags & KMM_PLUGIN_FLAG_IN_MODCOUNT)) {
943
943
 
944
944
                kmm_hold_plugin(kmm_handle_from_plugin(p));
945
 
                kmq_post_message(KMSG_KMM, KMSG_KMM_I_REG, 
 
945
                kmq_post_message(KMSG_KMM, KMSG_KMM_I_REG,
946
946
                                 KMM_REG_EXIT_PLUGIN, (void *) p);
947
947
                np++;
948
948
 
986
986
        if(m->state > 0)
987
987
            m->state = KMM_MODULE_STATE_EXIT;
988
988
 
989
 
        p_exit_module = 
990
 
            (exit_module_t) GetProcAddress(m->h_module, 
 
989
        p_exit_module =
 
990
            (exit_module_t) GetProcAddress(m->h_module,
991
991
                                           EXP_EXIT_MODULE);
992
992
        if(p_exit_module) {
993
993
            LeaveCriticalSection(&cs_kmm);