Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 164325
Collapse All | Expand All

(-)lighttpd-1.4.13.orig/src/mod_fastcgi.c (+23 lines)
Lines 906-911 Link Here
906
			char *c;
906
			char *c;
907
			char_array env;
907
			char_array env;
908
			char_array arg;
908
			char_array arg;
909
			int fd;
909
910
910
			/* create environment */
911
			/* create environment */
911
			env.ptr = NULL;
912
			env.ptr = NULL;
Lines 922-927 Link Here
922
				close(fcgi_fd);
923
				close(fcgi_fd);
923
			}
924
			}
924
925
926
			/* HACK:
927
			 * This is not nice, but it works
928
			 *
929
			 * we feed the stderr of the FastCGI to our errorlog,
930
			 * for messages that were written to stderr by mistake.
931
			 *
932
			 * this violates the fastcgi SPEC because stderr
933
			 * should be closed and all errors are meant to be
934
			 * sent as FCGI_STDERR packets to the webserver and
935
			 * not written directly to the log.
936
			 */
937
938
			if ((srv->errorlog_mode == ERRORLOG_FILE) || (srv->errorlog_mode == ERRORLOG_PIPE)) {
939
				close(STDERR_FILENO);
940
				dup2(srv->errorlog_fd, STDERR_FILENO);
941
			} else {
942
				if (-1 != (fd = open("/dev/null", O_WRONLY))) {
943
					close(STDERR_FILENO);
944
					dup2(fd, STDERR_FILENO);
945
					close(fd);
946
				}
947
			}
925
			/* we don't need the client socket */
948
			/* we don't need the client socket */
926
			for (i = 3; i < 256; i++) {
949
			for (i = 3; i < 256; i++) {
927
				close(i);
950
				close(i);
(-)lighttpd-1.4.13.orig/src/server.c (-9 / +10 lines)
Lines 844-849 Link Here
844
		pid_fd = -1;
844
		pid_fd = -1;
845
	}
845
	}
846
846
847
	if (-1 == log_error_open(srv)) {
848
		log_error_write(srv, __FILE__, __LINE__, "s",
849
				"opening errorlog failed, dying");
850
851
		plugins_free(srv);
852
		network_close(srv);
853
		server_free(srv);
854
		return -1;
855
	}
856
847
	if (HANDLER_GO_ON != plugins_call_set_defaults(srv)) {
857
	if (HANDLER_GO_ON != plugins_call_set_defaults(srv)) {
848
		log_error_write(srv, __FILE__, __LINE__, "s", "Configuration of plugins failed. Going down.");
858
		log_error_write(srv, __FILE__, __LINE__, "s", "Configuration of plugins failed. Going down.");
849
859
Lines 894-908 Link Here
894
		return -1;
904
		return -1;
895
	}
905
	}
896
906
897
	if (-1 == log_error_open(srv)) {
898
		log_error_write(srv, __FILE__, __LINE__, "s",
899
				"opening errorlog failed, dying");
900
901
		plugins_free(srv);
902
		network_close(srv);
903
		server_free(srv);
904
		return -1;
905
	}
906
907
907
908
908
#ifdef HAVE_SIGACTION
909
#ifdef HAVE_SIGACTION

Return to bug 164325