mirror of
https://github.com/sheumann/hush.git
synced 2024-12-27 16:31:24 +00:00
rename __getgrent so that it doesn't conflict with some libc's
This commit is contained in:
parent
4e864a36b6
commit
f796700cf0
@ -32,7 +32,7 @@ extern struct group * fgetgrent __P ((FILE * file));
|
|||||||
extern int setgroups __P ((size_t n, __const gid_t * groups));
|
extern int setgroups __P ((size_t n, __const gid_t * groups));
|
||||||
extern int initgroups __P ((__const char * user, gid_t gid));
|
extern int initgroups __P ((__const char * user, gid_t gid));
|
||||||
|
|
||||||
extern struct group * __getgrent __P ((int grp_fd));
|
extern struct group * bb_getgrent __P ((int grp_fd));
|
||||||
|
|
||||||
#endif /* USE_SYSTEM_PWD_GRP */
|
#endif /* USE_SYSTEM_PWD_GRP */
|
||||||
#endif /* __CONFIG_GRP_H */
|
#endif /* __CONFIG_GRP_H */
|
||||||
|
@ -71,7 +71,7 @@
|
|||||||
* getgrent() except that it is passed a file descriptor. getgrent()
|
* getgrent() except that it is passed a file descriptor. getgrent()
|
||||||
* is just a wrapper for this function.
|
* is just a wrapper for this function.
|
||||||
*/
|
*/
|
||||||
struct group *__getgrent(int grp_fd)
|
struct group *bb_getgrent(int grp_fd)
|
||||||
{
|
{
|
||||||
#ifndef GR_SCALE_DYNAMIC
|
#ifndef GR_SCALE_DYNAMIC
|
||||||
static char line_buff[GR_MAX_LINE_LEN];
|
static char line_buff[GR_MAX_LINE_LEN];
|
||||||
|
@ -31,5 +31,5 @@ struct group *fgetgrent(FILE * file)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return __getgrent(fileno(file));
|
return bb_getgrent(fileno(file));
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ struct group *getgrgid(const gid_t gid)
|
|||||||
if ((grp_fd = open(bb_path_group_file, O_RDONLY)) < 0)
|
if ((grp_fd = open(bb_path_group_file, O_RDONLY)) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
while ((group = __getgrent(grp_fd)) != NULL)
|
while ((group = bb_getgrent(grp_fd)) != NULL)
|
||||||
if (group->gr_gid == gid) {
|
if (group->gr_gid == gid) {
|
||||||
close(grp_fd);
|
close(grp_fd);
|
||||||
return group;
|
return group;
|
||||||
|
@ -39,7 +39,7 @@ struct group *getgrnam(const char *name)
|
|||||||
if ((grp_fd = open(bb_path_group_file, O_RDONLY)) < 0)
|
if ((grp_fd = open(bb_path_group_file, O_RDONLY)) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
while ((group = __getgrent(grp_fd)) != NULL)
|
while ((group = bb_getgrent(grp_fd)) != NULL)
|
||||||
if (!strcmp(group->gr_name, name)) {
|
if (!strcmp(group->gr_name, name)) {
|
||||||
close(grp_fd);
|
close(grp_fd);
|
||||||
return group;
|
return group;
|
||||||
|
@ -50,5 +50,5 @@ struct group *getgrent(void)
|
|||||||
{
|
{
|
||||||
if (grp_fd == -1)
|
if (grp_fd == -1)
|
||||||
return NULL;
|
return NULL;
|
||||||
return __getgrent(grp_fd);
|
return bb_getgrent(grp_fd);
|
||||||
}
|
}
|
||||||
|
@ -89,9 +89,9 @@ int initgroups(__const char *user, gid_t gid)
|
|||||||
group_list[num_groups] = gid;
|
group_list[num_groups] = gid;
|
||||||
#ifndef GR_DYNAMIC_GROUP_LIST
|
#ifndef GR_DYNAMIC_GROUP_LIST
|
||||||
while (num_groups < GR_MAX_GROUPS &&
|
while (num_groups < GR_MAX_GROUPS &&
|
||||||
(group = __getgrent(grp_fd)) != NULL)
|
(group = bb_getgrent(grp_fd)) != NULL)
|
||||||
#else
|
#else
|
||||||
while ((group = __getgrent(grp_fd)) != NULL)
|
while ((group = bb_getgrent(grp_fd)) != NULL)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (group->gr_gid != gid)
|
if (group->gr_gid != gid)
|
||||||
|
Loading…
Reference in New Issue
Block a user