Lines Matching refs: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)
50 HEIMDAL_MUTEX_lock(context->mutex);
51 if (context->error_string)
52 free(context->error_string);
53 context->error_code = 0;
54 context->error_string = NULL;
55 HEIMDAL_MUTEX_unlock(context->mutex);
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,
80 krb5_vset_error_message (context, ret, fmt, ap);
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,
105 if (context == NULL)
108 HEIMDAL_MUTEX_lock(context->mutex);
109 if (context->error_string) {
110 free(context->error_string);
111 context->error_string = NULL;
113 context->error_code = ret;
114 r = vasprintf(&context->error_string, fmt, args);
116 context->error_string = NULL;
117 HEIMDAL_MUTEX_unlock(context->mutex);
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,
142 krb5_vprepend_error_message(context, ret, fmt, ap);
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,
166 if (context == NULL)
169 HEIMDAL_MUTEX_lock(context->mutex);
170 if (context->error_code != ret) {
171 HEIMDAL_MUTEX_unlock(context->mutex);
175 HEIMDAL_MUTEX_unlock(context->mutex);
178 if (context->error_string) {
181 e = asprintf(&str2, "%s: %s", str, context->error_string);
182 free(context->error_string);
184 context->error_string = NULL;
186 context->error_string = str2;
189 context->error_string = str;
190 HEIMDAL_MUTEX_unlock(context->mutex);
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)
211 HEIMDAL_MUTEX_lock(context->mutex);
212 if (context->error_string)
213 ret = strdup(context->error_string);
214 HEIMDAL_MUTEX_unlock(context->mutex);
219 krb5_have_error_string(krb5_context context)
222 HEIMDAL_MUTEX_lock(context->mutex);
223 str = context->error_string;
224 HEIMDAL_MUTEX_unlock(context->mutex);
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)
255 * with a NULL context in order to translate an error code as a
256 * replacement for error_message(). Another reason a NULL context
260 if (context)
262 HEIMDAL_MUTEX_lock(context->mutex);
263 if (context->error_string &&
264 (code == context->error_code || context->error_code == 0))
266 str = strdup(context->error_string);
268 HEIMDAL_MUTEX_unlock(context->mutex);
275 if (krb5_init_context(&context) == 0)
279 if (context)
280 cstr = com_right_r(context->et_list, code, buf, sizeof(buf));
283 krb5_free_context(context);
302 * @param context Kerberos context
310 krb5_free_error_message(krb5_context context, const char *msg)
322 * @param context Kerberos 5 context.
331 krb5_get_err_text(krb5_context context, krb5_error_code code)
335 if(context != NULL)
336 p = com_right(context->et_list, code);