~ubuntu-branches/ubuntu/raring/heimdal/raring

« back to all changes in this revision

Viewing changes to kuser/kswitch.c

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2011-07-21 17:40:58 UTC
  • mfrom: (1.1.12 upstream) (2.4.10 experimental)
  • Revision ID: james.westby@ubuntu.com-20110721174058-byiuowgocek307cs
Tags: 1.5~pre2+git20110720-2
Fix dependency on pthreads when building on Linux 3.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
#include "kcc-commands.h"
36
36
 
37
37
#ifdef HAVE_READLINE
38
 
char *readline(char *prompt);
 
38
char *readline(const char *prompt);
39
39
#else
40
40
 
41
41
static char *
42
 
readline(char *prompt)
 
42
readline(const char *prompt)
43
43
{
44
44
    char buf[BUFSIZ];
45
45
    printf ("%s", prompt);
86
86
        while (krb5_cc_cache_next(kcc_context, cursor, &id) == 0) {
87
87
            krb5_principal p;
88
88
            char num[10];
89
 
        
 
89
 
90
90
            ret = krb5_cc_get_principal(kcc_context, id, &p);
91
91
            if (ret)
92
92
                continue;
98
98
            rtbl_add_column_entry(ct, "", num);
99
99
            rtbl_add_column_entry(ct, "Principal", name);
100
100
            free(name);
101
 
            
 
101
 
102
102
            ids = erealloc(ids, (len + 1) * sizeof(ids[0]));
103
103
            ids[len] = id;
104
104
            len++;
115
115
                krb5_errx(kcc_context, 1, "Cache number '%s' is invalid", name);
116
116
            if (i > len)
117
117
                krb5_errx(kcc_context, 1, "Cache number '%s' is too large", name);
118
 
            
 
118
 
119
119
            id = ids[i - 1];
120
120
            ids[i - 1] = NULL;
121
121
        } else
147
147
        ops = krb5_cc_get_prefix_ops(kcc_context, opt->type_string);
148
148
        if (ops == NULL)
149
149
            krb5_err(kcc_context, 1, 0, "krb5_cc_get_prefix_ops");
150
 
        
 
150
 
151
151
        asprintf(&str, "%s:%s", ops->prefix, opt->cache_string);
152
152
        if (str == NULL)
153
153
            krb5_errx(kcc_context, 1, N_("out of memory", ""));
154
 
        
 
154
 
155
155
        ret = krb5_cc_resolve(kcc_context, str, &id);
156
156
        if (ret)
157
157
            krb5_err(kcc_context, 1, ret, "krb5_cc_resolve: %s", str);
158
 
        
 
158
 
159
159
        free(str);
160
160
    } else {
161
161
        krb5_errx(kcc_context, 1, "missing option for kswitch");