inetd: use change_identity().

libbb: shrink our internal initgroups().
httpd: remove stray 'else' and 'index_page = "index.html"'

function                                             old     new   delta
httpd_main                                           750     743      -7
inetd_main                                          2033    2011     -22
bb_internal_initgroups                               251     228     -23
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-52)             Total: -52 bytes
This commit is contained in:
Denis Vlasenko
2008-03-20 15:12:58 +00:00
parent c52248e41c
commit 9230582315
4 changed files with 18 additions and 30 deletions

View File

@@ -35,7 +35,7 @@ void change_identity(const struct passwd *pw)
{
if (initgroups(pw->pw_name, pw->pw_gid) == -1)
bb_perror_msg_and_die("can't set groups");
endgrent(); /* ?? */
endgrent(); /* helps to close a fd used internally by libc */
xsetgid(pw->pw_gid);
xsetuid(pw->pw_uid);
}