Commit Graph

212 Commits

Author SHA1 Message Date
mrg
da548da125 update the -V documentation to be more clear about what it does.
inspired by Swift Griggs on netbsd-users.
2016-10-04 18:33:00 +00:00
mrg
5261f4fbc4 add -V to the usage() list. noted by Swift Griggs on netbsd-users. 2016-10-04 18:26:47 +00:00
schmonz
7ec9a291e1 Missed in previous: exit 1 if html_cmp says no match. 2016-09-26 00:21:22 +00:00
schmonz
268438cada Add a VERBOSE knob to the testsuite ("yes" by default, producing
basically the same output as before). When turned off, tests run
silently except when there's a failure.

Reviewed by mrg@.
2016-09-23 16:55:56 +00:00
mrg
bfef5cee0b use netbsd rcsid 2016-08-20 00:36:41 +00:00
shm
1202090c01 Do not send encoding header for compressed formats. 2016-07-19 09:27:40 +00:00
mrg
9d18868a64 avoid an impossible case the compiler can't quite tell. 2016-06-30 13:17:48 +00:00
agc
205633288c As proposed in:
http://mail-index.netbsd.org/tech-userlevel/2016/05/18/msg009999.html

and

	https://www.netbsd.org/~agc/bozo-20160517.diff

add a patch to httpd to return the version string of httpd itself, and use the
-G option on the command line to enable this. This gives httpd the ability to
show, from the command line, what version is running.

	% /usr/build/obj/x86_64/usr/src/libexec/httpd/bozohttpd -G
	bozohttpd version bozohttpd/20160415
	%
2016-05-24 21:18:29 +00:00
christos
f7945701d6 CID 1358679: Fix memory leak.
XXX: pullup 7
2016-04-24 18:24:47 +00:00
mrg
0a7cdc80ba use %zu instead of %lu for size_t. 2016-04-15 20:00:13 +00:00
mrg
27da98ff14 updates and bozohttpd 20160415:
o  add search-word support for CGI
o  fix a security issue in CGI suffix handler support which would
   allow remote code execution, from shm@netbsd.org
o  -C option supports now CGI scripts only
2016-04-15 17:57:21 +00:00
elric
591b978b80 Fix bug in cleanup of reply headers. 2016-01-02 20:35:59 +00:00
elric
afe55bf842 Add the concept of ``reply headers'', that is a SIMPLEQ of headers that
will be included in the HTTP reply.  We define this as we are about to
add an authentication method that may need to have a conversation with
the client.
2016-01-02 18:40:13 +00:00
mrg
0841a79ea3 bump the version; we have real fixes now. 2015-12-31 04:58:43 +00:00
mrg
614a8b6713 redo the fix for rev 1.26 - instead of getting a new string wrong,
just delay the free until the parent has finished using them.
also, free query as well.

fixes PR#50374.
2015-12-31 04:39:16 +00:00
mrg
84411b5891 rewrite the redirection url generation code to use bozoasprintf(). 2015-12-29 04:30:33 +00:00
mrg
c2e98309d5 - convert most asprintf() calls to bozoasprintf().
- don't call getpwuid(0) if we don't need to, or fail it it fails,
  and remove the 'username' member of bozohttpd_t since it is not
  used outside of bozo_setup().
2015-12-29 04:21:46 +00:00
mrg
881b8188de rename bozo_err/bozo_warn/bozo_asprintf to bozoerr/etc.
new rule is that function that mirror libc-style functions get no underscore.
2015-12-28 07:37:59 +00:00
mrg
cff2d95613 several clean ups:
- bozostrdup() gains a request parameter, and uses it to determine
  what sort of error handling is required
- bozo_strdup() dies
- size_arrays() reduced slightly, pushing error handling into the caller
- convert to size_t for some array indices
- bozo_set_pref() and bozo_init_prefs() gain httpd parameters
- apply a bunch of manual CSE to vastly reduce the number of times the
  string "request->hr_httpd" appears.
- CGI parse_header() takes a request not httpd now

XXX: lua glue updated to call bozo_init_prefs() with htttpd parameter,
     but i'm only guessing here.
2015-12-27 10:21:35 +00:00
mrg
71e7babf6d fix running the testsuite from the build tree 2015-12-27 07:43:39 +00:00
christos
f47ab3a37e Introduce bozo_strdup and bozo_asprintf to add error checking and reduce
code duplication.

Note that bozo_strdup is different that bozostrdup; the _ routines exit
loging error to syslog or stderr, whereas the non _ routines send error
responses to the http client.
2015-12-12 18:06:58 +00:00
christos
14ba256990 - restrict the default list of ciphers to something more secure
- restrict ssl options
From Travis Paul
2015-12-12 16:57:53 +00:00
kamil
d3f055bfc7 Improve the httpd(8) printenv.lua Lua example
Stop using Lua builtin print function and replace them with http.* ones.
httpd.print and http.write wraps SSL support when needed.

Print http headers, without them browser may interpret page as raw text.

No need to hardcode prefix path in the form.

Add comments for a user with tips how to use this script.

Patch by Travis Paul

Closes PR misc/50502
2015-12-07 03:11:48 +00:00
kamil
a2fa5fef62 Bump date for previous 2015-11-29 15:58:07 +00:00
kamil
1e3b6beb3f Synchronize SYNOPSIS with reality 2015-11-29 15:29:55 +00:00
kamil
55cd314790 Remove nonexistent option z: in the getopt(3) call 2015-11-29 15:26:10 +00:00
christos
59f3853f3e handle asprintf errors consistently. 2015-10-31 00:55:17 +00:00
christos
e3e5f7f09b fix wrong variable 2015-10-30 23:45:31 +00:00
christos
1932f6942a simplify 2015-10-30 23:27:47 +00:00
christos
b44c2ed92e - don't use alloca and then check if alloca returns null and then try to
free it. Allocating from the stack does not return null, and freeing it
  will have unpredictable results. use malloc instead.
- now we are using malloc remove -Wno-stack-protector kludge
2015-10-30 23:21:05 +00:00
tron
63d7176dc2 Fix build with "USE_SSP" set to "yes". 2015-10-30 18:53:26 +00:00
shm
c4fe1fac22 * add CGI support for ~user translation (-E switch)
* add redirects to ~user translation
* fix bugs around ~user translation
* add schema detection for absolute redirects
* fixed few memory leaks
* bunch of minor tweaks
* removed -r support
* smarter redirects

OK mrg@
2015-10-28 09:20:15 +00:00
mrg
ce12165d33 s/USE_NBUTIL/HAVE_NBUTIL_H/, to match the Makefile.
fixes a merge problem in introduced when merging the QNX patches.

from Jan Danielsson.
2015-10-25 19:06:49 +00:00
mrg
4ff1396ff2 s/dirname/dirpath/ to avoid potentially shadowing dirname(3). 2015-08-27 17:12:18 +00:00
wiz
9e1c9adfc5 Remove trailing space in boast. 2015-08-13 12:30:08 +00:00
shm
7d14271c4e Extend AUTHORS section. Nobody likes a braggart.
OK mrg@
2015-08-13 09:00:29 +00:00
mrg
e8204d05c3 on QNX, use nbutil.h. 2015-08-05 06:50:44 +00:00
shm
51b65afab5 Fix handling path with multiple slashes at the beginning
Fix redirections escaping for user support

OK mrg@
2015-07-16 12:19:23 +00:00
shm
5f066e934a Remove d_namelen as it's an BSD extension. Fix building bozohttpd on SunOS.
OK mrg@
2015-07-09 12:32:16 +00:00
christos
a6e4c202c0 fix memory leaks on error; found by brainy. 2015-07-04 22:39:23 +00:00
mrg
56ba1ad0cf fix content type handling to not hard code (wrong) values for length,
but just call strlen() as needed.  call this 20150501.

reported by Jan Danielsson for ".svg".
2015-05-02 11:35:48 +00:00
christos
46b8188b2d Fix deref "command" after "free(file)", from KIYOHARA Takashi 2015-04-19 19:05:19 +00:00
mrg
1d0520b606 install as bozohttpd/bozohttpd.8 as well as httpd. 2015-04-16 02:32:33 +00:00
mrg
4135f5d46d copyright maintenance, note shm@ in the manual and update the CHANGES
for recent changes.  call this 20150320.
2015-03-20 19:54:53 +00:00
mrg
bcc73e9553 don't quote /. it doesn't work. this should fix PR#49765. 2015-03-20 18:54:18 +00:00
snj
411a393d8d spit out a 403 not just when an open() fails with EPERM, but with
EACCES as well.
2015-01-27 04:20:23 +00:00
mrg
9e53ba939e more for the previous: make sure [i - 1] can never go negative. 2014-12-26 19:52:00 +00:00
mrg
7ce92dc944 properly handle ilen = 0 case, which could lead to array underflow.
pointed out by Maxime Villard.
2014-12-26 19:48:52 +00:00
wiz
c1a74a82ca Bring this man page back to this decade. 2014-12-25 18:56:28 +00:00
mrg
2b5d1d7deb call this 20141225. 2014-12-25 18:53:06 +00:00