mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-01 19:17:48 +08:00
Wrapped run_as_user into conditional
This commit is contained in:
parent
cf94fb3642
commit
2477f80a43
@ -213,7 +213,10 @@ enum {
|
|||||||
ACCESS_CONTROL_LIST, ACCESS_LOG_FILE, AUTH_DOMAIN, CGI_INTERPRETER,
|
ACCESS_CONTROL_LIST, ACCESS_LOG_FILE, AUTH_DOMAIN, CGI_INTERPRETER,
|
||||||
CGI_PATTERN, DAV_AUTH_FILE, DOCUMENT_ROOT, ENABLE_DIRECTORY_LISTING,
|
CGI_PATTERN, DAV_AUTH_FILE, DOCUMENT_ROOT, ENABLE_DIRECTORY_LISTING,
|
||||||
ERROR_LOG_FILE, EXTRA_MIME_TYPES, GLOBAL_AUTH_FILE, HIDE_FILES_PATTERN,
|
ERROR_LOG_FILE, EXTRA_MIME_TYPES, GLOBAL_AUTH_FILE, HIDE_FILES_PATTERN,
|
||||||
IDLE_TIMEOUT_MS, INDEX_FILES, LISTENING_PORT, RUN_AS_USER,
|
IDLE_TIMEOUT_MS, INDEX_FILES, LISTENING_PORT,
|
||||||
|
#ifndef _WIN32
|
||||||
|
RUN_AS_USER,
|
||||||
|
#endif
|
||||||
#ifdef USE_SSL
|
#ifdef USE_SSL
|
||||||
SSL_CERTIFICATE,
|
SSL_CERTIFICATE,
|
||||||
#endif
|
#endif
|
||||||
@ -345,7 +348,9 @@ static const char *static_config_options[] = {
|
|||||||
"idle_timeout_ms", "30000",
|
"idle_timeout_ms", "30000",
|
||||||
"index_files","index.html,index.htm,index.cgi,index.shtml,index.php,index.lp",
|
"index_files","index.html,index.htm,index.cgi,index.shtml,index.php,index.lp",
|
||||||
"listening_port", NULL,
|
"listening_port", NULL,
|
||||||
|
#ifndef _WIN32
|
||||||
"run_as_user", NULL,
|
"run_as_user", NULL,
|
||||||
|
#endif
|
||||||
#ifdef USE_SSL
|
#ifdef USE_SSL
|
||||||
"ssl_certificate", NULL,
|
"ssl_certificate", NULL,
|
||||||
#endif
|
#endif
|
||||||
@ -3626,8 +3631,8 @@ const char *mg_set_option(struct mg_server *server, const char *name,
|
|||||||
} else {
|
} else {
|
||||||
set_non_blocking_mode(server->listening_sock);
|
set_non_blocking_mode(server->listening_sock);
|
||||||
}
|
}
|
||||||
} else if (ind == RUN_AS_USER) {
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
} else if (ind == RUN_AS_USER) {
|
||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
if ((pw = getpwnam(value)) == NULL) {
|
if ((pw = getpwnam(value)) == NULL) {
|
||||||
error_msg = "Unknown user";
|
error_msg = "Unknown user";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user