mirror of
https://github.com/sheumann/hush.git
synced 2025-01-04 22:34:37 +00:00
Patch from Nick Fedchik to fixup paths in busybox/libpwdgrp
which were not properly using the bb_path_*_file strings.
This commit is contained in:
parent
7d72e796d6
commit
ef73d3b5d9
@ -30,7 +30,7 @@ struct group *getgrgid(const gid_t gid)
|
|||||||
struct group *group;
|
struct group *group;
|
||||||
int grp_fd;
|
int grp_fd;
|
||||||
|
|
||||||
if ((grp_fd = open("/etc/group", 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 = __getgrent(grp_fd)) != NULL)
|
||||||
|
@ -36,7 +36,7 @@ struct group *getgrnam(const char *name)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((grp_fd = open("/etc/group", 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 = __getgrent(grp_fd)) != NULL)
|
||||||
|
@ -37,7 +37,7 @@ struct passwd *getpwnam(const char *name)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((passwd_fd = open("/etc/passwd", O_RDONLY)) < 0)
|
if ((passwd_fd = open(bb_path_passwd_file, O_RDONLY)) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
while ((passwd = __getpwent(passwd_fd)) != NULL)
|
while ((passwd = __getpwent(passwd_fd)) != NULL)
|
||||||
|
@ -30,7 +30,7 @@ struct passwd *getpwuid(uid_t uid)
|
|||||||
int passwd_fd;
|
int passwd_fd;
|
||||||
struct passwd *passwd;
|
struct passwd *passwd;
|
||||||
|
|
||||||
if ((passwd_fd = open("/etc/passwd", O_RDONLY)) < 0)
|
if ((passwd_fd = open(bb_path_passwd_file, O_RDONLY)) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
while ((passwd = __getpwent(passwd_fd)) != NULL)
|
while ((passwd = __getpwent(passwd_fd)) != NULL)
|
||||||
|
@ -36,7 +36,7 @@ void setgrent(void)
|
|||||||
{
|
{
|
||||||
if (grp_fd != -1)
|
if (grp_fd != -1)
|
||||||
close(grp_fd);
|
close(grp_fd);
|
||||||
grp_fd = open("/etc/group", O_RDONLY);
|
grp_fd = open(bb_path_group_file, O_RDONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void endgrent(void)
|
void endgrent(void)
|
||||||
|
@ -79,7 +79,7 @@ int initgroups(__const char *user, gid_t gid)
|
|||||||
int grp_fd;
|
int grp_fd;
|
||||||
|
|
||||||
|
|
||||||
if ((grp_fd = open("/etc/group", O_RDONLY)) < 0)
|
if ((grp_fd = open(bb_path_group_file, O_RDONLY)) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
num_groups = 0;
|
num_groups = 0;
|
||||||
|
@ -40,7 +40,7 @@ void setpwent(void)
|
|||||||
if (pw_fd != -1)
|
if (pw_fd != -1)
|
||||||
close(pw_fd);
|
close(pw_fd);
|
||||||
|
|
||||||
pw_fd = open("/etc/passwd", O_RDONLY);
|
pw_fd = open(bb_path_passwd_file, O_RDONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void endpwent(void)
|
void endpwent(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user