diff options
Diffstat (limited to 'networking')
-rw-r--r-- | networking/httpd.c | 6 | ||||
-rw-r--r-- | networking/inetd.c | 13 |
2 files changed, 8 insertions, 11 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index 620e680..5e6037c 100644 --- a/networking/httpd.c +++ b/networking/httpd.c @@ -2340,7 +2340,7 @@ int httpd_main(int argc ATTRIBUTE_UNUSED, char **argv) #if ENABLE_FEATURE_HTTPD_SETUID if (opt & OPT_SETUID) { if (!get_uidgid(&ugid, s_ugid, 1)) - bb_error_msg_and_die("unrecognized user[:group] " + bb_error_msg_and_die("unknown user[:group] " "name '%s'", s_ugid); } #endif @@ -2389,10 +2389,8 @@ int httpd_main(int argc ATTRIBUTE_UNUSED, char **argv) #if ENABLE_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP if (!(opt & OPT_INETD)) sighup_handler(0); - else /* do not install HUP handler in inetd mode */ #endif - index_page = "index.html"; - parse_conf(default_path_httpd_conf, FIRST_PARSE); + parse_conf(default_path_httpd_conf, FIRST_PARSE); xfunc_error_retval = 0; if (opt & OPT_INETD) diff --git a/networking/inetd.c b/networking/inetd.c index b931aa1..5cdfe0a 100644 --- a/networking/inetd.c +++ b/networking/inetd.c @@ -142,15 +142,15 @@ /* Here's the scoop concerning the user[:group] feature: * 1) group is not specified: * a) user = root: NO setuid() or setgid() is done - * b) other: setgid(primary group as found in passwd) - * initgroups(name, primary group) + * b) other: initgroups(name, primary group) + * setgid(primary group as found in passwd) * setuid() * 2) group is specified: * a) user = root: setgid(specified group) * NO initgroups() * NO setuid() - * b) other: setgid(specified group) - * initgroups(name, specified group) + * b) other: initgroups(name, specified group) + * setgid(specified group) * setuid() */ @@ -1383,9 +1383,8 @@ int inetd_main(int argc ATTRIBUTE_UNUSED, char **argv) if (pwd->pw_uid) { if (sep->se_group) pwd->pw_gid = grp->gr_gid; - xsetgid(pwd->pw_gid); - initgroups(pwd->pw_name, pwd->pw_gid); - xsetuid(pwd->pw_uid); + /* initgroups, setgid, setuid: */ + change_identity(pwd); } else if (sep->se_group) { xsetgid(grp->gr_gid); setgroups(1, &grp->gr_gid); |