33 #ifndef INCLUDE_OLA_BASE_CREDENTIALS_H_
34 #define INCLUDE_OLA_BASE_CREDENTIALS_H_
89 bool SetUID(uid_t new_uid);
119 bool SetGID(gid_t new_gid);
145 bool SetGroups(
size_t size,
const gid_t *list);
259 #endif // INCLUDE_OLA_BASE_CREDENTIALS_H_
bool SupportsUIDs()
Check whether the current platform supports User and Group IDs.
Definition: Credentials.cpp:53
gid_t gr_gid
Group ID.
Definition: Credentials.h:222
bool SetGID(gid_t new_gid)
Set the effective Group ID of the process.
Definition: Credentials.cpp:135
bool GetEUID(uid_t *euid)
Get the effective UID of the process.
Definition: Credentials.cpp:76
int GetGroups(int size, gid_t list[])
Get the supplementary group ID's of the process.
Definition: Credentials.cpp:148
std::string pw_passwd
Unused currently.
Definition: Credentials.h:160
bool GetEGID(gid_t *egid)
Get the effective group ID.
Definition: Credentials.cpp:106
bool SetGroups(size_t size, const gid_t *list)
Set the supplementary group ID's of the process.
Definition: Credentials.cpp:158
bool GetPasswdUID(uid_t uid, PasswdEntry *passwd)
Lookup a user account by UID.
Definition: Credentials.cpp:258
std::string gr_name
name of the group
Definition: Credentials.h:215
uid_t pw_uid
real User ID
Definition: Credentials.h:163
std::string gr_passwd
password for the group
Definition: Credentials.h:220
Contains information about a group.
Definition: Credentials.h:213
std::string pw_name
name of the user
Definition: Credentials.h:157
bool GetGID(gid_t *gid)
Get the real Group ID.
Definition: Credentials.cpp:91
bool GetUID(uid_t *uid)
Get the real UID of the process.
Definition: Credentials.cpp:61
gid_t pw_gid
real Group ID
Definition: Credentials.h:166
std::string pw_shell
user's shell program
Definition: Credentials.h:172
bool SetUID(uid_t new_uid)
Set the effective UID of the process.
Definition: Credentials.cpp:121
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
bool GetPasswdName(const string &name, PasswdEntry *passwd)
Lookup a user account by username.
Definition: Credentials.cpp:243
Contains information about a user.
Definition: Credentials.h:155
std::string pw_dir
user's home directory
Definition: Credentials.h:169
bool GetGroupName(const string &name, GroupEntry *group_entry)
Lookup a group account by name.
Definition: Credentials.cpp:336
bool GetGroupGID(gid_t gid, GroupEntry *group_entry)
Lookup a group account by GID.
Definition: Credentials.cpp:351