Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.152
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
src /
php-7.4.33 /
sapi /
fpm /
fpm /
Delete
Unzip
Name
Size
Permission
Date
Action
events
[ DIR ]
drwxrwxr-x
2022-10-31 11:36
fpm.c
2.78
KB
-rw-rw-r--
2022-10-31 11:36
fpm.h
1.07
KB
-rw-rw-r--
2022-10-31 11:36
fpm_arrays.h
1.76
KB
-rw-rw-r--
2022-10-31 11:36
fpm_atomic.h
3.9
KB
-rw-rw-r--
2022-10-31 11:36
fpm_children.c
11.38
KB
-rw-rw-r--
2022-10-31 11:36
fpm_children.h
857
B
-rw-rw-r--
2022-10-31 11:36
fpm_cleanup.c
782
B
-rw-rw-r--
2022-10-31 11:36
fpm_cleanup.h
452
B
-rw-rw-r--
2022-10-31 11:36
fpm_clock.c
2.17
KB
-rw-rw-r--
2022-10-31 11:36
fpm_clock.h
175
B
-rw-rw-r--
2022-10-31 11:36
fpm_conf.c
51.25
KB
-rw-rw-r--
2022-10-31 11:36
fpm_conf.h
2.5
KB
-rw-rw-r--
2022-10-31 11:36
fpm_config.h
2.04
KB
-rw-rw-r--
2022-10-31 11:36
fpm_env.c
5.39
KB
-rw-rw-r--
2022-10-31 11:36
fpm_env.h
428
B
-rw-rw-r--
2022-10-31 11:36
fpm_events.c
12.4
KB
-rw-rw-r--
2022-10-31 11:36
fpm_events.h
1.53
KB
-rw-rw-r--
2022-10-31 11:36
fpm_log.c
11.46
KB
-rw-rw-r--
2022-10-31 11:36
fpm_log.h
227
B
-rw-rw-r--
2022-10-31 11:36
fpm_main.c
59.7
KB
-rw-rw-r--
2022-10-31 11:36
fpm_php.c
6.03
KB
-rw-rw-r--
2022-10-31 11:36
fpm_php.h
1.14
KB
-rw-rw-r--
2022-10-31 11:36
fpm_php_trace.c
4.67
KB
-rw-rw-r--
2022-10-31 11:36
fpm_php_trace.h
162
B
-rw-rw-r--
2022-10-31 11:36
fpm_process_ctl.c
13.81
KB
-rw-rw-r--
2022-10-31 11:36
fpm_process_ctl.h
1.16
KB
-rw-rw-r--
2022-10-31 11:36
fpm_request.c
7.94
KB
-rw-rw-r--
2022-10-31 11:36
fpm_request.h
1.13
KB
-rw-rw-r--
2022-10-31 11:36
fpm_scoreboard.c
8.05
KB
-rw-rw-r--
2022-10-31 11:36
fpm_scoreboard.h
2.45
KB
-rw-rw-r--
2022-10-31 11:36
fpm_shm.c
1.17
KB
-rw-rw-r--
2022-10-31 11:36
fpm_shm.h
200
B
-rw-rw-r--
2022-10-31 11:36
fpm_signals.c
7.02
KB
-rw-rw-r--
2022-10-31 11:36
fpm_signals.h
361
B
-rw-rw-r--
2022-10-31 11:36
fpm_sockets.c
12.96
KB
-rw-rw-r--
2022-10-31 11:36
fpm_sockets.h
1009
B
-rw-rw-r--
2022-10-31 11:36
fpm_status.c
17.63
KB
-rw-rw-r--
2022-10-31 11:36
fpm_status.h
1.05
KB
-rw-rw-r--
2022-10-31 11:36
fpm_stdio.c
9.02
KB
-rw-rw-r--
2022-10-31 11:36
fpm_stdio.h
604
B
-rw-rw-r--
2022-10-31 11:36
fpm_str.h
421
B
-rw-rw-r--
2022-10-31 11:36
fpm_systemd.c
3.1
KB
-rw-rw-r--
2022-10-31 11:36
fpm_systemd.h
274
B
-rw-rw-r--
2022-10-31 11:36
fpm_trace.c
524
B
-rw-rw-r--
2022-10-31 11:36
fpm_trace.h
313
B
-rw-rw-r--
2022-10-31 11:36
fpm_trace_mach.c
1.92
KB
-rw-rw-r--
2022-10-31 11:36
fpm_trace_pread.c
1.1
KB
-rw-rw-r--
2022-10-31 11:36
fpm_trace_ptrace.c
1.53
KB
-rw-rw-r--
2022-10-31 11:36
fpm_unix.c
16.22
KB
-rw-rw-r--
2022-10-31 11:36
fpm_unix.h
454
B
-rw-rw-r--
2022-10-31 11:36
fpm_worker_pool.c
1.74
KB
-rw-rw-r--
2022-10-31 11:36
fpm_worker_pool.h
1.23
KB
-rw-rw-r--
2022-10-31 11:36
zlog.c
21.7
KB
-rw-rw-r--
2022-10-31 11:36
zlog.h
3.58
KB
-rw-rw-r--
2022-10-31 11:36
Save
Rename
/* (c) 2007,2008 Andrei Nigmatulin */ #include "fpm_config.h" #include <sys/types.h> #include <sys/stat.h> #include <string.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> #include "php_syslog.h" #include "fpm.h" #include "fpm_children.h" #include "fpm_cleanup.h" #include "fpm_events.h" #include "fpm_sockets.h" #include "fpm_stdio.h" #include "zlog.h" static int fd_stdout[2]; static int fd_stderr[2]; int fpm_stdio_init_main() /* {{{ */ { int fd = open("/dev/null", O_RDWR); if (0 > fd) { zlog(ZLOG_SYSERROR, "failed to init stdio: open(\"/dev/null\")"); return -1; } if (0 > dup2(fd, STDIN_FILENO) || 0 > dup2(fd, STDOUT_FILENO)) { zlog(ZLOG_SYSERROR, "failed to init stdio: dup2()"); close(fd); return -1; } close(fd); return 0; } /* }}} */ static inline int fpm_use_error_log() { /* {{{ */ /* * the error_log is NOT used when running in foreground * and from a tty (user looking at output). * So, error_log is used by * - SysV init launch php-fpm as a daemon * - Systemd launch php-fpm in foreground */ #if HAVE_UNISTD_H if (fpm_global_config.daemonize || (!isatty(STDERR_FILENO) && !fpm_globals.force_stderr)) { #else if (fpm_global_config.daemonize) { #endif return 1; } return 0; } /* }}} */ int fpm_stdio_init_final() /* {{{ */ { if (fpm_use_error_log()) { /* prevent duping if logging to syslog */ if (fpm_globals.error_log_fd > 0 && fpm_globals.error_log_fd != STDERR_FILENO) { /* there might be messages to stderr from other parts of the code, we need to log them all */ if (0 > dup2(fpm_globals.error_log_fd, STDERR_FILENO)) { zlog(ZLOG_SYSERROR, "failed to init stdio: dup2()"); return -1; } } #ifdef HAVE_SYSLOG_H else if (fpm_globals.error_log_fd == ZLOG_SYSLOG) { /* dup to /dev/null when using syslog */ dup2(STDOUT_FILENO, STDERR_FILENO); } #endif } zlog_set_launched(); return 0; } /* }}} */ int fpm_stdio_init_child(struct fpm_worker_pool_s *wp) /* {{{ */ { #ifdef HAVE_SYSLOG_H if (fpm_globals.error_log_fd == ZLOG_SYSLOG) { closelog(); /* ensure to close syslog not to interrupt with PHP syslog code */ } else #endif /* Notice: child cannot use master error_log * because not aware when being reopen * else, should use if (!fpm_use_error_log()) */ if (fpm_globals.error_log_fd > 0) { close(fpm_globals.error_log_fd); } fpm_globals.error_log_fd = -1; zlog_set_fd(-1); return 0; } /* }}} */ #define FPM_STDIO_CMD_FLUSH "\0fscf" int fpm_stdio_flush_child() /* {{{ */ { return write(STDERR_FILENO, FPM_STDIO_CMD_FLUSH, sizeof(FPM_STDIO_CMD_FLUSH)); } /* }}} */ static void fpm_stdio_child_said(struct fpm_event_s *ev, short which, void *arg) /* {{{ */ { static const int max_buf_size = 1024; int fd = ev->fd; char buf[max_buf_size]; struct fpm_child_s *child; int is_stdout; struct fpm_event_s *event; int in_buf = 0, cmd_pos = 0, pos, start; int read_fail = 0, create_log_stream; struct zlog_stream *log_stream; if (!arg) { return; } child = (struct fpm_child_s *)arg; is_stdout = (fd == child->fd_stdout); if (is_stdout) { event = &child->ev_stdout; } else { event = &child->ev_stderr; } create_log_stream = !child->log_stream; if (create_log_stream) { log_stream = child->log_stream = malloc(sizeof(struct zlog_stream)); zlog_stream_init_ex(log_stream, ZLOG_WARNING, STDERR_FILENO); zlog_stream_set_decorating(log_stream, child->wp->config->decorate_workers_output); zlog_stream_set_wrapping(log_stream, ZLOG_TRUE); zlog_stream_set_msg_prefix(log_stream, STREAM_SET_MSG_PREFIX_FMT, child->wp->config->name, (int) child->pid, is_stdout ? "stdout" : "stderr"); zlog_stream_set_msg_quoting(log_stream, ZLOG_TRUE); zlog_stream_set_is_stdout(log_stream, is_stdout); zlog_stream_set_child_pid(log_stream, (int)child->pid); } else { log_stream = child->log_stream; // if fd type (stdout/stderr) or child's pid is changed, // then the stream will be finished and msg's prefix will be reinitialized if (log_stream->is_stdout != (unsigned int)is_stdout || log_stream->child_pid != (int)child->pid) { zlog_stream_finish(log_stream); zlog_stream_set_msg_prefix(log_stream, STREAM_SET_MSG_PREFIX_FMT, child->wp->config->name, (int) child->pid, is_stdout ? "stdout" : "stderr"); zlog_stream_set_is_stdout(log_stream, is_stdout); zlog_stream_set_child_pid(log_stream, (int)child->pid); } } while (1) { stdio_read: in_buf = read(fd, buf, max_buf_size - 1); if (in_buf <= 0) { /* no data */ if (in_buf == 0 || (errno != EAGAIN && errno != EWOULDBLOCK)) { /* pipe is closed or error */ read_fail = (in_buf < 0) ? in_buf : 1; } break; } start = 0; if (cmd_pos > 0) { if ((sizeof(FPM_STDIO_CMD_FLUSH) - cmd_pos) <= in_buf && !memcmp(buf, &FPM_STDIO_CMD_FLUSH[cmd_pos], sizeof(FPM_STDIO_CMD_FLUSH) - cmd_pos)) { zlog_stream_finish(log_stream); start = cmd_pos; } else { zlog_stream_str(log_stream, &FPM_STDIO_CMD_FLUSH[0], cmd_pos); } cmd_pos = 0; } for (pos = start; pos < in_buf; pos++) { switch (buf[pos]) { case '\n': zlog_stream_str(log_stream, buf + start, pos - start); zlog_stream_finish(log_stream); start = pos + 1; break; case '\0': if (pos + sizeof(FPM_STDIO_CMD_FLUSH) <= in_buf) { if (!memcmp(buf + pos, FPM_STDIO_CMD_FLUSH, sizeof(FPM_STDIO_CMD_FLUSH))) { zlog_stream_str(log_stream, buf + start, pos - start); zlog_stream_finish(log_stream); start = pos + sizeof(FPM_STDIO_CMD_FLUSH); pos = start - 1; } } else if (!memcmp(buf + pos, FPM_STDIO_CMD_FLUSH, in_buf - pos)) { cmd_pos = in_buf - pos; zlog_stream_str(log_stream, buf + start, pos - start); goto stdio_read; } break; } } if (start < pos) { zlog_stream_str(log_stream, buf + start, pos - start); } } if (read_fail) { if (create_log_stream) { zlog_stream_set_msg_suffix(log_stream, NULL, ", pipe is closed"); zlog_stream_finish(log_stream); } if (read_fail < 0) { zlog(ZLOG_SYSERROR, "unable to read what child say"); } fpm_event_del(event); if (is_stdout) { close(child->fd_stdout); child->fd_stdout = -1; } else { close(child->fd_stderr); child->fd_stderr = -1; } } } /* }}} */ int fpm_stdio_prepare_pipes(struct fpm_child_s *child) /* {{{ */ { if (0 == child->wp->config->catch_workers_output) { /* not required */ return 0; } if (0 > pipe(fd_stdout)) { zlog(ZLOG_SYSERROR, "failed to prepare the stdout pipe"); return -1; } if (0 > pipe(fd_stderr)) { zlog(ZLOG_SYSERROR, "failed to prepare the stderr pipe"); close(fd_stdout[0]); close(fd_stdout[1]); return -1; } if (0 > fd_set_blocked(fd_stdout[0], 0) || 0 > fd_set_blocked(fd_stderr[0], 0)) { zlog(ZLOG_SYSERROR, "failed to unblock pipes"); close(fd_stdout[0]); close(fd_stdout[1]); close(fd_stderr[0]); close(fd_stderr[1]); return -1; } return 0; } /* }}} */ int fpm_stdio_parent_use_pipes(struct fpm_child_s *child) /* {{{ */ { if (0 == child->wp->config->catch_workers_output) { /* not required */ return 0; } close(fd_stdout[1]); close(fd_stderr[1]); child->fd_stdout = fd_stdout[0]; child->fd_stderr = fd_stderr[0]; fpm_event_set(&child->ev_stdout, child->fd_stdout, FPM_EV_READ, fpm_stdio_child_said, child); fpm_event_add(&child->ev_stdout, 0); fpm_event_set(&child->ev_stderr, child->fd_stderr, FPM_EV_READ, fpm_stdio_child_said, child); fpm_event_add(&child->ev_stderr, 0); return 0; } /* }}} */ int fpm_stdio_discard_pipes(struct fpm_child_s *child) /* {{{ */ { if (0 == child->wp->config->catch_workers_output) { /* not required */ return 0; } close(fd_stdout[1]); close(fd_stderr[1]); close(fd_stdout[0]); close(fd_stderr[0]); return 0; } /* }}} */ void fpm_stdio_child_use_pipes(struct fpm_child_s *child) /* {{{ */ { if (child->wp->config->catch_workers_output) { dup2(fd_stdout[1], STDOUT_FILENO); dup2(fd_stderr[1], STDERR_FILENO); close(fd_stdout[0]); close(fd_stdout[1]); close(fd_stderr[0]); close(fd_stderr[1]); } else { /* stdout of parent is always /dev/null */ dup2(STDOUT_FILENO, STDERR_FILENO); } } /* }}} */ int fpm_stdio_open_error_log(int reopen) /* {{{ */ { int fd; #ifdef HAVE_SYSLOG_H if (!strcasecmp(fpm_global_config.error_log, "syslog")) { php_openlog(fpm_global_config.syslog_ident, LOG_PID | LOG_CONS, fpm_global_config.syslog_facility); fpm_globals.error_log_fd = ZLOG_SYSLOG; if (fpm_use_error_log()) { zlog_set_fd(fpm_globals.error_log_fd); } return 0; } #endif fd = open(fpm_global_config.error_log, O_WRONLY | O_APPEND | O_CREAT, S_IRUSR | S_IWUSR); if (0 > fd) { zlog(ZLOG_SYSERROR, "failed to open error_log (%s)", fpm_global_config.error_log); return -1; } if (reopen) { if (fpm_use_error_log()) { dup2(fd, STDERR_FILENO); } dup2(fd, fpm_globals.error_log_fd); close(fd); fd = fpm_globals.error_log_fd; /* for FD_CLOSEXEC to work */ } else { fpm_globals.error_log_fd = fd; if (fpm_use_error_log()) { zlog_set_fd(fpm_globals.error_log_fd); } } if (0 > fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC)) { zlog(ZLOG_WARNING, "failed to change attribute of error_log"); } return 0; } /* }}} */