deraadt [Tue, 22 Jul 2014 01:01:37 +0000 (01:01 +0000)]
sync
deraadt [Tue, 22 Jul 2014 00:41:19 +0000 (00:41 +0000)]
Pull in all the parts. Let's face the facts -- .PATH from other
parts of the tree is PAINFUL for basically everyone upstream, not
just for us in our own tree.
deraadt [Mon, 21 Jul 2014 23:34:54 +0000 (23:34 +0000)]
protect sysctl path with SYS__sysctl instead; from enh@google, ok bcook
matthew [Mon, 21 Jul 2014 23:05:12 +0000 (23:05 +0000)]
Add pthread_sigmask() and raise() to the list of async signal safe
functions, per POSIX Issue 7
ok deraadt
schwarze [Mon, 21 Jul 2014 22:32:55 +0000 (22:32 +0000)]
fix a minibug reported by kristaps@:
preserve manpath and arch in .Xr links
jasper [Mon, 21 Jul 2014 21:07:34 +0000 (21:07 +0000)]
- whitespace cleanups (trailing whitespace, indentation)
- minor code shuffling and rename a variable to reduce diff with wd.c
no binary change
nicm [Mon, 21 Jul 2014 20:45:35 +0000 (20:45 +0000)]
Revert the up/down wheel emulation for now, there will be a better way
to do this along later for those who want it.
naddy [Mon, 21 Jul 2014 20:43:00 +0000 (20:43 +0000)]
Bring back net.inet6.icmp6.rediraccept for rtsol. Pointed out by
bluhm@ three days ago, oops.
naddy [Mon, 21 Jul 2014 20:39:59 +0000 (20:39 +0000)]
net.inet6.ip6.accept_rtadv is gone
naddy [Mon, 21 Jul 2014 20:34:14 +0000 (20:34 +0000)]
Since net.inet6.ip6.accept_rtadv is gone, the installer shouldn't
set it. Provisionally drop net.inet6.icmp6.rediraccept, too.
guenther [Mon, 21 Jul 2014 20:19:47 +0000 (20:19 +0000)]
Use explicit_bzero() instead of memset() on buffers going out of scope.
Also, zero the SHA256 context.
suggested by "eric" in a comment on an opensslrampage.org post
ok miod@ deraadt@
deraadt [Mon, 21 Jul 2014 19:55:33 +0000 (19:55 +0000)]
don't try to be clever and name the _PATH_CP exec "mv", since this
breaks the instbin argv[0] mechanism
found by landry, ok guenther
schwarze [Mon, 21 Jul 2014 19:51:32 +0000 (19:51 +0000)]
use getlist() instead of hand-rolled equivalent, no functional change;
diff from Kent R. Spillner <kspillner at acm org>;
no objections came up when showing this diff on tech@
deraadt [Mon, 21 Jul 2014 19:15:56 +0000 (19:15 +0000)]
cast from void * before math; enh@google
deraadt [Mon, 21 Jul 2014 18:13:12 +0000 (18:13 +0000)]
missing newline
matthew [Mon, 21 Jul 2014 17:40:06 +0000 (17:40 +0000)]
Fix typo: s/lstate/lstat/
uebayasi [Mon, 21 Jul 2014 17:25:47 +0000 (17:25 +0000)]
boot(9): Reduce annoying style diffs
- Always use either: ((x & RB_XXX) != 0) or ((x & RB_XXX) == 0) in boolean
context (mostly if (x), or x ? y : z)
- prom_halt() in alpha is confirmed to take int as boolean
Converted by coccinelle. No functional change intended.
schwarze [Mon, 21 Jul 2014 15:44:22 +0000 (15:44 +0000)]
Kristaps points out that the current HTTP/1.1 draft standard (RFC
2616) requires the Location: response-header field to be an absolute
URI (14.30), and only the most recent proposed standard (RFC 7231),
which is barely a month old, allows a relative Location: (7.1.2).
While most modern browsers appear to support relative Location:
headers, some may not, and it's maybe a bit early to rely on relative
Location: headers.
I'm not going back to the HTTP_HOST or SERVER_NAME CGI variables,
though. While some CGI programs certainly require those, in which
case both the CGI programmer and the web server admin have to be
very careful to keep the system secure and reliable, man.cgi(8)
does not really need them. We always know at compile time which
domain we are running for, and for man.cgi(8), security and reliability
are definitely much more important than flexibility. So make HTTP_HOST
a compile-time definition for now.
naddy [Mon, 21 Jul 2014 12:33:58 +0000 (12:33 +0000)]
5.7 packages key
nicm [Mon, 21 Jul 2014 10:52:48 +0000 (10:52 +0000)]
lockf is entirely useless and it was a mistake to change to it, go back
to using flock which actually works sensibly. Also always retry the lock
to fix a potential race, and add some extra logging.
nicm [Mon, 21 Jul 2014 10:25:48 +0000 (10:25 +0000)]
Drop explicit support for F13-F20 and change to match the xterm terminfo
entry:
F13-F24 are S-F1 to S-F12
F25-F36 are C-F1 to C-F12
F37-F48 are C-S-F1 to C-S-F12
F49-F60 are M-F1 to M-F12
and F61-F63 are M-S-F1 to M-S-F3
This should be no difference for applications inside tmux, but means
that any key binding for F13 will need to be replaced by S-F1 and so on.
mlarkin [Mon, 21 Jul 2014 01:57:55 +0000 (01:57 +0000)]
fix some wrong comments and a bit of KNF
guenther [Mon, 21 Jul 2014 01:53:12 +0000 (01:53 +0000)]
printf(9) and friends don't support the <number>$ flags, so gcc's
kprintf attribute shouldn't accept them.
ok martynas@
guenther [Mon, 21 Jul 2014 01:51:10 +0000 (01:51 +0000)]
Switch from <sys/endian.h> or <machine/endian.h> to the new,
being-standardized <endian.h>
ok deraadt@ millert@ beck@
deraadt [Mon, 21 Jul 2014 00:11:24 +0000 (00:11 +0000)]
sync
deraadt [Mon, 21 Jul 2014 00:10:21 +0000 (00:10 +0000)]
5.7 base key
guenther [Sun, 20 Jul 2014 21:41:54 +0000 (21:41 +0000)]
Provide correct guidance on which header to use in the comments
bcook [Sun, 20 Jul 2014 20:51:13 +0000 (20:51 +0000)]
Move more OS-specific functionality to arc4random.h headers.
Move <sys/mman.h> and raise(SIGKILL) calls to OS-specific headers.
On OpenBSD, move thread_private.h as well to arc4random.h.
On Windows, use TerminateProcess on getentropy failure.
ok deraadt@
tobias [Sun, 20 Jul 2014 20:27:19 +0000 (20:27 +0000)]
Fixed typo in error message.
okay deraadt@
deraadt [Sun, 20 Jul 2014 20:12:41 +0000 (20:12 +0000)]
ask about lid
deraadt [Sun, 20 Jul 2014 20:08:44 +0000 (20:08 +0000)]
if we think this is a laptop (wsdisplay.....) ask a lidsuspend
question. Let's see who whines.
deraadt [Sun, 20 Jul 2014 19:47:53 +0000 (19:47 +0000)]
look up correct dev_t. This matters for the case where a device is
underlying softraid.
ok mlarkin
tobias [Sun, 20 Jul 2014 19:33:54 +0000 (19:33 +0000)]
Merge cmd.c from zboot into boot, dropping "clear" command while at it.
With input from deraadt@
okay jasper@, uebayashi@
bluhm [Sun, 20 Jul 2014 19:18:31 +0000 (19:18 +0000)]
A HTTP connection may have multiple requests with content. Allow
to specify an array of md5 hashes in the test arguments and check
all of them in the client and server log files. So test that relayd
does not modify the http body.
deraadt [Sun, 20 Jul 2014 18:24:34 +0000 (18:24 +0000)]
RB_MINIROOT is never checked by anything, so stop setting it.
deraadt [Sun, 20 Jul 2014 18:13:22 +0000 (18:13 +0000)]
match on vga1 or vgafb0, well, let's just call it vga.* for now
deraadt [Sun, 20 Jul 2014 18:10:15 +0000 (18:10 +0000)]
spacing glitches
mlarkin [Sun, 20 Jul 2014 18:05:21 +0000 (18:05 +0000)]
Support hibernating to softraid crypto volumes.
much help and ok from deraadt@
stsp [Sun, 20 Jul 2014 17:52:34 +0000 (17:52 +0000)]
Fix tcpdump(8) display of logical link control data in IEEE802 frames.
The frame subtype field is in the first byte of frame control but tcpdump(8)
was looking at the second byte to determine if this is a data frame.
Patch by Nathanael Rensen, thanks!
bcook [Sun, 20 Jul 2014 16:59:31 +0000 (16:59 +0000)]
initial win32 ARC4_LOCK/UNLOCK implementation.
It may make sense to later replace this with a Critical Section later.
ok guenther@
kettenis [Sun, 20 Jul 2014 12:20:38 +0000 (12:20 +0000)]
Skip reading bits from a region marked as "Preserve" if all bits will be
modified. Some Sony and Asus laptops don't like this; the read seems to
trigger an unwanted SMI that makes the machine hang. Diagnosed by mpi@
ok mpi@
guenther [Sun, 20 Jul 2014 12:08:55 +0000 (12:08 +0000)]
Eliminate silly call() routine that fakes up internal calls as if
the user typed in undocumented arguments by splitting two functions
and doing normal (shock!) C calls.
Move extern declarations to externs.h
Eliminate another function cast
stsp [Sun, 20 Jul 2014 11:59:12 +0000 (11:59 +0000)]
Always allocate bwi(4) ring descriptors below the 1GB boundary to give 30bit
devices a chance to work. Use bounce buffers for mbufs on 30bit devices.
This fixes "intr fatal TX/RX" errors that render the internal wifi on many
macppc machines unusable. However, packet loss problems remain. In my testing
the device works fine sometimes, but experiences packet loss rates of up
to 80% at other times. Still, this is a step forward.
Helpful hints from claudio@ and dlg@
Tested on macppc by mpi@ and myself
"go ahead" kettenis@, ok mpi@
stsp [Sun, 20 Jul 2014 11:57:49 +0000 (11:57 +0000)]
In bwi(4), don't declare an interrupt as unhandled in case the PHY TX error
bit is set. This interrupt condition is handled by resetting the device.
ok mpi@ as part of a larger diff
stsp [Sun, 20 Jul 2014 11:57:05 +0000 (11:57 +0000)]
Make bwi_dma_mbuf_create() use the correct loop counter in error case.
Bug inherited from DragonFly BSD.
ok mpi@ as part of a larger diff.
stsp [Sun, 20 Jul 2014 11:56:15 +0000 (11:56 +0000)]
Load bwi(4) firmware once, not every time the interface is brought up.
Fixes a panic if the interrupt handler decides to reset the device.
Firmware cannot be loaded in interrupt context.
ok mpi@ as part of a larger diff
guenther [Sun, 20 Jul 2014 11:20:52 +0000 (11:20 +0000)]
Fix array overflow in command line handling
guenther [Sun, 20 Jul 2014 10:55:26 +0000 (10:55 +0000)]
Mark a slurry of functions as static
Eliminate two more trivial wrappers
jsg [Sun, 20 Jul 2014 10:32:23 +0000 (10:32 +0000)]
use NULL instead of 0 when dealing with pointers
ok guenther@
guenther [Sun, 20 Jul 2014 10:18:10 +0000 (10:18 +0000)]
Kill lint comments; mark ExitString() as __dead
guenther [Sun, 20 Jul 2014 09:59:42 +0000 (09:59 +0000)]
Switch from memmove() to memcpy() where appropriate; simplify address
parsing logic; eliminate an inefficient use of MIN() macro
guenther [Sun, 20 Jul 2014 09:31:25 +0000 (09:31 +0000)]
VSUSP and SIGTSTP are required by POSIX
guenther [Sun, 20 Jul 2014 09:20:48 +0000 (09:20 +0000)]
Delete an insane chunk of code for handling broken poll() emulation.
Pass poll() INFTIM instead of -1
guenther [Sun, 20 Jul 2014 08:56:47 +0000 (08:56 +0000)]
Add prototypes to some function callbacks and fix the type errors that
this reveals.
Make NetTrace static to utilities.c
rpe [Sun, 20 Jul 2014 08:37:07 +0000 (08:37 +0000)]
Stop using the (now) internal rc.subr functions _rc_do() and _rc_wait().
- no need to start spamd in background mode
- return from rc_start() in case spamd failed to start
- execute spamd-setup without explicitly waiting for spamd
prodded by, discussed with and OK ajacoutot@
ajacoutot [Sun, 20 Jul 2014 08:19:59 +0000 (08:19 +0000)]
Fix auto-upgradable files detection.
from Nathanael Rensen, thanks!
guenther [Sun, 20 Jul 2014 08:12:45 +0000 (08:12 +0000)]
More encryption tentacles: intr_happened and intr_waiting vanish
Push more includes into .c files
Make ring.c only need ring.h
guenther [Sun, 20 Jul 2014 07:35:04 +0000 (07:35 +0000)]
Eliminate trivial wrappers TerminalWrite() and TerminalRead()
Replace TerminalFlushOutput() with tcflush().
Replace TerminalAutoFlush() with check of tty's NOFLSH flag as
documented in the manpage.
Push <netdb.h> into .c files
guenther [Sun, 20 Jul 2014 07:34:43 +0000 (07:34 +0000)]
Don't depend on <sys/param.h> for MAXPATHLEN
guenther [Sun, 20 Jul 2014 06:39:41 +0000 (06:39 +0000)]
Correctly cast to unsigned char for ctype functions/macros
Push <ctype.h> and <unistd.h> into the .c files
guenther [Sun, 20 Jul 2014 06:24:19 +0000 (06:24 +0000)]
ring_init() can't fail
KNF ring.h
guenther [Sun, 20 Jul 2014 05:35:14 +0000 (05:35 +0000)]
-8 is the default
guenther [Sun, 20 Jul 2014 05:29:39 +0000 (05:29 +0000)]
Don't need -I${.CURDIR}
guenther [Sun, 20 Jul 2014 05:22:02 +0000 (05:22 +0000)]
Simplify #includes, start pushing them into the .c files, eliminate
extern declarations from .c files that duplicate those in .h files,
start marking functions with __dead
deraadt [Sun, 20 Jul 2014 05:06:42 +0000 (05:06 +0000)]
correct unconfig: target; Jean-Philippe Ouellet
guenther [Sun, 20 Jul 2014 04:57:31 +0000 (04:57 +0000)]
tweak -W options
deraadt [Sun, 20 Jul 2014 04:29:07 +0000 (04:29 +0000)]
no longer play with /dev/log
guenther [Sun, 20 Jul 2014 04:22:34 +0000 (04:22 +0000)]
From ISO/IEC 9899:1999 and 9899:201x,
6.11.5 - Storage-class specifiers:
The placement of a storage-class specifier other than at the
beginning of the declaration specifiers in a declaration is
an obsolescent feature.
Diff from Jean-Philippe Ouellet (jean-philippe (at) ouellet.biz)
guenther [Sun, 20 Jul 2014 04:08:13 +0000 (04:08 +0000)]
Ooops, verbose_encrypt option is gone too.
Also stop assuming that csh is the only shell with job control
guenther [Sun, 20 Jul 2014 04:07:16 +0000 (04:07 +0000)]
The manpage claims the -a option uses getlogin(2), so do so. Also,
ignore its value if it returns a user that doesn't exit
guenther [Sun, 20 Jul 2014 04:00:47 +0000 (04:00 +0000)]
The only authentication info now is the login name
deraadt [Sun, 20 Jul 2014 03:24:10 +0000 (03:24 +0000)]
Demonstrate how new linux getrandom() will be called, at least until
it shows up in libraries. Even the system call is probably not finalized.
Bit dissapointed it has turned out to be a descriptor-less read() with
EINVAL and EINTR error conditions, but we can work with it.
deraadt [Sun, 20 Jul 2014 03:00:31 +0000 (03:00 +0000)]
remove a variable called wantencryption.
hahahahahahahahahha. OK, I'm done.
guenther [Sun, 20 Jul 2014 02:48:59 +0000 (02:48 +0000)]
This pulls in <ddb/db_output.h>, so don't redeclare ddb functions
deraadt [Sun, 20 Jul 2014 02:40:23 +0000 (02:40 +0000)]
Oddly, chmod chgrp chown were at the wrong path on these media.
from Jean-Philippe Ouellet
deraadt [Sun, 20 Jul 2014 02:37:35 +0000 (02:37 +0000)]
place sysctl in sorted order; Jean-Philippe Ouellet
deraadt [Sun, 20 Jul 2014 02:36:08 +0000 (02:36 +0000)]
arch was in wrong bin dir; Jean-Philippe Ouellet
guenther [Sun, 20 Jul 2014 02:24:21 +0000 (02:24 +0000)]
Mark the format string argument to BIO_*printf as not being allowed to be NULL
ok bcook@
guenther [Sun, 20 Jul 2014 02:03:21 +0000 (02:03 +0000)]
Make sure the correct errno is reported by warn* or err* and not
the errno of an intervening cleanup operation like close/unlink/etc.
Also, the format string for warn* and err* shouldn't end with a newline.
Diff from Doug Hogan (doug (at) acyclic.org)
guenther [Sun, 20 Jul 2014 01:58:37 +0000 (01:58 +0000)]
Fix ordering breakage, moving the fclose() test last again.
Also correct some format strings.
From Doug Hogan (doug (at) acyclic.org)
guenther [Sun, 20 Jul 2014 01:47:17 +0000 (01:47 +0000)]
Update regress to match change in stpcpy() linker message
Noted by Doug Hogan (doug (at) acyclic.org)
guenther [Sun, 20 Jul 2014 01:38:40 +0000 (01:38 +0000)]
Make sure the correct errno is reported by warn* or err* and not
the errno of an intervening cleanup operation like close/unlink/etc.
Diff from Doug Hogan (doug (at) acyclic.org)
guenther [Sun, 20 Jul 2014 01:29:03 +0000 (01:29 +0000)]
Delete unused variables found by -Wall
guenther [Sun, 20 Jul 2014 01:26:17 +0000 (01:26 +0000)]
Add missing include. Tickled by Doug Hogan (doug (at) acyclic.org)
guenther [Sun, 20 Jul 2014 00:46:26 +0000 (00:46 +0000)]
Mark fatal() as printf-like.
Don't put a format string that's only used once in a variable.
guenther [Sat, 19 Jul 2014 23:50:38 +0000 (23:50 +0000)]
Flense the telnet code base of unwanted ifdefs: authentication/encryption
tn3270, sgtty, pre-POSIX and other ancient system support, etc. Brings up
to date the manpage with what we support.
ok matthieu@ beck@ jmc@ millert@ deraadt@ okan@
bluhm [Sat, 19 Jul 2014 21:27:16 +0000 (21:27 +0000)]
Print a warning message if the files with the random seed are not
writeable during shutdown. This prevents ugly error messages when
the machine is rebooted from singe-user without mounting the file
systems read-write.
suggested by deraadt@
miod [Sat, 19 Jul 2014 18:15:53 +0000 (18:15 +0000)]
Explicitely check the value of REGRESS_SKIP_SLOW rather than its emptyness,
for it defaults to a non-empty value; Doug Hogan
miod [Sat, 19 Jul 2014 18:11:12 +0000 (18:11 +0000)]
Make sure struct sockaddr_in gets completely initialized by setting it to zero
before setting the few fields we are interested in; Doug Hogan
pirofti [Sat, 19 Jul 2014 18:01:23 +0000 (18:01 +0000)]
Bring back pci_dopm, but disable it before powerdown.
This fixes both the Lemote reboot issue and the USB issue on the
Gdium's that miod@ spotted.
Suggested by kettenis@, thanks!
Okay miod@
deraadt [Sat, 19 Jul 2014 16:12:00 +0000 (16:12 +0000)]
remove disabled main hook; we use phdr now; ok bcook
naddy [Sat, 19 Jul 2014 16:11:16 +0000 (16:11 +0000)]
arc4random re-seeds with getentropy() now; ok deraadt@ jmc@
deraadt [Sat, 19 Jul 2014 16:10:50 +0000 (16:10 +0000)]
tab love
bcook [Sat, 19 Jul 2014 15:29:25 +0000 (15:29 +0000)]
Move _ARC4_ATFORK handlers from thread_private.h in portable.
bcook [Sat, 19 Jul 2014 14:34:38 +0000 (14:34 +0000)]
move _ARC4_LOCK/UNLOCK primitives from thread_private into OS-specific modules
schwarze [Sat, 19 Jul 2014 13:15:07 +0000 (13:15 +0000)]
Security fix:
Validate the manpath up front and report a Bad Request if it is not
listed in manpath.conf, such that clients can't probe which directories
exist on the server. In case of configuration errors, consistently
report Internal Server Error without disclosing any further information.
Partially based on a patch from Sebastien Marie <semarie-openbsd at
latrappe dot fr>, but avoiding a couple of issues with that patch
and approaching the issue in a somewhat more rigorous way.
bcook [Sat, 19 Jul 2014 13:02:28 +0000 (13:02 +0000)]
fixup typos
pirofti [Sat, 19 Jul 2014 12:54:09 +0000 (12:54 +0000)]
Backout pci_dopm usage as it also breaks reboot on Lemote's.
Noticed by matthieu@.
schwarze [Sat, 19 Jul 2014 11:35:09 +0000 (11:35 +0000)]
Security fix:
Validate the name of the file to show before opening it.
Only allow relative filenames starting with "man" or "cat"
and containing neither "/.." nor "../".
While here, correct the condition discarding an initial "./".
Vulnerability found by Sebastien Marie <semarie-openbsd at latrappe dot fr>.
Many thanks for sending a patch; however, i did not use it but made the
checks even stricter.
matthew [Sat, 19 Jul 2014 08:55:22 +0000 (08:55 +0000)]
Document that abort() is async signal safe now that it doesn't flush
stdio buffers
While here replace "SUSv[67]" with "POSIX Issue [67]" and update
signal(3) to mention that pselect() and ppoll() are async signal safe
like sigaction(2) already does.
ok guenther