MentOS
0.8.0
The Mentoring Operating System
|
Functions | |
static void | __parse_line (group_t *grp, char *buf) |
It parses the line (as string) and saves its content inside the group_t structure. More... | |
static int | __search_entry (int fd, char *buf, size_t buflen, const char *name, gid_t gid) |
Searches an entry in /etc/group . More... | |
group_t * | getgrgid (gid_t gid) |
Provides access to the group database entry for uid . More... | |
group_t * | getgrnam (const char *name) |
Provides access to the group database entry for name . More... | |
int | getgrgid_r (gid_t gid, group_t *group, char *buf, size_t buflen, group_t **result) |
Provides the same information as getgrgid but it stores the results inside group, and the string information are store store inside buf . More... | |
int | getgrnam_r (const char *name, group_t *group, char *buf, size_t buflen, group_t **result) |
Provides the same information as getgrnam but it stores the results inside group, and the string information are store store inside buf . More... | |
group_t * | getgrent (void) |
Returns a pointer to a structure containing the broken-out fields of an entry in the group database. More... | |
void | endgrent (void) |
Rewinds the group database to allow repeated searches. | |
void | setgrent (void) |
May be called to close the group database when processing is complete. | |
Variables | |
static int | __fd = -1 |
Holds the file descriptor while we are working with /etc/group . | |
|
inlinestatic |
It parses the line (as string) and saves its content inside the group_t structure.
grp | the struct where we store the information. |
buf | the line from which we extract the information. |
|
inlinestatic |
Searches an entry in /etc/group
.
fd | the file descriptor pointing to /etc/group . |
buf | the buffer we are going to use to search the entry. |
buflen | the length of the buffer. |
name | the name we are looking for. |
gid | the group id we must match. |
group_t* getgrent | ( | void | ) |
Returns a pointer to a structure containing the broken-out fields of an entry in the group database.
When first called returns a pointer to a group structure containing the first entry in the group database. Thereafter, it returns a pointer to a group structure containing the next group structure in the group database, so successive calls may be used to search the entire database.
Provides access to the group database entry for uid
.
gid | The gid to search inside the database. |
Provides the same information as getgrgid but it stores the results inside group, and the string information are store store inside buf
.
gid | The uid to search inside the database. |
group | The structure containing pointers to the entry fields. |
buf | The buffer where the strings should be stored. |
buflen | The lenght of the buffer. |
result | A pointer to the result or NULL is stored here. |
group_t* getgrnam | ( | const char * | name | ) |
Provides access to the group database entry for name
.
name | The name to search inside the database. |
Provides the same information as getgrnam but it stores the results inside group, and the string information are store store inside buf
.
name | The name to search inside the database. |
group | The structure containing pointers to the entry fields. |
buf | The buffer where the strings should be stored. |
buflen | The lenght of the buffer. |
result | A pointer to the result or NULL is stored here. |