Lines Matching full:context

40  * Clears the error message from the Kerberos 5 context.
42 * @param context The Kerberos 5 context to clear
48 krb5_clear_error_message(krb5_context context) in krb5_clear_error_message() argument
50 HEIMDAL_MUTEX_lock(context->mutex); in krb5_clear_error_message()
51 if (context->error_string) in krb5_clear_error_message()
52 free(context->error_string); in krb5_clear_error_message()
53 context->error_code = 0; in krb5_clear_error_message()
54 context->error_string = NULL; in krb5_clear_error_message()
55 HEIMDAL_MUTEX_unlock(context->mutex); in krb5_clear_error_message()
59 * Set the context full error string for a specific error code.
62 * The if context is NULL, no error string is stored.
64 * @param context Kerberos 5 context
73 krb5_set_error_message(krb5_context context, krb5_error_code ret, in krb5_set_error_message() argument
80 krb5_vset_error_message (context, ret, fmt, ap); in krb5_set_error_message()
85 * Set the context full error string for a specific error code.
87 * The if context is NULL, no error string is stored.
89 * @param context Kerberos 5 context
99 krb5_vset_error_message (krb5_context context, krb5_error_code ret, in krb5_vset_error_message() argument
105 if (context == NULL) in krb5_vset_error_message()
108 HEIMDAL_MUTEX_lock(context->mutex); in krb5_vset_error_message()
109 if (context->error_string) { in krb5_vset_error_message()
110 free(context->error_string); in krb5_vset_error_message()
111 context->error_string = NULL; in krb5_vset_error_message()
113 context->error_code = ret; in krb5_vset_error_message()
114 r = vasprintf(&context->error_string, fmt, args); in krb5_vset_error_message()
116 context->error_string = NULL; in krb5_vset_error_message()
117 HEIMDAL_MUTEX_unlock(context->mutex); in krb5_vset_error_message()
121 * Prepend the context full error string for a specific error code.
124 * The if context is NULL, no error string is stored.
126 * @param context Kerberos 5 context
135 krb5_prepend_error_message(krb5_context context, krb5_error_code ret, in krb5_prepend_error_message() argument
142 krb5_vprepend_error_message(context, ret, fmt, ap); in krb5_prepend_error_message()
149 * The if context is NULL, no error string is stored.
151 * @param context Kerberos 5 context
160 krb5_vprepend_error_message(krb5_context context, krb5_error_code ret, in krb5_vprepend_error_message() argument
166 if (context == NULL) in krb5_vprepend_error_message()
169 HEIMDAL_MUTEX_lock(context->mutex); in krb5_vprepend_error_message()
170 if (context->error_code != ret) { in krb5_vprepend_error_message()
171 HEIMDAL_MUTEX_unlock(context->mutex); in krb5_vprepend_error_message()
175 HEIMDAL_MUTEX_unlock(context->mutex); in krb5_vprepend_error_message()
178 if (context->error_string) { in krb5_vprepend_error_message()
181 e = asprintf(&str2, "%s: %s", str, context->error_string); in krb5_vprepend_error_message()
182 free(context->error_string); in krb5_vprepend_error_message()
184 context->error_string = NULL; in krb5_vprepend_error_message()
186 context->error_string = str2; in krb5_vprepend_error_message()
189 context->error_string = str; in krb5_vprepend_error_message()
190 HEIMDAL_MUTEX_unlock(context->mutex); in krb5_vprepend_error_message()
195 * Return the error message in context. On error or no error string,
198 * @param context Kerberos 5 context
207 krb5_get_error_string(krb5_context context) in krb5_get_error_string() argument
211 HEIMDAL_MUTEX_lock(context->mutex); in krb5_get_error_string()
212 if (context->error_string) in krb5_get_error_string()
213 ret = strdup(context->error_string); in krb5_get_error_string()
214 HEIMDAL_MUTEX_unlock(context->mutex); in krb5_get_error_string()
219 krb5_have_error_string(krb5_context context) in krb5_have_error_string() argument
222 HEIMDAL_MUTEX_lock(context->mutex); in krb5_have_error_string()
223 str = context->error_string; in krb5_have_error_string()
224 HEIMDAL_MUTEX_unlock(context->mutex); in krb5_have_error_string()
229 * Return the error message for `code' in context. On memory
232 * @param context Kerberos 5 context
242 krb5_get_error_message(krb5_context context, krb5_error_code code) in krb5_get_error_message() argument
255 * with a NULL context in order to translate an error code as a in krb5_get_error_message()
256 * replacement for error_message(). Another reason a NULL context in krb5_get_error_message()
260 if (context) in krb5_get_error_message()
262 HEIMDAL_MUTEX_lock(context->mutex); in krb5_get_error_message()
263 if (context->error_string && in krb5_get_error_message()
264 (code == context->error_code || context->error_code == 0)) in krb5_get_error_message()
266 str = strdup(context->error_string); in krb5_get_error_message()
268 HEIMDAL_MUTEX_unlock(context->mutex); in krb5_get_error_message()
275 if (krb5_init_context(&context) == 0) in krb5_get_error_message()
279 if (context) in krb5_get_error_message()
280 cstr = com_right_r(context->et_list, code, buf, sizeof(buf)); in krb5_get_error_message()
283 krb5_free_context(context); in krb5_get_error_message()
302 * @param context Kerberos context
310 krb5_free_error_message(krb5_context context, const char *msg) in krb5_free_error_message() argument
322 * @param context Kerberos 5 context.
331 krb5_get_err_text(krb5_context context, krb5_error_code code) in krb5_get_err_text() argument
335 if(context != NULL) in krb5_get_err_text()
336 p = com_right(context->et_list, code); in krb5_get_err_text()