NAME

catgen_dbmap - perform user role mapping

SYNOPSIS

#include <cat/gen.h>

int catgen_dbmap(cat_session *sess, const char *givenuser, const char *givenpsw, const char *givendbid, char **newuser, char **newpsw, char **newdbid);

DESCRIPTION

This function maps the supplied givenuser, givenpsw, and givendbid onto three new values. The new values then replace the supplied values. This is achieved through a BoKS DB mapping or a lookup in UAR data for the current authenticated user depending on the protocol used (DASP or SSL respectively).

If the call is successful, the supplied pointers (newuser, newpsw, and newdbid), provided they are non-NULL, will be set to point to allocated data. The allocated data must be freed by the caller.

This call must be preceded by a successful call to catgen_checkauth().

One or more of the input parameters givenuser, givenpsw and givendbid can be NULL, in which case they will match any value.

LOGGING

This function generates no log events.

RETURN VALUES

If the function is successful, CAT_OK is returned. On error, no data is allocated and a negative error code is returned.

SEE ALSO

cat, catgen, catgen_checkauth