aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-10-29 10:30:54 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-10-29 10:30:54 +0000
commite7368f16fac4ace9474090c9d1f58a145db92650 (patch)
tree2921b5f27c978f163ba61cc00ea3b2a7327abf8d
parent58f3c2e01ee5c5d7f70ee3701b160c0e9d6e6e52 (diff)
downloadbusybox-w32-e7368f16fac4ace9474090c9d1f58a145db92650.tar.gz
busybox-w32-e7368f16fac4ace9474090c9d1f58a145db92650.tar.bz2
busybox-w32-e7368f16fac4ace9474090c9d1f58a145db92650.zip
id: better wording in comments, no code changes
-rw-r--r--coreutils/id.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/coreutils/id.c b/coreutils/id.c
index b00532f83..001595f67 100644
--- a/coreutils/id.c
+++ b/coreutils/id.c
@@ -84,7 +84,7 @@ static int get_groups(const char *username, gid_t rgid, gid_t *groups, int *n)
84 //if (*n < 0) 84 //if (*n < 0)
85 // return 0; 85 // return 0;
86 //return m; 86 //return m;
87 //commented here, happens below anyway 87 //commented out here, happens below anyway
88 } else { 88 } else {
89 /* On error -1 is returned, which ends up in *n */ 89 /* On error -1 is returned, which ends up in *n */
90 int nn = getgroups(*n, groups); 90 int nn = getgroups(*n, groups);
@@ -152,9 +152,9 @@ int id_main(int argc UNUSED_PARAM, char **argv)
152 if (egid != rgid) 152 if (egid != rgid)
153 status |= print_group(egid, " "); 153 status |= print_group(egid, " ");
154 } 154 }
155 /* We'd rather try supplying largish buffer than 155 /* We are supplying largish buffer, trying
156 * having get_groups() run twice. That might be slow 156 * to not run get_groups() twice. That might be slow
157 * (think about "user database in remove SQL server" case) */ 157 * ("user database in remote SQL server" case) */
158 groups = xmalloc(64 * sizeof(gid_t)); 158 groups = xmalloc(64 * sizeof(gid_t));
159 n = 64; 159 n = 64;
160 if (get_groups(username, rgid, groups, &n) < 0) { 160 if (get_groups(username, rgid, groups, &n) < 0) {
@@ -171,14 +171,14 @@ int id_main(int argc UNUSED_PARAM, char **argv)
171 status |= print_group(groups[i], opt ? " " : prefix); 171 status |= print_group(groups[i], opt ? " " : prefix);
172 prefix = ","; 172 prefix = ",";
173 } 173 }
174 if (ENABLE_FEATURE_CLEAN_UP)
175 free(groups);
176 } else if (n < 0) { /* error in get_groups() */ 174 } else if (n < 0) { /* error in get_groups() */
177 if (!ENABLE_DESKTOP) 175 if (!ENABLE_DESKTOP)
178 bb_error_msg_and_die("cannot get groups"); 176 bb_error_msg_and_die("cannot get groups");
179 else 177 else
180 return EXIT_FAILURE; 178 return EXIT_FAILURE;
181 } 179 }
180 if (ENABLE_FEATURE_CLEAN_UP)
181 free(groups);
182#if ENABLE_SELINUX 182#if ENABLE_SELINUX
183 if (is_selinux_enabled()) { 183 if (is_selinux_enabled()) {
184 if (getcon(&scontext) == 0) 184 if (getcon(&scontext) == 0)