summaryrefslogtreecommitdiff
path: root/usr.sbin/httpd
AgeCommit message (Collapse)Author
2015-12-12Remove a needless inclusion of sys/cdefs.h. Inspired by reyk's recentmmcc
commit doing the same.
2015-12-07No need to check for NULL before free().mmcc
2015-12-07Add imsg "peerid" to debug messages (only within -DDEBUG).Reyk Floeter
2015-12-07sync with vmdReyk Floeter
2015-12-05EAGAIN handling for imsg_read. OK henning@ benno@Claudio Jeker
2015-12-03Remove unnecessary NULL checks before free().Reyk Floeter
From Jan Schreiber
2015-12-03the grammar can prompt DNS lookups, so pledge "dns" also.Theo de Raadt
from Gregor Best, discussed with florian
2015-12-02sync with relayd, use proc_compose()Reyk Floeter
2015-11-23Retire socket_set_blockmode() in favor of the SOCK_NONBLOCK type flag.Reyk Floeter
As done in iked and snmpd. OK jung@
2015-11-23Sync proc.c with iked.Reyk Floeter
2015-11-22Update log.c: change fatal() and fatalx() into variadic functions,Reyk Floeter
include the process name, and replace all calls of fatal*(NULL) with fatal(__func__) for better debugging. OK benno@
2015-11-21Once again, fix the license text. After many years, we just cannotReyk Floeter
get rid of the "LOSS OF MIND" joke. Haha. We keep on removing it and it shows up again because it accidentally gets synced from somewhere else. bgpd and ospfd don't have it anymore, but their offsprings still carry it. If you see it, remove it, and, in the OpenBSD ISC case, use the original text from /usr/share/misc/license.template. All authors agree.
2015-11-21Move local logging functions into httpd.c, and sync log.c with relayd -Reyk Floeter
both daemons are now sharing the same file. No functional changes.
2015-11-19Simplify all instances of get_string() and get_data() using malloc() andmmcc
strndup(). ok millert@
2015-11-05pledge(2) for httpd.Florian Obser
1) The main process listens on sockets and accepts connections. It creates and opens log files, creates and kills child processes. On start up and on receiving a HUP signal it parses the configuration. It passes on file descriptors for logging or requests to it's children. 2) The logger process writes log messages to a file descriptor passed in from the main process. 3) The server process reads the request from a file descriptor passed in from the main process. It reads a file or creates a directory index to send a response. Additionally this process handles fastcgi requests. It connects to AF_UNIX, AF_INET or AF_INET6 sockets. A re-factoring might make it possible to drop the additional fastcgi privileges when only static files are served. with deraadt@ some time ago prodding & OK deraadt@ tweaks and OK reyk@
2015-10-31revert -r1.42 as it breaks slowcgi and php-fpm setups as reported by jturnerJoerg Jung
2015-10-28Remove a few more NULL-checks before free.mmcc
2015-10-28While I'm in here, drop a NULL-check before free.mmcc
2015-10-26fix PATH_INFO for / requestsJoerg Jung
diff from Denis Fondras ok reyk
2015-10-14Two more char -> unsigned char in ctype functions.Reyk Floeter
2015-10-13Plug a leak.Sunil Nimmagadda
Ok gilles@, reyk@
2015-10-13Pass unsigned chars to ctype functions.Reyk Floeter
From Michael McConville
2015-10-08fix an fd leak if socket connection fails; from Carlin BinghamJonathan Gray
ok reyk@
2015-10-08fix a typo; from Carlin BinghamJonathan Gray
2015-09-11Fix server_handshake_tls() - we should only call server_input() in the caseJoel Sing
where the handshake has successfully completed. ok beck@
2015-09-10fix return type for tls_read/writeBob Beck
jointly with jsing@
2015-09-10fix after libtls api changesBob Beck
ok jsing@
2015-09-10Update httpd to call tls_handshake() after tls_accept_socket().Joel Sing
ok beck@
2015-09-07Fix a regression that was introduced with server.c r1.64: Do NOT freeReyk Floeter
srv_conf->auth in serverconfig_free() because it was not allocated in config_getserver() but assigned as a reference by id from a global list that is maintained independently. This fixes a potential double-free. This fix also makes srv_conf->auth "const" to emphasize that the read-only auth pointer was not allocated here. OK jsing@
2015-08-21The WebDAV MOVE method was not included in the switch statementReyk Floeter
handling the HTTP methods in server_http.c which resulted in a 405 method not allowed error when trying to use it. Fix by jaminh on github
2015-08-20stdlib.h is in scope; do not cast malloc/calloc/realloc*Theo de Raadt
ok millert krw
2015-08-20Change httpd(8) to use C99-style fixed-width integers (uintN_t insteadReyk Floeter
of u_intN_t) and replace u_int with unsigned int. Mixing both variants is a bad style and most contributors seem to prefer this style; it also helps us to get used to it, portability, and standardization. Theoretically no binary change, except one in practice: httpd.o has a different checksum because gcc with -O2 pads/optimizes "struct privsep" differently when using "unsigned int" instead "u_int" for the affected members. "u_int" is just a typedef of "unsigned int", -O0 doesn't build the difference and clang with -O2 doesn't do it either - it is just another curiosity from gcc-land. OK semarie@
2015-08-19spacingReyk Floeter
2015-08-18str_match() checked the return value of str_find_aux() incorrectly: itReyk Floeter
might return a negative number; the return value of match_error() which returns (-1). This was technically a bug, and it exists in 5.8, but there is no impact because the error is correctly catched with the returned non-NULL error string. Found by Leandro Pereira
2015-08-03Fix rev 1.70 of server.c by only re-enabling the bufferevent if weFlorian Obser
previously disabled it because we were reading to fast (from disk). Problem noted and tracked down to that commit by weerd@ and independently by stsp@. Tested by weerd@, stsp@, reyk@ OK bluhm@, reyk@
2015-07-31repair hsts header output, wrong format strings caused brokenSebastian Benoit
Strict-Transport-Security headers. Add __format__ attribute to kv_set() and kv_setkey() to make it easier to spot such problems. Found by and fix from Donovan Watteau <tsoomi -AT- gmail -DOT- com>, thanks for your help. ok deraadt@
2015-07-29backout the previous: it broke wordpress somehow.Reyk Floeter
we need more care to find a proper fix for the fastcgi headers. acknowledged by deraadt@
2015-07-29Read fcgi response records until we have the whole http header and canFlorian Obser
parse it. Otherwise http headers can leak into the body. Pointed out by Jean-Philippe Ouellet on bugs@ Thanks! OK reyk, commit ASAP deraadt@
2015-07-28add HSTS to fcgi responsesFlorian Obser
OK reyk
2015-07-23The realm in authenticate directive of config file isn't escaped for '"' char.Sebastien Marie
The diff corrects this problem by using VIS_DQ. ok reyk@ florian@
2015-07-20ensure http_path is escaped before using it in Location redirection.Sebastien Marie
OK reyk@
2015-07-19handle error returns from bufferevent_write()Bret Lambert
ok florian@
2015-07-19For the completeness of HSTS, add the non-standard preload option.Reyk Floeter
OK florian@
2015-07-18remove XXX and handle error return from evbuffer_add()Bret Lambert
ok florian@
2015-07-18libtls has been changed to set SSL_MODE_ENABLE_PARTIAL_WRITE andReyk Floeter
SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER by default. This gives tls_write() a similar short write semantics as write(2) and a workaround in httpd to cope with the previous differences can be removed. Specifically, httpd can stop copying data into a local buffer that was used to keep it around for repeated writes. OK bluhm@
2015-07-18treat asprintf failure in REQUEST_URI case as a fatal errorBret Lambert
ok florian@
2015-07-18Fix check against NULL which was reverted by accident in r1.56.Matthias Kilian
ok reyk@
2015-07-18tweak previous;Jason McIntyre
2015-07-18Allow to change the default media type globally or per-location,Reyk Floeter
eg. default type text/html. OK florian@
2015-07-18Implement HTTP Strict Transport Security (HSTS).Florian Obser
Input & OK reyk