reyk [Sat, 2 Aug 2014 09:46:51 +0000 (09:46 +0000)]
scandir(3)-based directory auto index didn't work on NFS because the
file system is not filling in d_type properly. Using st_mode from the
stat call fixes the problem, eg. S_ISDIR(st.st_mode) instead of
dp->d_type == DT_DIR. Pointed out by pelikan@
jmc [Sat, 2 Aug 2014 08:07:07 +0000 (08:07 +0000)]
remove nasty unclosed Xo in previous; ok reyk
reyk [Fri, 1 Aug 2014 22:24:05 +0000 (22:24 +0000)]
Use the log buffer to defer the logging until the connection is closed
or the request completed. Turn the old log message into a debug message.
ok doug@
reyk [Fri, 1 Aug 2014 21:59:56 +0000 (21:59 +0000)]
remove the global "log updates/all" option that came from relayd.
doug [Fri, 1 Aug 2014 21:51:02 +0000 (21:51 +0000)]
Add common and combined access logging to httpd.
ok reyk@
florian [Fri, 1 Aug 2014 18:26:32 +0000 (18:26 +0000)]
Rewrite fcgi_add_param and hand over a lot more http headers etc. to
the cgi script.
OK reyk@
"blanket OK" for changes in httpd for the time beeing from deraadt@
florian [Fri, 1 Aug 2014 08:34:46 +0000 (08:34 +0000)]
Correctly parse fcgi records if we don't get the whole record in one
bufferevent_read().
Input/OK reyk@
rpe [Fri, 1 Aug 2014 04:57:01 +0000 (04:57 +0000)]
Don't return, just skip over non existing rc.conf or rc.conf.local file.
OK ajacoutot@ halex@
jsing [Fri, 1 Aug 2014 01:32:09 +0000 (01:32 +0000)]
When attempting to rebuild a softraid volume, use the actual data offset
from the volume metadata rather than the currently defined data offset.
This allows rebuilds to work correctly when the volume metadata has a
different data offset to that currently in use (for example, volumes
created prior to softraid gaining boot support).
Found the hard way by henning@
ok deraadt@
pelikan [Thu, 31 Jul 2014 19:49:25 +0000 (19:49 +0000)]
unbreak the build - e2fs_isave now needs the superblock.
pelikan [Thu, 31 Jul 2014 19:11:38 +0000 (19:11 +0000)]
always use the little-endian copy of a superblock.
Damn those memcpy-wrapping macros!
"do it" deraadt
jasper [Thu, 31 Jul 2014 18:14:46 +0000 (18:14 +0000)]
unbreak aac(4) by re-adding uvm_extern.h for ptoa()
ok deraadt@ sthen@
reyk [Thu, 31 Jul 2014 18:07:11 +0000 (18:07 +0000)]
Only write the HTTP header for the first fastcgi chunk.
reyk [Thu, 31 Jul 2014 17:55:09 +0000 (17:55 +0000)]
some fastcgi improvements:
- DPRINTF instead of log_info for internal debugging.
- submit QUERY_STRING, if it exists
- use a proper function to create an HTTP header.
- use server_file_error() to detect EOF and fastcgi stream errors.
- disable keep-alive/persist for now until we have a reliable way to
get the content length from the cgi response or support chunked
encoding.
"Cool, jep" florian@
pelikan [Thu, 31 Jul 2014 17:37:52 +0000 (17:37 +0000)]
use proper on-disk inode size: no more, no less.
Reported by Roman Yakovlev, thanks!
"do it now" deraadt
ajacoutot [Thu, 31 Jul 2014 14:57:41 +0000 (14:57 +0000)]
In debug mode, properly sort and drop duplicates so that we don't end
up with a confusing output like:
multicast_host >NO<
<...>
multicast_host >YES<
Also properly evaluate values _after_ running _rc_quirks() because these
can modify flags.
ok robert@ halex@
reyk [Thu, 31 Jul 2014 14:25:14 +0000 (14:25 +0000)]
One bufferevent can be shared by file and fcgi.
reyk [Thu, 31 Jul 2014 14:18:38 +0000 (14:18 +0000)]
Allow to specify a non-default fastcgi socket.
reyk [Thu, 31 Jul 2014 13:28:15 +0000 (13:28 +0000)]
Rename the "docroot" variable to "path" because it will be used for
either files or the fastcgi socket (and there's no need to use a union yet).
reyk [Thu, 31 Jul 2014 09:34:57 +0000 (09:34 +0000)]
Add a configuration variable "fastcgi" to enable it per server or location.
florian [Thu, 31 Jul 2014 09:23:53 +0000 (09:23 +0000)]
Put in first stab at fastcgi. Very early work in progress. Putting it
in now so that we can quickly work on it in tree. Requested by reyk@.
deraadt@ is OK with this according to reyk@.
deraadt [Wed, 30 Jul 2014 17:45:13 +0000 (17:45 +0000)]
sync
jsg [Wed, 30 Jul 2014 17:21:50 +0000 (17:21 +0000)]
unhook auxcpp
ajacoutot [Wed, 30 Jul 2014 16:54:09 +0000 (16:54 +0000)]
Properly warn when an example changes and the corresponding file is found
under /etc.
issue reported by Nathanael Rensen
"fine" deraadt@
jsg [Wed, 30 Jul 2014 16:46:17 +0000 (16:46 +0000)]
switch to tradcpp
jsg [Wed, 30 Jul 2014 16:34:24 +0000 (16:34 +0000)]
descend into tradcpp
jsg [Wed, 30 Jul 2014 16:33:11 +0000 (16:33 +0000)]
Add tradcpp 0.4, a standalone traditional whitespace preserving cpp
by David A. Holland of NetBSD.
reyk [Wed, 30 Jul 2014 13:49:48 +0000 (13:49 +0000)]
Make "location" work with name-based virtual servers.
ajacoutot [Wed, 30 Jul 2014 13:18:59 +0000 (13:18 +0000)]
Fix evil typo (multicast_hosts -> multicast_host).
espie [Wed, 30 Jul 2014 12:44:26 +0000 (12:44 +0000)]
prepare for post 5.6 packages, recognize special case where timestamp exist.
(specifically, this is a nop for 5.6, but it will allow changes to packages
without needing anything in pkg_add)
reyk [Wed, 30 Jul 2014 10:05:14 +0000 (10:05 +0000)]
Add "location" keyword to specify path-specific configuration in
servers, for example auto index for a sub-directory only. Internally,
a "location" is just a special type of a "virtual" server.
reyk [Wed, 30 Jul 2014 09:51:40 +0000 (09:51 +0000)]
Small fix and clarification
reyk [Wed, 30 Jul 2014 07:09:38 +0000 (07:09 +0000)]
Reserve an extra file descriptor per connection instead of per
request. This fixes fd accounting with persistent connections and
reduces the complexity of the implementation.
ok benno@
reyk [Tue, 29 Jul 2014 16:38:34 +0000 (16:38 +0000)]
The inflight decremented message should only be printed with DEBUG.
reyk [Tue, 29 Jul 2014 16:17:28 +0000 (16:17 +0000)]
Add extended directory index options: "[no] index" and "[no] auto index".
The option "directory auto index" implements basic directory listing
and is turned off by default.
ok deraadt@
deraadt [Tue, 29 Jul 2014 12:57:08 +0000 (12:57 +0000)]
disable POOL_DEBUG for release
deraadt [Tue, 29 Jul 2014 12:56:41 +0000 (12:56 +0000)]
move to -release mode
mpi [Tue, 29 Jul 2014 12:18:41 +0000 (12:18 +0000)]
Revert the checks about RTF_LOCAL routes.
Even if in the end we would like to be more strict about what userland
can do with kernel-managed route entries, most of the tools out there
are not yet ready for this. Since RTF_LOCAL routes are for the moment
just like RTF_LLINFO routes without expire timer, allow userland tools
to remove/modify them. In case they are missing, the good old cloning
mechanism will recreate what you need.
bluhm@ and deraadt@ agree.
reyk [Tue, 29 Jul 2014 12:16:36 +0000 (12:16 +0000)]
Move configurable TCP options into struct server_config.
blambert [Tue, 29 Jul 2014 08:51:49 +0000 (08:51 +0000)]
Fix a usage string; the proper spelling of 'alot' is 'a lot'.
ok bcook@
miod [Tue, 29 Jul 2014 02:57:09 +0000 (02:57 +0000)]
update sets sizes
krw [Mon, 28 Jul 2014 22:18:31 +0000 (22:18 +0000)]
Last (known) msgbuf_write() vs EOF fix.
ok gilles@ deraadt@
deraadt [Mon, 28 Jul 2014 20:35:32 +0000 (20:35 +0000)]
sync
bluhm [Mon, 28 Jul 2014 20:30:01 +0000 (20:30 +0000)]
I/O ktrace of sendsyslog(2) did not work. As uiomove() adjusts
iov_len to 0, we need a propper length calculation. While there,
use -1 for the file descriptor because 0 is reserved for stdin.
OK deraadt@ guenther@
miod [Mon, 28 Jul 2014 18:31:39 +0000 (18:31 +0000)]
On SPARCbook systems, the ledma device node has a `cable-selection' property
specifying which media the on-board interface uses. We already query it to
set up proper register values; extend this to be able to pass a default
media to the le(4) child.
This makes SPARCbook system default to AUI without needing for a manual media
change.
tested by sebastia@
tedu [Mon, 28 Jul 2014 17:57:18 +0000 (17:57 +0000)]
Remove SRP code. It contains a bug (this should not surprise anyone), but
the details are under embargo. The original plan was to wait for the
embargo to lift, but we've been waiting for quite some time, and there's no
indication of when or even if it will end. No sense in dragging this out
any longer.
The SRP code has never been enabled in OpenBSD, though I understand it is
in use by some other people. However, in light of this and other issues,
we're officially saying SRP is outside the scope of libressl. (For now.)
tobias [Mon, 28 Jul 2014 16:45:35 +0000 (16:45 +0000)]
Fix memory exhaustion occurring on DHCP options with 0 length.
halex@ and krw@ pointed out that a NULL check before free can go, too.
ok deraadt@, halex@, krw@
tobias [Mon, 28 Jul 2014 16:40:32 +0000 (16:40 +0000)]
merge dhcpd's packet.c revision 1.7:
Fix very hard to reach DoS attack vector, which would involve more than
8 billion network packets. Mixture of many many malformed and proper
packets could result in a division by zero.
ok krw@
schwarze [Mon, 28 Jul 2014 15:40:08 +0000 (15:40 +0000)]
some systems no longer need /dev/log;
issue noticed by jirib;
ok deraadt
jsg [Mon, 28 Jul 2014 15:00:27 +0000 (15:00 +0000)]
Limit the "aperture needed" printf to ramdisks via RAMDISK_HOOKS.
Originally with SMALL_KERNEL until sebastia@ pointed out that not
all ramdisks are built with SMALL_KERNEL.
ok deraadt@ kettenis@
kettenis [Mon, 28 Jul 2014 14:12:14 +0000 (14:12 +0000)]
Avoid matching a particular driver for "aperture needed" detection.
On sparc64 we also need to match machfb(4) in addition to vgafb(4) so let's
just match any driver.
ok halex@, deraadt@
kettenis [Mon, 28 Jul 2014 06:21:29 +0000 (06:21 +0000)]
Hardware supported by machfb(4) needs the aperture (for now) so make ramdisks
print a message to that extent such that the install scripts can do their
magic.
ok miod@, deraadt@
rpe [Mon, 28 Jul 2014 05:42:26 +0000 (05:42 +0000)]
Change detection of unconfigured vlan interfaces from using flags to
looking for vlan id and parent interface. This avoids the creation of
unconfigured vlan interface every time /install is restarted.
Noted by and OK miod@
OK krw@
Positive feedback sthen@ claudio@
guenther [Mon, 28 Jul 2014 04:28:43 +0000 (04:28 +0000)]
_dl_sigprocmask() works better when it actually saves the returned sigmask
asm suggestion from kettenis@
tested by miod@, suffering under the brain-destroying summer heat
guenther [Mon, 28 Jul 2014 04:23:12 +0000 (04:23 +0000)]
The RSA, DH, and ECDH temporary key callbacks expect the number of keybits
for the key (expressed in RSA key bits, which makes *no sense* for ECDH) as
their second argument, not zero.
(jsing@ notes that the RSA callback is only invoked for 'export' ciphers,
which have been removed from LibreSSL, and for the SSL_OP_EPHEMERAL_RSA
option, which is makes the application non-compliant. More fuel for the
tedu fire...)
jasper@ noted the breakage and bisected it down to the diff that broke this
ok jsing@ miod@
bcook [Mon, 28 Jul 2014 04:17:07 +0000 (04:17 +0000)]
remove non-portable __progname extern from arc4random unit test.
ok @deraadt
deraadt [Sun, 27 Jul 2014 23:52:05 +0000 (23:52 +0000)]
turn of -Werror, unless you are sure both gcc work...
guenther [Sun, 27 Jul 2014 23:46:51 +0000 (23:46 +0000)]
Link dependencies on libssl and libcrypto were missing.
OPENSSL_NO_RC5 is #defined in the #includes, so it's not needed here.
ok deraadt@
espie [Sun, 27 Jul 2014 22:19:18 +0000 (22:19 +0000)]
make sure makewhatis shows error messages without unsightly CODE() refs
espie [Sun, 27 Jul 2014 22:18:36 +0000 (22:18 +0000)]
- log libraries in a proper way
- mark wanted libraries, then run the db check.
Gives you a way to figure out when locate db are behind wrt pkgs
espie [Sun, 27 Jul 2014 22:17:33 +0000 (22:17 +0000)]
ensure log stuff happens, even without context
schwarze [Sun, 27 Jul 2014 21:53:04 +0000 (21:53 +0000)]
code readability; no functional change
schwarze [Sun, 27 Jul 2014 21:51:53 +0000 (21:51 +0000)]
Even for UTF-8 output, a non-breaking space character has the same width
as a normal space character, and not width 0. Bug reported by bentley@.
reyk [Sat, 26 Jul 2014 22:38:38 +0000 (22:38 +0000)]
Remove redundant slash
kettenis [Sat, 26 Jul 2014 16:07:39 +0000 (16:07 +0000)]
If we're stopping a secondary cpu, don't let sched_choosecpu() short-circuit
and return the current current CPU, otherwise sched_stop_secondary_cpus()
will spin forever trying to empty its run queues. Fixes hangs during suspend
that many people reported over the last couple of days.
ok bcook@, guenther@
mpi [Sat, 26 Jul 2014 10:48:59 +0000 (10:48 +0000)]
Revert "adjust -C algorithm to be more aggressive in scaling up" for
the moment, it triggers a race that breaks suspend/resume on some
machines.
ok tedu@, deraadt@, jsg@
reyk [Sat, 26 Jul 2014 10:27:19 +0000 (10:27 +0000)]
Add more examples. Requested by deraadt@
reyk [Sat, 26 Jul 2014 09:59:14 +0000 (09:59 +0000)]
bzero is over, memset is cool. pointed out by halex@
tobias [Sat, 26 Jul 2014 07:48:49 +0000 (07:48 +0000)]
Fix very hard to reach DoS attack vector, which would involve more than
8 billion network packets. Mixture of many many malformed and proper
packets could result in a division by zero.
ok krw@
reyk [Fri, 25 Jul 2014 23:30:58 +0000 (23:30 +0000)]
Differentiate servers by address and port, not just by address.
reyk [Fri, 25 Jul 2014 23:25:38 +0000 (23:25 +0000)]
Reset the default Host for each request
reyk [Fri, 25 Jul 2014 23:23:39 +0000 (23:23 +0000)]
It is recommended to use a URL in the Location header of 3xx
responses. To accomplish this, add some semantics to retrieve the
server host name of a connection: either IP, IP:PORT (if not 80) or
[IP6]:PORT, or Host value (if valid).
reyk [Fri, 25 Jul 2014 21:48:05 +0000 (21:48 +0000)]
Append mandatory Date header to each response.
reyk [Fri, 25 Jul 2014 21:36:37 +0000 (21:36 +0000)]
New HTTP/1.1 RFC 7231 prefers IMF-fixdate from RFC 5322.
reyk [Fri, 25 Jul 2014 21:29:58 +0000 (21:29 +0000)]
Canonicalize the request path once without the docroot and prepend the
docroot only only when it's needed. Suggested by deraadt@.
dtucker [Fri, 25 Jul 2014 21:22:03 +0000 (21:22 +0000)]
Clear buffer used for handling messages. This prevents keys being
left in memory after they have been expired or deleted in some cases
(but note that ssh-agent is setgid so you would still need root to
access them). Pointed out by Kevin Burns, ok deraadt
schwarze [Fri, 25 Jul 2014 21:05:38 +0000 (21:05 +0000)]
Choosing the right encoding is a tricky business...
Printing query strings for URIs *always* needs URI-encoding, and when
embedding the URI into an HTML document, it needs replacement of
the "&" separators by "&" *in addition to that*, not instead.
Delete the function html_primtquery(), it was completely wrong.
You can see the badness by entering "mandoc &sec=2" into the query input
box before this patch and click "Submit". You come to the right page at
first (...man.cgi?query=mandoc+%26sec%3D2&apropos=0&sec=0&...), but now
the link to mandoc(1) is wrong: ...mandoc.1?query=mandoc &sec=2&...
Clicking on that, the "&sec=2" disappears from the query input box and
suddenly you have the first dropdown set to "2 - System Calls". Oops.
reyk [Fri, 25 Jul 2014 20:13:06 +0000 (20:13 +0000)]
Don't leak docroot in the error message if the default index file is missing.
OK florian@
schwarze [Fri, 25 Jul 2014 20:08:49 +0000 (20:08 +0000)]
Sort the URI keys for .Xr links in the same order used by the search form,
and leave out the manpath when it is the default.
For building the HTML formatter options, do not use a static buffer.
schwarze [Fri, 25 Jul 2014 19:36:02 +0000 (19:36 +0000)]
oops, we must not try to validate a manpath we don't have;
fixing an oversight introduced in rev. 1.17
schwarze [Fri, 25 Jul 2014 18:19:33 +0000 (18:19 +0000)]
We cannot easily control the order of the QUERY_STRING keys generated
by the search form, it's just the order of the fields in the form.
Actually, that's not too bad; the generated URI resembles the
generating form.
To minimize confusion for people looking at URIs, give the keys
in the same order when generating URIs for search listings and
search redirections, the latter being used instead of search
listings that would have only one single entry. Also, if the
manpath is the default, remove it form the generated URIs.
schwarze [Fri, 25 Jul 2014 17:51:33 +0000 (17:51 +0000)]
In generated .Xr links, avoid double encoding of ampersands
and avoid empty arch= keys.
reyk [Fri, 25 Jul 2014 17:49:11 +0000 (17:49 +0000)]
Add multiple-servers "virtual hosts" example.
jasper [Fri, 25 Jul 2014 17:36:32 +0000 (17:36 +0000)]
fix perl5 architecture name
ok deraadt@
schwarze [Fri, 25 Jul 2014 17:33:51 +0000 (17:33 +0000)]
Even though this is not XHTML yet, remove some gratuitious violations
of XHTML syntax. Also add some cosmetic newlines to the HTML code.
reyk [Fri, 25 Jul 2014 17:04:47 +0000 (17:04 +0000)]
Add a single line to fix the address matching of multiple server blocks with
non-virtual hosts. I had this line in a previous diff.
schwarze [Fri, 25 Jul 2014 16:55:40 +0000 (16:55 +0000)]
The names of all other struct query memebers match the corresponding
QUERY_STRING keys, so rename "expr" to "query".
Also add some missing function prototypes.
No functional change.
schwarze [Fri, 25 Jul 2014 16:43:05 +0000 (16:43 +0000)]
clean up pg_show() to not modify a string returned from getenv(3)
reyk [Fri, 25 Jul 2014 16:23:19 +0000 (16:23 +0000)]
Add support for "virtual hosts" aka. server blocks aka. multiple
servers with the same or "overlapping" IP address but a different name.
ok beck@
schwarze [Fri, 25 Jul 2014 16:06:19 +0000 (16:06 +0000)]
Rewrite http_parse() completely:
1. Make sure the last occurrence of each key is used, even if
it is empty, in which case it resets the value to the default.
2. When there is an HTTP encoding error, skip the affected
key-value pair only, but not all subsequent key-value pairs.
3. Do not modify a string returned from getenv(3).
4. Do not assume the NULL pointer is all null bits.
reyk [Fri, 25 Jul 2014 15:47:11 +0000 (15:47 +0000)]
Add and document 'root' configuration option for the docroot.
jsing [Fri, 25 Jul 2014 14:04:51 +0000 (14:04 +0000)]
Add missing year to copyright.
reyk [Fri, 25 Jul 2014 13:10:18 +0000 (13:10 +0000)]
Split server and server_config.
reyk [Fri, 25 Jul 2014 12:46:23 +0000 (12:46 +0000)]
Rename a field, needed later, no functional change.
reyk [Fri, 25 Jul 2014 12:42:05 +0000 (12:42 +0000)]
Move the docroot into the server block.
doug [Fri, 25 Jul 2014 06:05:31 +0000 (06:05 +0000)]
BIO_free() returns immediately when the sole input is NULL.
Remove unnecessary NULL check.
ok miod@
dlg [Fri, 25 Jul 2014 01:34:29 +0000 (01:34 +0000)]
document the scheduler types and how to specify them.
some pointers from schwarze@
millert [Thu, 24 Jul 2014 22:57:10 +0000 (22:57 +0000)]
Mention UNIX-domain socket forwarding too. OK jmc@ deraadt@
mpi [Thu, 24 Jul 2014 22:38:19 +0000 (22:38 +0000)]
Speed up the boot sequence by deferring the scan of xt keyboard code set.
If you were wondering why there's a pause of 5 seconds after loading the
kernel and before seeing the copyright in blue when booting some of your
machines, well this is for you!
mlarkin@ found that this delay is caused by some code probing for xt scan
code tables when pckbd(4) initialize the console keyboard. So this diff
implements an idea from deraadt@ to only do the scan once, either during
*attach() or if we enter ddb> or ukc> before that!
ok miod@, mlarkin@, deraadt@, shadchin@
schwarze [Thu, 24 Jul 2014 20:30:38 +0000 (20:30 +0000)]
Sort result pages first by section number, then by name.
By moving the sort from cgi.c to mansearch.c, we get two advantages:
Easier access to the data needed for sorting, in particular the section
number, and the apropos(1) command line utility profits as well.
Feature requested by deraadt@.