Next: , Previous: Module Creation and Destruction, Up: libmuauth


3.2.4 Obtaining Authorization Information

— Function: int mu_auth_runlist (list_t flist, struct mu_auth_data **return_data, void *key, void *call_data);

The list is expected to contain mu_auth_fp pointers. Each of them is dereferenced and executed until either the list is exhausted or any of the functions returns non-zero, whichever occurs first. The return_data and key arguments are passed as the first two parameters to the function (see the definition of mu_auth_fp, notice the footnote), the call_data is passed as its last parameter.

The function returns 0 if none of the functions from list succeeded, i.e. returned non-zero value. Otherwise it returns the return code from the succeeded function.

— Function: struct mu_auth_data * mu_get_auth_by_name (const char *username)

Search the information about given user by its username. Similar to system's getpwnam call).

— Function: struct mu_auth_data * mu_get_auth_by_uid (uid_t uid)

Search the information about given user by its uid. Similar to system's getpwuid call).

— Function: int mu_authenticate (struct mu_auth_data *auth_data, char *pass)

Authenticate the user whose data are in auth_data using password pass. Return 0 if the user is authenticated.