NAME
sec_login_get_current_context - 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 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
SYS$COMMON:[DCE$LIBRARY]SEC_LOGIN.IDL
The idl file from which dce/sec_login.h was derived.
ERRORS
sec_login_s_no_current_context
There was no current context to retrieve. (See
sec_login_setup_identity 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)...
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 invalid0);
... application specific error handling ...
}
RELATED INFORMATION
Functions: sec_intro
sec_login_setup_identity