diff options
Diffstat (limited to 'loginutils/addgroup.c')
-rw-r--r-- | loginutils/addgroup.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c index f4962ffb9..f5a99b796 100644 --- a/loginutils/addgroup.c +++ b/loginutils/addgroup.c | |||
@@ -9,11 +9,6 @@ | |||
9 | * | 9 | * |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <stdio.h> | ||
13 | #include <string.h> | ||
14 | #include <sys/types.h> | ||
15 | #include <unistd.h> | ||
16 | |||
17 | #include "busybox.h" | 12 | #include "busybox.h" |
18 | 13 | ||
19 | /* make sure gr_name isn't taken, make sure gid is kosher | 14 | /* make sure gr_name isn't taken, make sure gid is kosher |
@@ -26,7 +21,7 @@ static int group_study(struct group *g) | |||
26 | struct group *grp; | 21 | struct group *grp; |
27 | const int max = 65000; | 22 | const int max = 65000; |
28 | 23 | ||
29 | etc_group = bb_xfopen(bb_path_group_file, "r"); | 24 | etc_group = xfopen(bb_path_group_file, "r"); |
30 | 25 | ||
31 | /* make sure gr_name isn't taken, make sure gid is kosher */ | 26 | /* make sure gr_name isn't taken, make sure gid is kosher */ |
32 | desired = g->gr_gid; | 27 | desired = g->gr_gid; |
@@ -67,13 +62,13 @@ static int addgroup(char *group, gid_t gid, const char *user) | |||
67 | return 1; | 62 | return 1; |
68 | 63 | ||
69 | /* add entry to group */ | 64 | /* add entry to group */ |
70 | file = bb_xfopen(bb_path_group_file, "a"); | 65 | file = xfopen(bb_path_group_file, "a"); |
71 | /* group:passwd:gid:userlist */ | 66 | /* group:passwd:gid:userlist */ |
72 | fprintf(file, "%s:%s:%d:%s\n", group, "x", gr.gr_gid, user); | 67 | fprintf(file, "%s:%s:%d:%s\n", group, "x", gr.gr_gid, user); |
73 | fclose(file); | 68 | fclose(file); |
74 | 69 | ||
75 | #if ENABLE_FEATURE_SHADOWPASSWDS | 70 | #if ENABLE_FEATURE_SHADOWPASSWDS |
76 | file = bb_xfopen(bb_path_gshadow_file, "a"); | 71 | file = xfopen(bb_path_gshadow_file, "a"); |
77 | fprintf(file, "%s:!::\n", group); | 72 | fprintf(file, "%s:!::\n", group); |
78 | fclose(file); | 73 | fclose(file); |
79 | #endif | 74 | #endif |