PreviousNext

sec_login_get_current_context(3sec)

Returns a handle to the current login context

Synopsis

#include <dce/sec_login.h>

void sec_login_get_current_context(
sec_login_handle_t *login_context,
error_status_t *
status);

Parameters

Output

login_context
A pointer to an opaque handle to login context data. The login context contains, among other data, the account principal name and UUID, account restrictions, records of group membership, and the process home directory. (See sec_intro(3sec) for more details about the login context.)

status
A pointer to the completion status. On successful completion, the routine returns error_status_ok. Otherwise, it returns an error.

Description
The sec_login_get_current_context( ) routine retrieves a handle to the login context for the currently established network identity. The context returned is created from locally cached data so subsequent data extraction operations may return some NULL values.

Files

/usr/include/dce/sec_login.idl
The idl file from which dce/sec_login.h was derived.

Errors

The following describes a partial list of errors that might be returned. Refer to the OSF DCE Problem Determination Guide for complete descriptions of all error messages.

sec_login_s_no_current_context
There was no current context to retrieve. (See sec_login_setup_identity(3sec) for information about how to set up, validate, and implement a login context.)

error_status_ok
The call was successful.

Examples
The following example illustrates use of the sec_login_get_current_context( ) routine as part of a process to change the groupset:

sec_login_get_current_context(&login_context, &st);
sec_login_get_groups(login_context, &num_groups, &groups, &st);
...the group IDs have to be converted from the returned UNIX
numbers into UUIDs (use sec_rgy_pgo_unix_num_to_id(3sec)...
for (i=0; i < num_groups; i++) {
... query whether the user wants to discard any of the current
group memberships. Copy new groupset to the new_groups array ...
}
if ( !sec_login_newgroups(sec_login_no_flags, num_new_groups,
new_groups, &login_context, &st)) { if (st == sec_login_s_groupset_invalid)
printf("New groupset invalid\n");
... application specific error handling ...
}

Related Information
Functions:

sec_intro(3sec)

sec_login_setup_identity(3sec)