CVM

CVM Client Library

The CVM client library defines the following functions:

int authenticate(const char* module, const char** credentials)

This is the main entry point to the library. Simply set up the account name and credentials as an array with a trailing NULL pointer and call authenticate. The function will return 0 if authentication succeeded and an error code otherwise.

If authentication succeeds, this routine automatically retrieves fact_username, fact_userid, fact_groupid, fact_directory, and fact_shell. fact_realname, fact_groupname, fact_sys_username, and fact_sys_directory are also set if they were present in the results.

int fact_str(int number, const char** data)

Retrieves a fact from the data returned by the module as a NUL-terminated string. Returns non-zero if the fact was present.

int fact_uint(int number, unsigned** data)

Retrieves a fact from the data returned by the module as an unsigned integer. Returns non-zero if the fact was present and was an unsigned integer.