xref: /illumos-gate/usr/src/man/man3sasl/sasl_seterror.3sasl (revision 1ed6b69a5ca1ca3ee5e9a4931f74e2237c7e1c9f)
te
Copyright (C) 1998-2003, Carnegie Mellon Univeristy. All Rights Reserved.
Portions Copyright (C) 2003, Sun Microsystems,
Inc. All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
SASL_SETERROR 3SASL "Oct 14, 2003"
NAME
sasl_seterror - set the error string
SYNOPSIS

cc [ flag ... ] file ... -lsasl [ library ... ]
#include <sasl/sasl.h>

void sasl_seterror(sasl_conn_t *conn, unsigned flags,
 const char *fmt, ...);
DESCRIPTION

The sasl_seterror() interface sets the error string that will be returned by sasl_errdetail(3SASL). Use syslog(3C) style formatting, that is, use printf()\(emstyle with %m as the most recent errno error.

The sasl_seterror() interface is primarily used by server callback functions and internal plug-ins, for example, with the sasl_authorize_t callback. The sasl_seterror() interface triggers a call to the SASL logging callback, if any, with a level of SASL_LOG_FAIL, unless the SASL_NOLOG flag is set.

Make the message string sensitive to the current language setting. If there is no SASL_CB_LANGUAGE callback, message strings must be i-default. Otherwise, UTF-8 is used. Use of RFC 2482 for mixed-language text is encouraged.

If the value of conn is NULL, the sasl_seterror() interface fails.

PARAMETERS
conn

The sasl_conn_t for which the call to sasl_seterror() applies.

flags

If set to SASL_NOLOG, the call to sasl_seterror() is not logged.

fmt

A syslog(3C) style format string.

RETURN VALUES

sasl_seterror() has no return values.

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
Interface Stability Evolving
MT-Level MT-Safe
SEE ALSO

sasl_errdetail(3SASL), syslog(3C), attributes(5)

Whistler, K. and Adams, G. RFC 2482, Language Tagging in Unicode Plain Text. Network Working Group. January 1999.