Patch from Nick Fedchik to fixup paths in busybox/libpwdgrp
authorEric Andersen <andersen@codepoet.org>
Sat, 26 Jul 2003 07:48:13 +0000 (07:48 -0000)
committerEric Andersen <andersen@codepoet.org>
Sat, 26 Jul 2003 07:48:13 +0000 (07:48 -0000)
which were not properly using the bb_path_*_file strings.

libpwdgrp/getgrgid.c
libpwdgrp/getgrnam.c
libpwdgrp/getpwnam.c
libpwdgrp/getpwuid.c
libpwdgrp/grent.c
libpwdgrp/initgroups.c
libpwdgrp/pwent.c

index 73f0cca97c372eca0967e3c029af9366991b269b..7ffe8c5c319289ca046e2e5a5a10b3a5997f1c32 100644 (file)
@@ -30,7 +30,7 @@ struct group *getgrgid(const gid_t gid)
        struct group *group;
        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;
 
        while ((group = __getgrent(grp_fd)) != NULL)
index 919622ea183fdcbb52e180afb60c27dae1247ecf..bf7f7646d6fe284ac3c86e5d935f61e6de403e4a 100644 (file)
@@ -36,7 +36,7 @@ struct group *getgrnam(const char *name)
                return NULL;
        }
 
-       if ((grp_fd = open("/etc/group", O_RDONLY)) < 0)
+       if ((grp_fd = open(bb_path_group_file, O_RDONLY)) < 0)
                return NULL;
 
        while ((group = __getgrent(grp_fd)) != NULL)
index 524fa09bea4ca23bb5ef8729e1b25a43740414fc..013f155bc2f125192fc5bc23712c90b4d4563bb5 100644 (file)
@@ -37,7 +37,7 @@ struct passwd *getpwnam(const char *name)
                return NULL;
        }
 
-       if ((passwd_fd = open("/etc/passwd", O_RDONLY)) < 0)
+       if ((passwd_fd = open(bb_path_passwd_file, O_RDONLY)) < 0)
                return NULL;
 
        while ((passwd = __getpwent(passwd_fd)) != NULL)
index 7a04b67ca11d88bcdaef2a375b6876c9bcc51d63..bae6e15e63b9d2986ab380dc783ac881c023d119 100644 (file)
@@ -30,7 +30,7 @@ struct passwd *getpwuid(uid_t uid)
        int passwd_fd;
        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;
 
        while ((passwd = __getpwent(passwd_fd)) != NULL)
index df91955998937c1c9227aa71769b26c815a1f18c..609ed1a46bdf361f1d1ab7c31e125bd2be35a73f 100644 (file)
@@ -36,7 +36,7 @@ void setgrent(void)
 {
        if (grp_fd != -1)
                close(grp_fd);
-       grp_fd = open("/etc/group", O_RDONLY);
+       grp_fd = open(bb_path_group_file, O_RDONLY);
 }
 
 void endgrent(void)
index f86b5a8f43a412278d8061e096b0d8c055ec67ab..ce63adb1826bf041d02009ab036e3bb0f63ccf3f 100644 (file)
@@ -79,7 +79,7 @@ int initgroups(__const char *user, gid_t gid)
        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;
 
        num_groups = 0;
index 4a80093e84ad3fbf861da7efc35e8b6ba1108639..f7f8581f3e8ca12bd35de90f7bc6b2254fc121bf 100644 (file)
@@ -40,7 +40,7 @@ void setpwent(void)
        if (pw_fd != -1)
                close(pw_fd);
 
-       pw_fd = open("/etc/passwd", O_RDONLY);
+       pw_fd = open(bb_path_passwd_file, O_RDONLY);
 }
 
 void endpwent(void)