~ubuntu-branches/ubuntu/jaunty/trousers/jaunty

« back to all changes in this revision

Viewing changes to src/tcsd/svrside.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2008-01-23 22:03:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080123220300-fhtqja3c0oq0gp6z
Tags: 0.3.1-4
* Added patch from Aaron M. Ucko <ucko@debian.org> to allow trousers to
  build successfully on amd64, and presumably also other 64-bit
  architectures (Closes: #457400).
* Including udev rule for /dev/tpm from William Lima
  <wlima.amadeus@gmail.com> as suggested by David Smith <dds@google.com>
  (Closes: #459682).
* Added lintian overrides.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <getopt.h>
26
26
 
27
27
#include "trousers/tss.h"
28
 
#include "tcs_internal_types.h"
29
 
#include "spi_internal_types.h"
 
28
#include "trousers_types.h"
30
29
#include "tcs_tsp.h"
31
30
#include "tcs_utils.h"
32
31
#include "tcs_int_literals.h"
46
45
        /* order is important here:
47
46
         * allow all threads to complete their current request */
48
47
        tcsd_threads_final();
49
 
        ps_close_disk_cache();
 
48
        PS_close_disk_cache();
50
49
        auth_mgr_final();
51
50
        (void)req_mgr_final();
52
51
        conf_file_final(&tcsd_options);
53
 
        event_log_final();
 
52
        EVENT_LOG_final();
54
53
}
55
54
 
56
55
void
99
98
                return TCSERR(TSS_E_INTERNAL_ERROR);
100
99
        }
101
100
 
102
 
        if ((rc = pthread_sigmask(SIG_UNBLOCK, &sigmask, NULL))) {
103
 
                LogError("pthread_sigmask: %s", strerror(rc));
 
101
        if ((rc = THREAD_SET_SIGNAL_MASK(SIG_UNBLOCK, &sigmask, NULL))) {
 
102
                LogError("Setting thread signal mask: %s", strerror(rc));
104
103
                return TCSERR(TSS_E_INTERNAL_ERROR);
105
104
        }
106
105
 
158
157
                return result;
159
158
        }
160
159
 
161
 
        if ((result = ps_init_disk_cache())) {
 
160
        result = PS_init_disk_cache();
 
161
        if (result != TSS_SUCCESS) {
162
162
                conf_file_final(&tcsd_options);
163
163
                (void)req_mgr_final();
164
164
                return result;
166
166
 
167
167
        if ((result = get_tpm_metrics(&tpm_metrics))) {
168
168
                conf_file_final(&tcsd_options);
169
 
                ps_close_disk_cache();
 
169
                PS_close_disk_cache();
170
170
                (void)req_mgr_final();
171
171
                return result;
172
172
        }
174
174
        /* must happen after get_tpm_metrics() */
175
175
        if ((result = auth_mgr_init())) {
176
176
                conf_file_final(&tcsd_options);
177
 
                ps_close_disk_cache();
178
 
                (void)req_mgr_final();
179
 
                return result;
180
 
        }
181
 
 
182
 
        if ((result = event_log_init())) {
183
 
                auth_mgr_final();
184
 
                conf_file_final(&tcsd_options);
185
 
                ps_close_disk_cache();
 
177
                PS_close_disk_cache();
 
178
                (void)req_mgr_final();
 
179
                return result;
 
180
        }
 
181
 
 
182
        result = EVENT_LOG_init();
 
183
        if (result != TSS_SUCCESS) {
 
184
                auth_mgr_final();
 
185
                conf_file_final(&tcsd_options);
 
186
                PS_close_disk_cache();
 
187
                (void)req_mgr_final();
 
188
                return result;
 
189
        }
 
190
 
 
191
        result = owner_evict_init();
 
192
        if (result != TSS_SUCCESS) {
 
193
                auth_mgr_final();
 
194
                conf_file_final(&tcsd_options);
 
195
                PS_close_disk_cache();
186
196
                (void)req_mgr_final();
187
197
                return result;
188
198
        }