浏览代码

update to 1.42

master
belliash 7 年前
父节点
当前提交
e78f534d4d
共有 2 个文件被更改,包括 5 次插入6 次删除
  1. +4
    -4
      kuhttpd.c
  2. +1
    -2
      kuhttpd.h

+ 4
- 4
kuhttpd.c 查看文件

@ -1308,7 +1308,7 @@ int main(int argc, char** argv) {
language = DEFAULT_LANGUAGE;
p3p = (char*) 0;
max_age = -1;
user = DEFAULT_USER;
user = NULL;
hostname = (char*) 0;
logfile = (char*) 0;
pidfile = (char*) 0;
@ -1429,7 +1429,7 @@ int main(int argc, char** argv) {
}
}
if(getuid() == 0) {
if(getuid() == 0 && user != NULL) {
pwd = getpwnam(user);
if(pwd == (struct passwd*) 0) {
syslog(LOG_CRIT, "unknown user - '%s'", user);
@ -1533,7 +1533,7 @@ int main(int argc, char** argv) {
tzset();
if(getuid() == 0) {
if(getuid() == 0 && user != NULL) {
if(setgroups(0, (gid_t*) 0) < 0) {
syslog(LOG_CRIT, "setgroups - %m");
perror("setgroups");
@ -1568,7 +1568,7 @@ int main(int argc, char** argv) {
exit(1);
}
}
if(getuid() == 0) {
if(getuid() == 0 && user != NULL) {
if(setuid(uid) < 0) {
syslog(LOG_CRIT, "setuid - %m");
perror("setuid");

+ 1
- 2
kuhttpd.h 查看文件

@ -22,7 +22,6 @@
#define DEFAULT_CHARSET "UTF-8"
#define DEFAULT_LANGUAGE "english"
#define DEFAULT_CGI_PATTERN "cgi-bin/**|**.cgi|**.sh"
#define DEFAULT_USER "nobody"
#define CGI_NICE 10
#define CGI_PATH "/usr/local/bin:/usr/ucb:/bin:/usr/bin:/usr/local/sbin:/sbin:/usr/sbin"
#define CGI_LD_LIBRARY_PATH "/usr/local/lib:/usr/lib:/lib"
@ -35,7 +34,7 @@
#define METHOD_HEAD 2
#define METHOD_POST 3
#define SERVER_SOFTWARE "Kagera uHTTP Daemon 1.41"
#define SERVER_SOFTWARE "Kagera uHTTP Daemon 1.42"
struct mime_entry {
char* ext;

正在加载...
取消
保存