Commit Graph

19939 Commits

Author SHA1 Message Date
martin b6924e8af2 Conditionalize a few more functions (hopefully fixing the build) 2020-04-05 14:53:39 +00:00
roy 9e387da605 terminfo: Add guards to optionally build parts of libterminfo
Reading from a database is now optional.
Compiling terminfo descriptions (including from $TERMINFO) is now optional.
Compat support is now optional.

This removes 17k on amd64 from the binary size, which allows it to be used
again on space constrained ramdisks.
2020-04-05 12:31:02 +00:00
dholland 7ec84f335a Move the note about sys_errlist[] users to COMPATIBILITY, and strengthen it. 2020-04-04 21:29:54 +00:00
dholland 903a8c167f Add missing ERRORS section. 2020-04-04 21:26:44 +00:00
fox a4861c96ec lib/libusbhid: Fix possible left shift changes signedness bit.
This bug was reported by UBSan runs.

lib/libusbhid/parse.c:246:20

Can result in left shift changes signedness bit as a side effect positive number
can go negative, cast it to unsigned for the operation and silence the issue.

Reviewed by: kamil@
2020-04-04 21:26:16 +00:00
fox f76ca3088f lib/libusbhid: Fix possible left shift changes signedness bit.
This bug was reported by UBSan runs.

lib/libusbhid/usage.c:247:27
lib/libusbhid/usage.c:244:28
lib/libusbhid/usage.c:235:13

Can result in left shift changes signedness bit as a side effect positive number
can go negative, cast it to unsigned for the operation and silence the issue.

Reviewed by: kamil@
2020-04-04 21:23:04 +00:00
fox ef659d5053 lib/libusbhid: Fix possible left shift changes signedness bit.
This bug was reported by UBSan runs.

lib/libusbhid/data.c:58:25
lib/libusbhid/data.c:91:7
lib/libusbhid/data.c:92:7

Can result in left shift changes signedness bit as a side effect positive number
can go negative, cast it to unsigned for the operation and silence the issue.

Reviewed by: kamil@
2020-04-04 21:21:35 +00:00
dholland 4aee32ddde Minor clarification. And a typo. Bump date. 2020-04-04 21:20:39 +00:00
thorpej 7f4d3fb1f5 Man page for _lwp_gettid(2).
(Not yet installed, pending adding the libc stub.)
2020-04-04 20:31:11 +00:00
christos c260c42c09 remove smbfs 2020-04-04 17:56:22 +00:00
nia e194ce9454 statvfs.2: Add STANDARDS section.
Reviewed by kamil
2020-04-04 12:57:26 +00:00
wiz acf9dc2f4e Add comma in enumeration. 2020-03-30 22:14:48 +00:00
maya 5ff881a534 Mention elf rather than a.out some more.
(Also, inspired by freebsd, which removed the non-elf support)
2020-03-30 20:37:03 +00:00
maya d4a8a6057f xref elf(5). 2020-03-30 20:35:12 +00:00
maya 9ced62b43c Be less of a minefield for new architectures. They're not going to be a.out.
Remove sh5, long gone.
(Hopefully nothing hits the #else case)
2020-03-30 20:34:11 +00:00
ryo 30a3b0e1af PR/54992: fix hosts_access(5) to works for IPv6 linklocal address without scope-id 2020-03-30 08:34:38 +00:00
ryo b061283a45 fail to create a pidfile if hostname contains '/' 2020-03-30 08:24:36 +00:00
ryo 3bf82836bf patbuf must be updated if the length of patbuf is greater than or equal to 0. (that is always)
fix of r1.7 was incorrect.
2020-03-30 06:56:38 +00:00
ryo 1148c4261d fix build error with SDEBUG, MAP_DEBUG, DEBUG_REFRESH 2020-03-30 06:54:37 +00:00
roy 2d748ff84b terminfo: satisfy gcc bitching 2020-03-30 02:08:11 +00:00
roy 7f0204b5ec terminfo: v3 records should create v3 aliases 2020-03-30 00:09:06 +00:00
roy 5159a4258d terminfo: Promote a terminfo description to v3 when required
Blindly scanning the capabilities for # and checking that the following
number is bigger than a short isn't reliable because this could be a
string value:

SomeString#1234

Instead, if we process the numeric as normal and if it's value is too big
for v1 then promote the record to v3.
2020-03-29 21:46:22 +00:00
roy 59ea2669e1 terminfo: allow _ti_getname to convert from and to any version 2020-03-29 18:54:57 +00:00
roy 664218069f terminfo: Clamp numeric bounds to storage not API.
While here, fix decoding of numeric -1 stored in uint16_t to still be -1.
2020-03-29 18:32:45 +00:00
christos e2a9896bc4 PR/55118: Andreas Gustafsson: Oops, set the right flag variable. 2020-03-28 15:45:56 +00:00
roy 0b457be2fc terminfo: Add a comment for prior change. 2020-03-28 15:27:54 +00:00
roy 171093fef0 terminfo: use , as a record version delimiter rather than @
@ is allowed in a terminfo description, but a comma is not.
2020-03-28 15:25:53 +00:00
roy 96d0e34238 Whitespace 2020-03-28 15:23:33 +00:00
christos f5703f6ba1 support for older compilers 2020-03-28 02:38:15 +00:00
christos 1d30fdae10 Introduce a bunch of inline functions and utilities to avoid code duplication. 2020-03-27 17:39:53 +00:00
christos 3958d16a96 As described in tech-userlevel:
- Modify the writing code to only write entries in the new
  format for the terminal descriptions that require it.
- Store new format entries as <name>@v3
- Store old format entries with clamped values as <name> for
  backwards compatibility
- Lookup first <name>@v3 and then <name> if that is not found.
- Don't create terminfo2 anymore; old programs keep working with
  clamped entries, and new programs be able to use the wide
  fields with using the original db file.
2020-03-27 15:11:57 +00:00
wiz 2d8be20973 Remove trailing whitespace. 2020-03-25 22:09:48 +00:00
christos 703562b76a new paragraph 2020-03-25 21:26:12 +00:00
christos 00c598c3f1 more info 2020-03-25 21:24:08 +00:00
christos 6fa2277528 Revert putting a $ as the final character for blowfish. It is not required by
MCF and we want to be compatible.
2020-03-25 21:02:26 +00:00
wiz 51ad823948 Fix typos. Use more markup. New sentence, new line. 2020-03-25 18:53:50 +00:00
kre 4f0910e281 Delete the BUGS paragraph about the "missing" const qualifier for the
result type of strerror() (and strerror_l()).   While that once should
really have been present, when strerror() was invented, there was no
"const" qualifier in C to apply, and now the way the code is writtem
(really needs to be because of NLS support) the const is no longer
really appropriate.

Applications still shouldn't attempt to modify the result however.
2020-03-25 18:50:47 +00:00
kre 5388a00941 Document strerror_l()
While here also document (but comment it out since it isn't
available - yet) strerror_lr().   To include that, simply
uncomment the relevant lines, and (twice I think) s/returns/return/
on lines just after currently commented out lines (that is, it
currently says, "A returns" after the comments are returned, we
need it to be "A and B return" - the "and B" appears when the comment
markers are removed, removing the 's' from returns must be done manually.

In addition to adding strerror_l() some additional enhancements were
made to the general strerror() doc.
2020-03-25 18:45:42 +00:00
christos 3178d52ed6 - bump blowfish size, explain version
- add passwd xref
2020-03-25 18:37:08 +00:00
christos fd9ae3edee Add missing trailing $ for blowfish 2020-03-25 18:36:29 +00:00
gdt d5db881aeb Relax fdatasync restriction that fd be writable
The restriction that a fd passed to fdatasync(2) must be writable was
added in 2003 in order to comply with POSIX.  Since then, POSIX has
removed that requirement, and POSIX-valid programs have been therefore
encountering errors on NetBSD.

Patch by Paul Ripke after discussion on netbsd-users.  Issue
discovered with pkgsrc/databases/mongodb3 as used by pkgsrc/net/unifi.
2020-03-25 18:08:34 +00:00
christos 54fcd90b42 PR/55095: David A. Holland: pw_gensalt(3) undocumented 2020-03-25 17:11:06 +00:00
kre 219987b252 Arrange that strerror(-1) prints "Unknown error: -1" and not the
unsigned equivalent of -1.

While here, guarantee, even when !NLS, that nothing here (not even
snprintf deciding to complain about EILSEQ or something) can ever
alter errno (ie: always save and restore it, not only in the NLS case).
The functions here must never alter errno, whatever happens.
2020-03-25 16:15:41 +00:00
kre 93b9d85a0a Protect against malloc failure corrupting errno, which is not
permitted of these functions.
2020-03-25 16:10:17 +00:00
kre 12f8bae508 If we're going to loop, pausing and then retrying malloc() after it
has failed, in the hope that some other thread has free'd some memory,
but we want to bound the number of attempts, it helps if we actually
count them - otherwise we never get nearer to the limit.

In practice, malloc() for a reasonable application on a modern system
almost never fails, so the code containing this bug has probably never
been, and never will be, executed, but just in case, someday.

For this, it isn't clear if the intent was to have 10 retries (ie: 11
attempts) or 10 tries, but as the code said "retries > 10", I am
assuming the former (not that it matters, if the malloc() has failed
10 times in a row, with 10 second pauses between, the chances of an
11th succeeding aren't great).
2020-03-24 14:56:31 +00:00
kamil 15f8c76f05 Revert previous
It will be addressed in a better way.

Requested by <kre>
2020-03-24 14:47:02 +00:00
kamil 43bf7c3563 Avoid buffer overflow
Detected with ASan + RUMPKERNEL.
2020-03-24 01:56:56 +00:00
kamil 05ac20bb1c Fix off-by-one
Before accessing array member, check whether it is not out of valid range.

Detected with ASan + RUMPKERNEL.
2020-03-24 01:13:41 +00:00
wiz e9fe6f785f Fix synopsis, use more markup. 2020-03-23 16:14:20 +00:00
roy 41aea6ac80 Add missing man page for curses mouse functions. 2020-03-23 15:32:56 +00:00