Kernel Functions for Drivers ddicred(9F)
NAME
ddicred, crgetuid, crgetruid, crgetsuid, crgetgid,
crgetrgid, crgetsgid, crgetzoneid, crgetgroups, crgetngroups
- access and change parts of the credt structure
SYNOPSIS
#include
uidt crgetuid(const credt *cr);
uidt crgetruid(const credt *cr);
uidt crgetsuid(const credt *cr);
gidt crgetgid(const credt *cr);
gidt crgetrgid(const credt *cr);
gidt crgetsgid(const credt *cr);
zoneidt crgetzoneid(const credt *cr);
const gidt *crgetgroups(const credt *cr);
int crgetngroups(const credt *cr);
int crsetresuid(credt *cr, uidt ruid, uidt euid, uidt suid);
int crsetresgid(credt *cr, gidt rgid, gidt egid, gidt sgid);
int crsetugid(credt *cr, uidt uid, gidt gid);
int crsetgroups(credt *cr, int ngroups, gidt gids);
INTERFACE LEVEL
Solaris DI specific (Solaris DI).
SunOS 5.11 Last change: 6 Aug 2003 1
Kernel Functions for Drivers ddicred(9F)
PARAMETERS
cr pointer to the user credential
structure
uid, ruid, euid, suid new user id, real, effective and
saved user id
gid, rgid, egid, sgid new group id, real, effective and
saved group id
ngroups number of groups in the group array
gids pointer to array of new groups
DESCRIPTION
The user credential is a shared, read-only, ref-counted data
structure. Its actual size and layout are subject to change.
The functions described in this page allow the programmer to
retrieve fields from the structure and to initialize newly
allocated credential structures.
crgetuid(), crgetruid(), and crgetsuid() return, respec-
tively, the effective, real, and saved user id from the user
credential pointed to by cr.
crgetgid(), crgetrgid(), and crgetsgid() return, respec-
tively, the effective, real, and saved group id from the
user credential pointed to by cr.
crgetzoneid() returns the zone id from the user credential
pointed to by cr.
crgetgroups() returns the group list of the user credential
pointed to by cr.
crgetngroups() returns the number of groups in the user
credential pointed to by cr.
crsetresuid() sets the real, effective and saved user id.
All but one can be specified as -1, which causes the origi-
nal value not to change.
SunOS 5.11 Last change: 6 Aug 2003 2
Kernel Functions for Drivers ddicred(9F)
crsetresgid() sets the real, effective and saved group id.
All but one can be specified as -1, which causes the origi-
nal value not to change.
crsetugid() initializes the real, effective and saved user
id all to uid. It initializes the real, effective, and saved
group id all to gid.
crsetgroups() sets the number of groups in the user creden-
tial to ngroups and copies the groups from gids to the user
credential. If ngroups is 0, gids need not point to valid
storage.
It is an error to call this any of the crset*() functions on
a user credential structure that was newly allocated.
RETURN VALUES
The crget*() functions return the requested information.
The crset*id() functions return 0 on success and -1 if any
of the specified ids are invalid. The functions might cause
a system panic if called on a user credential structure that
is referenced by other parts of the system.
CONTEXT
These functions can be called from user and kernel contexts.
ATRIBUTES
See attributes(5) for a description of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Architecture All
Interface Stability Committed
SEE ALSO
attributes(5), privileges(5), drvpriv(9F)
Writing Device Drivers
SunOS 5.11 Last change: 6 Aug 2003 3
|