diff options
author | Rob Landley <rob@landley.net> | 2006-08-03 15:41:12 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-08-03 15:41:12 +0000 |
commit | d921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch) | |
tree | e4a2769349867c441cf2983d83097bb66701a733 /loginutils/addgroup.c | |
parent | 6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff) | |
download | busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.gz busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.bz2 busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.zip |
Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only
had one user), clean up lots of #includes... General cleanup pass. What I've
been doing for the last couple days.
And it conflicts! I've removed httpd.c from this checkin due to somebody else
touching that file. It builds for me. I have to catch a bus. (Now you know
why I'm looking forward to Mercurial.)
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 |