Commit Graph

21037 Commits

Author SHA1 Message Date
blymn 9c6a0e327d Backout change to addnstr that broke other applications as n should be
the number of bytes to add - for multibyte characters n will be > 1.

Fix __slk_draw to pass in the actual length of the label instead of
the default label length because wide characters may make the
actual string length longer than the slk display length.
2022-12-20 04:57:01 +00:00
christos 93664a940b Handle the case the code originally intended to handle; systems where:
SIZE_MAX < PTRDIFF_MAX
2022-12-13 19:08:42 +00:00
skrll e311a492a7 Trailing whitespace 2022-12-13 12:43:32 +00:00
blymn 7c304c7fb1 Default the character width to 1 if wcwidth fails. 2022-12-12 21:14:15 +00:00
christos fa7b09b795 Merge in 2022g:
Although tzcode still works with C89, bugs found in recent routine
    maintenance indicate that bitrot has set in and that in practice
    C89 is no longer used to build tzcode.  As it is a maintenance
    burden, support for C89 is planned to be removed soon.  Instead,
    please use compilers compatible with C99, C11, C17, or C23.

    timegm, which tzcode implemented in 1989, will finally be
    standardized 34 years later as part of C23, so timegm is now
    supported even if STD_INSPIRED is not defined.

    Fix bug in zdump's tzalloc emulation on hosts that lack tm_zone.
    (Problem reported by Đoàn Trần Công Danh.)

    Fix bug in zic on hosts where malloc(0) yields NULL on success.
    (Problem reported by Tim McBrayer for AIX 6.1.)

    Fix zic configuration to avoid linkage failures on some platforms.
    (Problems reported by Gilmore Davidson and Igor Ivanov.)

    Work around MS-Windows nmake incompatibility with POSIX.
    (Problem reported by Manuela Friedrich.)

    Port mktime and strftime to debugging platforms where accessing
    uninitialized data has undefined behavior (strftime problem
    reported by Robert Elz).

    Check more carefully for unlikely integer overflows, preferring
    C23 <stdckdint.h> to overflow checking by hand, as the latter has
    had obscure bugs.
2022-12-11 17:57:23 +00:00
uwe 710059bb9f editrc(5): Markup fixes 2022-12-06 00:59:20 +00:00
uwe 1c9bc64659 getbsize(3): Use .Ev for BLOCKSIZE 2022-12-06 00:13:17 +00:00
blymn 5a712dcba0 Revert previous change, it is not correct. 2022-12-05 21:14:25 +00:00
uwe e8b127922c getnetpath(3): Sprinkle some markup 2022-12-04 23:02:57 +00:00
uwe cfe198168b login_cap(3): Markup fixes 2022-12-04 22:51:43 +00:00
jakllsch 78eb21a033 On VAX, compile gdtoa/misc.c at -O0 to avoid incorrect machine code
resulting in some doubles printing as garbage.
2022-12-04 22:35:15 +00:00
uwe 7440a63dca fcntl(2): Fix wrong markup in a couple of places 2022-12-04 19:01:19 +00:00
skrll 1beb9ce90d Consistently use the 'mv' instrucation (which is itself an alias) instead
of the (old) alternative alias 'move'.
2022-12-04 17:04:06 +00:00
uwe 495edbf836 re_format(7): Add subsection headings for ERE and BRE
The first paragraph could use some rewording.  While BRE may be
obsolete, it's still the default for regcomp(3) and the default for
grep(1), sed(1), etc.
2022-12-04 16:52:48 +00:00
uwe eff611cf1c Bump date for the fixed RETURN VALUES in previous 2022-12-04 16:21:54 +00:00
uwe 15c5c5f472 Tweak markup in _lwp_*(2) manual pages
Use .Rv where possible.  Some manual pages claimed that the error "is
returned", but RTFS and some quick testing indicate that this is wrong.

The commit message from 2003 says that:

  Note our current implementation mis-matches [man pages] slightly
  (error codes are stuffed into errno, where they should simply be
  returned by these calls).  This will be addressed shortly.

That hasn't happened in the 20 years, so we might as well make the man
pages reflect the reality.
2022-12-04 16:17:50 +00:00
uwe 49e10846a6 lib: Mark up error names in man pages with .Er 2022-12-04 11:25:08 +00:00
uwe 27e8188424 flock(2): s/Eq/Er/ typo in the ERRORS section 2022-12-04 11:18:58 +00:00
uwe 4562d402f9 pw_init(3): Use .Ev for EDITOR 2022-12-04 11:16:39 +00:00
uwe e6fc3c59c2 Sections 2 and 3 have RETURN VALUES, not DIAGNOSTICS 2022-12-04 01:29:31 +00:00
uwe 254727163e getservent(3): Section 3 has RETURN VALUES, not DIAGNOSTICS
While here, don't claim that null pointer is zero.

We should probably just pick the wording from POSIX, but that yak is a
bit too big for me to shave at the moment.
2022-12-04 00:13:11 +00:00
jschauma 4556c7b6e8 reference /var/db/services.cdb / services_mkdb(8) 2022-12-03 23:55:52 +00:00
skrll ea00852af2 Trailing whitespace 2022-12-03 14:04:39 +00:00
skrll 7893424154 Trailing whitespace 2022-12-03 09:38:53 +00:00
christos 86e4c4a8e3 PR/57095: Yilei Yang: Change readline's replace_history_entry to not make a copy
of the string to replace since H_REPLACE already makes a copy (fixes memory leak)
2022-12-02 19:23:15 +00:00
blymn dabdb153f2 When performing a scroll, check the last line of the region is the same
on virtscr and curscr because the indexes past are supposed to be
one *past* the last matching line (they may actually match if the line is
at the bottom of the screen).  Iff they don't match reduce the scroll
region size by one so we don't scroll non-matching lines, also check
if the region is then 0 after the decrement and just return if it was.
2022-11-30 06:19:15 +00:00
skrll d2296b0783 Trailing whitespace 2022-11-30 04:35:53 +00:00
uwe f90210105d socketpair(2): Formatting nits 2022-11-29 20:50:37 +00:00
jschauma 12d9662bb2 document the only supported type protocol, document type flags
This uses language taken from OpenBSD's manual page.
2022-11-29 20:26:39 +00:00
gutteridge d671eab624 reallocarray.3: minor grammar and style tweaks 2022-11-27 20:17:20 +00:00
christos ecbe1e9db9 fix vax build 2022-11-23 18:15:43 +00:00
rin 35e09a8af5 Correct path for libm. 2022-11-22 15:41:04 +00:00
christos ae082add65 lua libm API from Phil Rulon 2022-11-21 22:01:32 +00:00
jakllsch cd0fbe0b1b Simply set HAVE_GETRANDOM to false on __APPLE__.
Addresses PR 57083.
2022-11-17 17:35:25 +00:00
christos cd2e09c9fd PR/57083: Jiaxun Yang: Fix build on MacOS/X which has <sys/random.h> but no
getrandom(3).
2022-11-16 19:38:08 +00:00
gutteridge 7eadd4d371 posix_openpt.3: add a history section 2022-11-15 22:17:53 +00:00
gutteridge 03e840b8d3 closefrom.3: add a history section 2022-11-10 00:47:01 +00:00
blymn b34dd075af Count character widths not number of bytes when calculating number
of characters to add.  Fixes an error detected by slk tests where
a label containing wide characters was not correctly printed.
2022-11-07 21:18:49 +00:00
riastradh 3ead30d6ad regerror(3): Allow null errbuf if errbuf_size is zero.
The man page says:

   If errbuf_size is 0, errbuf is ignored but the return value is still
   correct.

POSIX says:

   If errbuf_size is 0, regerror() shall ignore the errbuf argument,
   and return the size of the buffer needed to hold the generated
   string.

   https://pubs.opengroup.org/onlinepubs/9699919799/functions/regerror.html

from enh@google.com
2022-11-05 11:33:55 +00:00
blymn 2cc268f92c PR bin/57072
This fixes observed behviour in the PR.  Allow the cursor to be
moved one past the EOL, if postitioned here then set ISPASTEOL.
also protect out of range access if win->cury is past maxy.
2022-11-04 06:12:22 +00:00
andvar daa7d68ea3 fix various typos in comments and messages. 2022-11-02 20:38:21 +00:00
christos 9acefc396c Cleaner to use if/then/else rather than a ton of casts in the ternary operator. 2022-11-02 12:49:10 +00:00
christos 21a4b1ccc3 improvements in malloc/free handling. 2022-10-30 19:11:31 +00:00
christos 1e7378f887 Update to tzcode2022f
Changes to code

    zic now supports links to links regardless of input line order.
    For example, if Australia/Sydney is a Zone, the lines
      Link Australia/Canberra Australia/ACT
      Link Australia/Sydney Australia/Canberra
    now work correctly, even though the shell commands
      ln Australia/Canberra Australia/ACT
      ln Australia/Sydney Australia/Canberra
    would fail because the first command attempts to use a link
    Australia/Canberra that does not exist until after the second
    command is executed.  Previously, zic had unspecified behavior if
    a Link line's target was another link, and zic often misbehaved if
    a Link line's target was a later Link line.

    Fix line number in zic's diagnostic for a link to a link.

    Fix a bug that caused localtime to mishandle timestamps starting
    in the year 2438 when reading data generated by 'zic -b fat' when
    distant-future DST transitions occur at times given in standard
    time or in UT, not the usual case of local time.  This occurs when
    the corresponding .zi Rule lines specify DST transitions with TO
    columns of 'max' and AT columns that end in 's' or 'u'.  The
    number 2438 comes from the 32-bit limit in the year 2038, plus the
    400-year Gregorian cycle.  (Problem reported by Bradley White.)

    On glibc 2.34 and later, which optionally supports 64-bit time_t
    on platforms like x86 where time_t was traditionally 32 bits,
    default time_t to 64 instead of 32 bits.  This lets functions like
    localtime support timestamps after the year 2038, and fixes
    year-2038 problems in zic when accessing files dated after 2038.
    To continue to limit time_t to 32 bits on these platforms, use
    "make CFLAGS='-D_TIME_BITS=32'".

    In C code, do not enable large-file support on platforms like AIX
    and macOS that no longer need it now that tzcode does not use
    off_t or related functions like 'stat'.  Large-file support is
    still enabled by default on GNU/Linux, as it is needed for 64-bit
    time_t support.

    In C code, prefer C23 keywords to pre-C23 macros for alignof,
    bool, false, and true.  Also, use the following C23 features if
    available: __has_include, unreachable.

    zic no longer works around Qt bug 53071, as the relevant Qt
    releases have been out of support since 2019.  This change affects
    only fat TZif files, as thin files never had the workaround.

    zdump no longer modifies the environ vector when compiled on
    platforms lacking tm_zone or when compiled with -DUSE_LTZ=0.
    This avoid undefined behavior on POSIX platforms.
2022-10-29 13:55:50 +00:00
wiz dd8db24513 put reallocarray() in the public namespace
reallocarray() will be part of the next POSIX release, see
https://austingroupbugs.net/view.php?id=1218

adapt an errno value to match POSIX expectations

As discussed on tech-userlevel
2022-10-28 09:43:58 +00:00
jschauma 14ecc37828 rephrase / clarify explanation of struct tm member normalization 2022-10-26 23:22:54 +00:00
andvar a5139dfcb4 fix RCSID. 2022-10-26 22:13:09 +00:00
andvar 730fdfa601 nix double n, i or g in "ing", in comments and documentation. 2022-10-26 22:09:37 +00:00
kre c24fd5a773 Fix a merge or conversion problem (probably) - a .SH BUGS
(meaningless macro in mdoc) followed by the first line of the
real BUGS section somehow ended up inserted after the first
word of the STANDARDS section.   Delete the noise.
2022-10-25 08:07:07 +00:00
blymn 4b1b7fd71d Fix for lib/57050
Perform a sanity check on the window parameter being passed and return
ERR if it is null.  This prevents buggy code crashing.
2022-10-25 06:20:01 +00:00
uwe d6f32aceab strptime(3): make the fact that %z is an extension more prominent
Mention it near the format itself, not on the next screen (with an
awkward indentation too).
2022-10-24 23:18:31 +00:00
uwe 69afa679ca ctime(3): fix unbalanced paren introduced in 1.40 2022-10-21 12:28:43 +00:00
uwe 2d856f24b1 ctime(3): add missing leading slash in a pathname 2022-10-21 12:11:29 +00:00
jschauma 1f27523029 escape mathematical minus so it doesn't get rendered as a dash 2022-10-21 03:08:29 +00:00
jschauma 61d8e1efc0 Note normalizing behavior of mktime(3) using language from FreeBSD. 2022-10-21 03:05:15 +00:00
blymn ee6c5161ec Fixes for lib/56926 amongst other things:
- plod now correctly accounts for wide characters when plodding
 - use erase line when in color mode if the terminal has the capability
 - ensure that the CA_CONTINUATION flag is applied consistently to the
   subsequent characters in a wide character.
 - fix a bunch of refresh bugs that caused inconsistent placement of
   wide characters.
2022-10-19 06:09:27 +00:00
wiz 134c7dc5fa avoid unnecessary Ns macro 2022-10-18 07:33:15 +00:00
jschauma 76a83e03a4 Note that the exit status may be truncated to the least significant 8 bits. 2022-10-18 02:31:39 +00:00
jschauma 746cfcb9c7 add missing 'the' 2022-10-17 18:41:06 +00:00
christos ec56256fb3 Add EINVAL doc from Jan Schaumann 2022-10-16 20:37:03 +00:00
christos 48575108a6 update to 2022e; no real changes 2022-10-15 18:57:37 +00:00
nia 934ddb935f libc: Use a functional example when warning about incorrect alloca usage 2022-10-08 12:56:51 +00:00
ryo 9da1e81cea fix fixPR/57046. inet_network(3) returns INADDR_NONE when network names such as /x[0-9a-f][0-9a-f]/. 2022-10-06 06:03:06 +00:00
nia c47c40fb8b libc: switch aarch64 to use softfloat functions from compiler_rt
The old definitions in qp.c being all grouped together in one file
causes problems when static linking with libgcc (i.e. cc --static-libgcc)
due to functions like __trunctfdf2 conflicting with libgcc, as seen in
PR 57021

We can also add some missing functions like __fixdfti for converting
a double to an int128_t, the lack of which is currently preventing webkit
from linking on aarch64, as seen in PR 57022

Unclear to me if libc is the right place for these functions, but
we can avoid breaking compatibility right now and maintain the status
quo while avoiding some obvious immediate problems.
nm output for libc shows no functions being removed by this change.
2022-10-05 10:28:19 +00:00
gutteridge 5568d804e3 posix_openpt.3: reflect changes from r. 1.45 of tty_ptm.c 2022-10-04 01:46:18 +00:00
gutteridge e3b627187d posix_openpt.3: reflect flag changes from r. 1.44 of tty_ptm.c
Some flags are now accepted, others are still ignored. (E.g., other
BSDs would return EINVAL if O_RDWR wasn't passed, and we now accept
O_NONBLOCK but not O_CLOEXEC.)
2022-09-28 00:35:47 +00:00
christos 22153c41fd PR/57016: Ricky Zhou: declare lastidx 2022-09-21 01:33:53 +00:00
christos 8aa8c3f154 PR/57016: Ricky Zhou: Revert to trimming the last newline instead of the
first one so that multi-line commands work again.
2022-09-20 23:41:14 +00:00
riastradh 7a407fffcd pthread_atfork(3): Block signals during the call to pthread_atfork.
This doesn't affect the calls to the atfork handlers -- it only
protects access to the lists of handlers from interruption by a
signal, in case the signal handler calls fork(2).
2022-09-13 10:18:47 +00:00
rillig 6c259f3957 fix misspellings of 'available' and nearby typos 2022-09-10 12:14:17 +00:00
gutteridge 9b526a4356 posix_openpt.3: add caveats about oflags
The NetBSD implementation differs from other BSDs in that it does not
return EINVAL if invalid oflags are submitted, since it completely
ignores them. This is surprising to upstream projects that may expect
otherwise.
2022-09-06 22:54:41 +00:00
riastradh cf221fb572 reallocarr(3): Touch up xrefs. 2022-08-31 12:18:41 +00:00
riastradh a2fb076e11 reallocarr(3): Bump date. Note overflow is handled internally. 2022-08-31 12:17:14 +00:00
riastradh 249e1d8c11 reallocarr(3): Clarify semantics. 2022-08-31 12:10:05 +00:00
riastradh b9cd134278 libm: Fix some whitespace issues in recent sincos additions. 2022-08-29 01:48:34 +00:00
he 5eeabc1a3f s_rint.c: weak-alias rintl -> rint for ports without __HAVE_LONG_DOUBLE. 2022-08-28 21:24:09 +00:00
he 41f1db2c7a s_sincos.c: use correct order of __weak_alias() arguments... 2022-08-28 16:07:58 +00:00
he 9be9bcc17d s_sincos.c: use __weak_alias and not __weak_reference.
Fixes build on NetBSD/macppc, thanks to hint from riastradh@
2022-08-28 14:30:41 +00:00
uwe 195a321f00 re_format(7): Use dagger, not double dagger. Make it superscript. 2022-08-28 12:59:50 +00:00
hgutch ec184f3bfb Change back various occurrences of \*[Le], \*[Ge] (less/greater equal)
and \*(ua (upwards arrow) to literal "<=", ">=" and "^" whenever
appropriate (e.g., in code examples).
2022-08-28 10:48:15 +00:00
christos cef006857c only alias sincos to sincosl when we don't have long doubles 2022-08-28 07:29:04 +00:00
christos 861ec30ff2 tuck in k_sincosl.h include inside __HAVE_LONG_DOUBLE 2022-08-27 17:15:52 +00:00
christos ae197994b3 Fix vax build. 2022-08-27 09:56:21 +00:00
christos 5dd94c5e95 Add sincos{,f,l} from FreeBSD 2022-08-27 08:31:58 +00:00
christos 892b77447f sync with FreeBSD; bring some more inline functions. 2022-08-24 13:51:19 +00:00
christos 4fce0f6899 add missing text. 2022-08-24 06:39:14 +00:00
christos cd9dfb0505 Fix argument name 2022-08-23 14:54:50 +00:00
christos d4169749f0 fix whitespace prefix behavior 2022-08-18 11:05:02 +00:00
christos 5346bd151a PR/56967: John Zaitseff: Reduce diff with FreeBSD, fixes various bugs. 2022-08-17 09:32:56 +00:00
christos 8c24072a8b Welcome to tzcode-2022c
Work around a bug in onetrueawk that broke commands like
'make traditional_tarballs' on FreeBSD, macOS, etc.
(Problem reported by Deborah Goldsmith.)

Add code to tzselect that uses experimental structured comments in
zone1970.tab to clarify whether Zones like Africa/Abidjan and
Europe/Istanbul cross continent or ocean boundaries.
(Inspired by a problem reported by Peter Krefting.)

Fix bug with 'zic -d /a/b/c' when /a is unwritable but the
directory /a/b already exists.

Remove zoneinfo2tdf.pl, as it was unused and triggered false
malware alarms on some email servers.
2022-08-16 11:07:40 +00:00
christos 0129e5c6c8 Welcome to 2022b:
zic has a new option '-R @N' to output explicit transitions < N.
(Need suggested by Almaz Mingaleev.)

'zic -r @N' no longer outputs bad data when N < first transition.
(Problem introduced in 2021d and reported by Peter Krefting.)

zic now checks its input for NUL bytes and unterminated lines, and
now supports input line lengths up to 2048 (not 512) bytes.

gmtime and related code now use the abbreviation "UTC" not "GMT".
POSIX is being revised to require this.

When tzset and related functions set vestigial static variables
like tzname, they now prefer specified timestamps to unspecified ones.
(Problem reported by Almaz Mingaleev.)

zic no longer complains "can't determine time zone abbreviation to
use just after until time" when a transition to a new standard
time occurs simultanously with the first DST fallback transition.
2022-08-16 10:56:21 +00:00
wiz 2d37c7f39b clone(2): document that _GNU_SOURCE must be defined for the prototypes 2022-08-01 14:22:32 +00:00
mlelstv d2698c432d Move libisns to /lib to allow /sbin/iscsid to work without /usr being
mounted.
2022-07-31 12:40:35 +00:00
dholland 2301d6e2c4 __quotactl(2): typo. 2022-07-31 06:21:41 +00:00
uwe 56cc39f2d1 mincore(2) - use .Rv -std 2022-07-26 00:25:45 +00:00
riastradh 134b15b0f4 mincore(2): Clarify units of len argument: bytes, not pages.
Minor tidying while here:

- Use .Fa, not .Ar, for function arguments.
- Reduce verbiage of opening sentence.
2022-07-25 22:50:42 +00:00
andvar 6c5bf42769 p2k(3): drop reference to rump_smbfs(8). 2022-07-11 19:24:56 +00:00
andvar a299e6608d fix various typos in comments. 2022-07-06 12:33:41 +00:00
rillig ed7c6fff47 bind.2: add references to specific protocol families
Referring the reader to "the manual entries in section 4" was too
unspecific to be useful, as that section contains device drivers as
well.
2022-06-28 20:24:08 +00:00
rillig f1e042b8d2 fix references in manual pages to the reference documentation 2022-06-28 20:12:52 +00:00
skrll 1120ea0d7a Decorate the HPPA signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
2022-06-26 14:37:12 +00:00
skrll 44889fb922 Decode function descriptors (aka plabels) on hppa to fix backtrace.
PR/56881: hppa: backtrace_symbols() delivers bogus results for some dynloaded functions
2022-06-25 06:51:37 +00:00
martin 35a4c156a5 Use "fmadd" to implement fma(3) on ppc. 2022-06-23 16:42:50 +00:00
skrll db40f7209a Oops... fix SYMTAB_DEBUG build 2022-06-23 09:58:25 +00:00
skrll 28227ae2d9 Define and use a DPRINTF macro 2022-06-23 09:53:49 +00:00
skrll d5f19fad45 Trailing whitespace 2022-06-23 09:48:00 +00:00
he 56c7bffc6c libm: build fma(3), fmaf(3), fmal(3) on powerpc.
For now this builds the C version, for completeness, so
that e.g. lang/ocaml can be configured & built.  However,
googling reveals that powerpc does have a "fused multiply add"
instruction, ref.
https://www.ibm.com/docs/en/aix/7.1?topic=set-fmadd-fma-floating-multiply-add-instruction
so this could probably be taken advantage of for a more
optimized version.
2022-06-23 07:50:14 +00:00
skrll f927c76aaf Support ifunc on aarch64. The tests pass at least. 2022-06-21 06:52:17 +00:00
skrll 810da4c4dd Wrap long #if defined(...) || ... and sort. NFCI. 2022-06-21 06:47:37 +00:00
skrll 89e5bb04d9 Trailing whitespace 2022-06-21 06:41:39 +00:00
hannken cefc293e00 Set provider to NULL -- "pam" is not a valid security key helper library.
Now ssh-agent no longer fails key addition with

    error: Cannot add provider: RSA is not an authenticator-hosted key
2022-06-15 08:31:34 +00:00
andvar 36ad50cf2f fix typo in comment: white spae -> whitespace. 2022-06-09 14:02:30 +00:00
christos 712e653ad8 Add method to initialize errinfo so that npfctl does not print random strings. 2022-06-07 16:27:24 +00:00
skrll e59cbf3301 Save and restore %r19 the "linkage table pointer register" across the call
to __cerror so if the ptrace syscall fails we can call __cerror again with
the correct %r19 value.

Do this even though the call of __cerror doesn't go via the PLT because
__cerror calls __errno which does.

Analysis and fix from Tom Lane in

port-hppa/56864: hppa: ptrace(2) dumps core when returning an error

I changed the location of where %r19 is stored on the stack to follow the
ABI.
2022-06-06 06:32:44 +00:00
riastradh e3d96c2fb2 libpthread(3): Fix a marvellous interaction with rtld.
Patch from chs@.  Comment explaining the story by me.  This patch may
not be optimal -- maybe it would be better in pthread__init, or
better for rtld to call _lwp_unpark after _lwp_park in the contened
case -- but we've tested this version and it's annoying to reproduce,
so let's take this version and worry about testing improvements
later.
2022-05-31 14:23:39 +00:00
riastradh 2b5e567d9c libc: Reintroduce getentropy.
This was introduced two years ago when the getrandom/getentropy API
question was still open, and removed because the discussion was
ongoing.  Now getentropy is more widely adopted and soon to be in
POSIX.  So reintroduce the symbol into libc since we'll be keeping it
anyway.  Discussion of details of the semantics, as interpreted by
NetBSD, is ongoing, but the symbol needs to get in before the
netbsd-10 branch.  The draft POSIX text is
(https://www.opengroup.org/austin/docs/austin_1110.pdf):

    SYNOPSIS
        #include <unistd.h>

        int getentropy(void *buffer, size_t length);

    DESCRIPTION
        The getentropy() function shall write length bytes of data
        starting at the location pointed to by buffer. The output
        shall be unpredictable high quality random data, generated by
        a cryptographically secure pseudo-random number
        generator. The maximum permitted value for the length
        argument is given by the {GETENTROPY_MAX} symbolic constant
        defined in <limits.h>.

    RETURN VALUES
        Upon successful completion, getentropy() shall return 0;
        otherwise, -1 shall be retunred and errno set to indicate the
        error.

    ERRORS
        The getentropy() function shall fail if:

        [EINVAL]        The value of length is greater than
                        {GETENTROPY_MAX}.

        The getentropy() function may fail if:

        [ENOSYS]        The system does not provide the necessary
                        source of entropy.

    RATIONALE
        The getentropy() function is not a cancellation point.

Minor changes from the previous introduction of getentropy into libc:

- Return EINVAL, not EIO, on buflen > 256.
- Define GETENTROPY_MAX in limits.h.

The declaration of getentropy in unistd.h and definition of
GETENTROPY_MAX in limits.h are currently conditional on
_NETBSD_SOURCE.  When the next revision of POSIX is finalized, we can
expose them also under _POSIX_C_SOURCE > 20yymmL as usual -- and this
can be done as a pullup without breaking existing compiled programs.
2022-05-31 13:42:58 +00:00
andvar ff23aff6ad fix various typos in comments, documentation and messages. 2022-05-31 08:43:13 +00:00
rin 780da3acaa Remove comment-outed garbage. 2022-05-30 15:18:32 +00:00
rin dd3ee07da4 Introduce libc_aligned.so for evbppc-powerpc32, which provides
strictly-aligned versions of memcmp(3), bcopy(3), memcpy(3), and
memmove(3).

This is used for 403 by ld.so.conf with machdep.no_unaligned variable.

With this library, unaligned memory accesses are significantly reduced
for 403 (from several hundreds to few tens per sec under heavy load);
only ld.elf_so (typically few times per fork) and statically-linked
binaries do such access.
2022-05-30 15:06:54 +00:00
rin 2ca271943c Obsolete hack for evbppc to replace memcmp(9), memcpy(9), and memmove(9)
with strictly-aligned versions.

Now all 32-bit powerpc ports share the same libc binary.

This change together with the preceding similar change in libkern slightly
improve performance for DHT (ibm4xx/405GP) and RB800 (MPC8533E).

See changes in bytebench scores:

- DHT	https://gist.github.com/rokuyama/301063355de9733bea515b84ef574c0a
- RB800	https://gist.github.com/rokuyama/60ad665d367d6d110b79ec44707f39ff

Improvements may be negligible, but this does not cause performance
regressions at least.

This hack was for 403, but unaligned memory access is now emulated by
kernel. This should result in serious performance regression for 403.
We will provide strictly-aligned versions by ld.so.conf.
2022-05-30 14:43:37 +00:00
martin c44afc56cf Make it compile again 2022-05-29 12:15:00 +00:00
abs 04799ba54b Avoid null SEGV if libargon passed string with too few $
Seen on netbsd-9 built xscreensaver running on a current system.
Whatever triggered this should also be fixed, but in the meantime
we can improve the behaviour from "Segmentation Fault"
2022-05-29 10:58:09 +00:00
abs e7c718145b Free strdup'd value in libargon decode_option error paths
If its worth freeing in the success path, its worth freeing in the
error path... (given we don't _exit or similar)
2022-05-29 10:51:41 +00:00
andvar 114b022676 fix various typos in comments. 2022-05-28 22:16:43 +00:00
andvar cdc507f0d2 fix various typos in comment, documentation and log messages. 2022-05-24 20:50:17 +00:00
andvar 9f4a9600be fix various typos in comments, docs and log messages. 2022-05-24 06:27:59 +00:00
andvar a657a7c44e s/beggining/beginning/ in comments. 2022-05-23 19:21:30 +00:00
andvar f42f89fd6f fix various small typos, mainly in comments. 2022-05-22 11:27:33 +00:00
charlotte bad55ec264 usbhid.3: hid_parse_usage_in_page() actually returns int 2022-05-22 05:33:46 +00:00
uwe 82b5ace373 curses_input.3: wtimeout() returns void too 2022-05-21 12:34:44 +00:00
charlotte 54e1935b39 curses_input.3: timeout() actually returns void 2022-05-21 06:22:49 +00:00
dholland 049cc88fbf fix typo in sigaction(2) 2022-05-21 01:38:14 +00:00
blymn 7b4e98e7d7 Set the last change pointer after adding a character at the bottom right
of a window.  This fixes the character missing in the LR of a window.
Thanks to uwe@ for pointing this out.
2022-05-19 07:41:26 +00:00
skrll e37a8d9317 Use RAS_{START,END}_ASM_HIDDEN 2022-05-19 07:10:15 +00:00
rillig 84c538f93b curses_input.3: fix argument type for keypad, notimeout, nodelay
There is no type named 'boolf', there's only 'bool'.
2022-05-16 20:09:13 +00:00
andvar a5c1e39951 s/wich/which in comments. 2022-05-15 20:37:50 +00:00
christos d813eb2e76 PR/56838: David A. Holland: namespace pollution in static libcrypt 2022-05-15 16:25:09 +00:00
blymn 6bb8042d10 Make clrtoeol match the ncurses behaviour where it seems to make the
rest of line foreground.  This fixes a display oddity in mutt.
2022-05-12 22:25:38 +00:00
andvar adb5d710d2 fix various typos in comments. 2022-05-11 14:58:00 +00:00
rin b2d5196452 PR lib/56395
PR toolchain/56771

Fix profiling on CPUs that do not support unaligned memory access;
Allocate objects (referenced from struct gmonparam) with proper
alignments.

For monstartup(), objects are allocated on heap. Break is not
guaranteed to be aligned at all, unlike stack pointer.

For _m_gmon_alloc(), objects are allocated on anonymous memory.
p->tos is not aligned properly in general.

This fixes quasi-random crashes for *_profile tests, at least on
SH-4 and PowerPC 403 [1]. Also, no regression is observed for
others as far as I can see.

This change does not cause any ABI breakage, as long as application
uses proper pointers; use p->tos instead of evil pointer arithmetic
like (struct tostruct *)((char *)p->froms + p->fromssize) [2].

[1] Timeout should be increased for some tests. "pic" variants
still fail as expected. Dynamically-linked binaries also crash in
rtld for SH-4, but this seems different problem...

[2] This example did not work even before, since the order of
froms[] and tos[] is reversed depending on which of monstartup() or
_m_gmon_alloc() is used for allocation.
2022-05-06 04:49:13 +00:00
blymn 080c30e83d Don't force the refresh, it doesn't really need it. 2022-05-05 22:02:17 +00:00
blymn a7d2c21606 * Don't redraw the background if the new background character is the
same as the old one.  This prevents excessive redraws in some
   applications.

 * Fix bug introduced when wbkgrndset was fixed, we cannot blindly
   replace any instance of the old background character with the new one
   because some of those characters were put there by the application
   leading to display corruption.  So flag characters as background when
   they are erased and only update the flagged characters when setting
   the background.
2022-05-03 07:25:34 +00:00
blymn dbdfee8ed1 Fix for PR 56243
clear the past EOL flags when moving the cursor - they are no longer
valid as move cannot put the cursor past the EOL.
2022-04-27 22:04:04 +00:00
blymn a63e44ac26 Fix for PR 55517.
Actually us x values to recalculate subwin columns.
2022-04-26 22:40:32 +00:00
hannken 48747c6894 Fix default quota file names, both user and group quota used the
same default name "QUOTAFILENAME, names[USRQUOTA])" resulting in
diagnostic assertion and possibly corrupted quota data.
2022-04-26 15:36:42 +00:00
christos 020fb940f4 fix date -d 12/01/2022, found by Anon Ymous 2022-04-23 13:02:04 +00:00
blymn 881239103e fix for PR 55496
* Fix bkgrndset so that it actually sets the background character in
   in line with the SUSv2 specification.

 * Add an internal function to copy a complex character

 * Make the previously static celleq function into a libcurses private
   function so that it can be called in other files.
2022-04-19 22:26:57 +00:00
rillig 388550b026 lib: remove CONSTCOND comment
Since 2021-01-31, lint doesn't need it anymore for the common pattern of
'do ... while (0)'.
2022-04-19 20:32:14 +00:00
andvar f84252b461 fix various typos in comments and log messages. 2022-04-16 18:15:20 +00:00
pgoyette 4c6c48d4bc Fix build (enabled only for MKDEBUG?) 2022-04-13 19:17:09 +00:00
blymn 137544432a Fix compile breakage when wide char support is disabled. 2022-04-12 21:54:16 +00:00
andvar de0a2812df s/sould/should/ and s/shoud/should/ 2022-04-12 21:05:36 +00:00
blymn 301bf8cc44 Make the default colour pair be pair 0 which appears to match other
curses implementations.
2022-04-12 07:03:04 +00:00
tnn 3b1edbf2d8 libedit/chartype.h: portability fix for OSF/1 2022-04-11 19:37:20 +00:00
riastradh 568eb77ef2 pthread: Nix trailing whitespace. 2022-04-10 10:38:33 +00:00
andvar 75d2abaeb1 fix various typos in comments and output/log messages. 2022-04-10 09:50:44 +00:00
riastradh 4f8ce3b31d Introduce membar_acquire/release. Deprecate membar_enter/exit.
The names membar_enter/exit were unclear, and the documentation of
membar_enter has disagreed with the implementations on sparc,
powerpc, and even x86(!) for the entire time it has been in NetBSD.

The terms `acquire' and `release' are ubiquitous in the literature
today, and have been adopted in the C and C++ standards to mean
load-before-load/store and load/store-before-store, respectively,
which are exactly the orderings required by acquiring and releasing a
mutex, as well as other useful applications like decrementing a
reference count and then freeing the underlying object if it went to
zero.

Originally I proposed changing one word in the documentation for
membar_enter to make it load-before-load/store instead of
store-before-load/store, i.e., to make it an acquire barrier.  I
proposed this on the grounds that

(a) all implementations guarantee load-before-load/store,
(b) some implementations fail to guarantee store-before-load/store,
and
(c) all uses in-tree assume load-before-load/store.

I verified parts (a) and (b) (except, for (a), powerpc didn't even
guarantee load-before-load/store -- isync isn't necessarily enough;
need lwsync in general -- but it _almost_ did, and it certainly didn't
guarantee store-before-load/store).

Part (c) might not be correct, however: under the mistaken assumption
that atomic-r/m/w then membar-w/rw is equivalent to atomic-r/m/w then
membar-r/rw, I only audited the cases of membar_enter that _aren't_
immediately after an atomic-r/m/w.  All of those cases assume
load-before-load/store.  But my assumption was wrong -- there are
cases of atomic-r/m/w then membar-w/rw that would be broken by
changing to atomic-r/m/w then membar-r/rw:

https://mail-index.netbsd.org/tech-kern/2022/03/29/msg028044.html

Furthermore, the name membar_enter has been adopted in other places
like OpenBSD where it actually does follow the documentation and
guarantee store-before-load/store, even if that order is not useful.
So the name membar_enter currently lives in a bad place where it
means either of two things -- r/rw or w/rw.

With this change, we deprecate membar_enter/exit, introduce
membar_acquire/release as better names for the useful pair (r/rw and
rw/w), and make sure the implementation of membar_enter guarantees
both what was documented _and_ what was implemented, making it an
alias for membar_sync.

While here, rework all of the membar_* definitions and aliases.  The
new logic follows a rule to make it easier to audit:

	membar_X is defined as an alias for membar_Y iff membar_X is
	guaranteed by membar_Y.

The `no stronger than' relation is (the transitive closure of):

- membar_consumer (r/r) is guaranteed by membar_acquire (r/rw)
- membar_producer (w/w) is guaranteed by membar_release (rw/w)
- membar_acquire (r/rw) is guaranteed by membar_sync (rw/rw)
- membar_release (rw/w) is guaranteed by membar_sync (rw/rw)

And, for the deprecated membars:

- membar_enter (whether r/rw, w/rw, or rw/rw) is guaranteed by
  membar_sync (rw/rw)
- membar_exit (rw/w) is guaranteed by membar_release (rw/w)

(membar_exit is identical to membar_release, but the name is
deprecated.)

Finally, while here, annotate some of the instructions with their
semantics.  For powerpc, leave an essay with citations on the
unfortunate but -- as far as I can tell -- necessary decision to use
lwsync, not isync, for membar_acquire and membar_consumer.

Also add membar(3) and atomic(3) man page links.
2022-04-09 23:32:51 +00:00
christos 6e7f090990 PR/56778: Detlev Casanova: Missing rl_initialize call in rl_copy_text 2022-04-08 20:11:31 +00:00
andvar 146d03e698 s/postion/position/ 2022-04-08 10:27:04 +00:00
andvar 2fa7e14158 fix various typos, mainly in comments, but also log messages, docs, game text. 2022-04-08 10:17:52 +00:00
andvar f5ed5a581a s/psuedo/pseudo/ 2022-04-07 20:23:44 +00:00
andvar e82c4d9bb4 fix various typos, mainly in comments. 2022-04-04 19:33:44 +00:00
christos 4776dc4064 Improve wording to avoid confusion about the return value of {v,}asprintf(3) 2022-04-03 14:17:53 +00:00
gutteridge b9dd3a3166 popen.3: revert s/null-/nul-/ change, this is subject to debate 2022-03-27 00:32:15 +00:00
uwe f560b4a780 __makenew: use calloc to get zeroed memory for window contents.
PR lib/56767.
2022-03-26 16:03:02 +00:00
rillig 8d3736f16d localtime.c: fix theoretical syntax error
If NetBSD were built with -DHAVE_MALLOC_ERRNO=0, the previous code would
have resulted in a compile error due to the extra '}'.  Fix this by
copying the upstream code.

No binary change.
2022-03-25 19:34:04 +00:00
rillig c87b5bf8e3 localtime.c: reduce unnecessary diff to upstream
No binary change.
2022-03-25 19:25:23 +00:00
rillig 3110a48882 localtime.c: take indentation style from upstream
This reduces the diff to upstream.

No binary change.
2022-03-25 19:00:15 +00:00
rillig fdcb92a153 localtime.c: add back storage class 'register'
This reduces the differences to the upstream code.

No binary change.
2022-03-25 18:35:50 +00:00
christos 7c976da19e put back the 2022a changes and fix the misplaced brace. 2022-03-24 16:15:05 +00:00
andvar e394a08199 s/interger/integer/ and s/Compensatin/Compensation/ in comments. 2022-03-24 12:12:00 +00:00
gutteridge 9d5e1357c3 popen.3: minor spelling, grammar, style, and xref tweaks 2022-03-24 01:55:15 +00:00
gutteridge b4afe916c2 fork.2: add _exit(2) xref and spell "ID" consistently 2022-03-24 01:52:48 +00:00
christos 728043b76b revert changes from 2022a for now until I figure out what's wrong. 2022-03-23 14:02:05 +00:00
andvar 43aafb237c fix typos in comments. 2022-03-22 21:45:13 +00:00
christos e1e5793746 welcome to tzcode-2022a
Changes to code

    Fix bug when mktime gets confused by truncated TZif files with
    unspecified local time.  (Problem reported by Almaz Mingaleev.)

    Fix bug when 32-bit time_t code reads malformed 64-bit TZif data.
    (Problem reported by Christos Zoulas.)

    When reading a version 2 or later TZif file, the TZif reader now
    validates the version 1 header and data block only enough to skip
    over them, as recommended by RFC 8536 section 4.  Also, the TZif
    reader no longer mistakenly attempts to parse a version 1 TZIf
    file header as a TZ string.

    zdump -v now outputs "(localtime failed)" and "(gmtime failed)"
    when local time and UT cannot be determined for a timestamp.
2022-03-22 17:48:39 +00:00
dholland f47c379500 setpgid.2: Mention that both child and parent need to call it.
Absence of this standard info was noticed by riastradh@.
2022-03-16 00:50:40 +00:00
riastradh f39c6c80d5 system(3): Simplify initialization of argp. 2022-03-14 22:14:19 +00:00
riastradh fd1bd01dd5 system(3): Switch from vfork/execve to posix_spawn.
Changes by me:
- Minor style nits.
- Set errno on posix_spawn failure.
- Handle edge cases of SIGINT/SIGQUIT set to SIG_IGN by caller.


Author: Nikita Ronja Gillmann <nikita@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
2022-03-14 22:06:28 +00:00
andvar 2532bf9bb5 s/hander/handler/ and s/hader/header/ in comments and documentation. 2022-03-13 17:50:54 +00:00
kre e9fdd3c848 Avoid referencing uninit'd memory. 2022-03-13 01:44:37 +00:00
christos 3249d3dc15 reallocarr returns errno. preserve it. 2022-03-12 17:31:39 +00:00
christos d1647d9c9f Fix filename autocompletion for strings like a\)b
An escaped character should unconditionally be skipped together with the
character that does the escaping. For example, in "a\)b" only the ")b"
part was skipped but then the loop stopped at the "\" since it's one of
the characters listed in word_break. (Piotr P. Stefaniak)
2022-03-12 15:29:17 +00:00
nia 2204e87327 _env: use reallocarr 2022-03-12 08:44:38 +00:00
nia 82fb0af1fa getservent_r: use reallocarr
CVSv ----------------------------------------------------------------------
2022-03-12 08:43:11 +00:00
nia 40b1d7b456 getprotoent_r: use reallocarr 2022-03-12 08:41:38 +00:00
nia a2c387ce35 vfwprintf(3): use reallocarr 2022-03-12 08:36:52 +00:00
nia 6e2ef45a7f setmode(3): use reallocarr instead of realloc(x * y) 2022-03-12 08:32:02 +00:00
nia 639499d824 setmode(3): use reallocarr instead of malloc(x * y) 2022-03-12 08:28:30 +00:00
nia 6876a60007 hcreate(3): use reallocarr instead of malloc(x * y) 2022-03-12 08:26:01 +00:00
christos 3682df8720 Add constrain arguments 2022-02-24 00:26:26 +00:00
andvar 1daa1a7b85 fix various typos in comments, mainly immediatly/immediately/,
as well shared and recently fixed typos in OpenBSD code by Jonathan Grey.
2022-02-23 21:54:40 +00:00
christos a7c17a0996 PR/56695: Walter Lozano: Correct declaration of hook functions. 2022-02-19 17:45:02 +00:00
riastradh e1fbe5b794 membar_ops(3): xref bus_dma, bus_space in SEE ALSO section too 2022-02-15 22:46:53 +00:00
andvar c45fbc6e3a fix few typos in comments and log message. 2022-02-13 22:20:08 +00:00
pgoyette b88e5267f2 Fix typo 2022-02-13 16:51:56 +00:00
christos 445350982e remove dup assignments (RVP) 2022-02-13 13:32:03 +00:00
riastradh 7adb41074d libpthread: Move namespacing include to top of .c files.
Stuff like libc's namespace.h, or atomic_op_namespace.h, which does
namespacing tricks like `#define atomic_cas_uint _atomic_cas_uint',
has to go at the top of each .c file.  If it goes in the middle, it
might be too late to affect the declarations, and result in compile
errors.

I tripped over this by including <sys/atomic.h> in mips
<machine/lock.h>.

(Maybe we should create a new pthread_namespace.h file for the
purpose, but this'll do for now.)
2022-02-12 14:59:32 +00:00
riastradh 63f70f5223 libpthread: Fix membars around rwlocks.
1. After loading self->pt_rwlocked, membar_enter() must not be
   conditional on PTHREAD__ATOMIC_IS_MEMBAR because there is no
   atomic r/m/w operation here which could imply the acquire barrier.

   (This should maybe just be a load-acquire operation, but we don't
   have atomic_load_acquire in userland at the moment -- TBD.)

2. Before storing thread->pt_rwlocked, must issue membar_exit() so
   that this is a store-release operation -- except if we had just
   done an atomic r/m/w and PTHREAD__ATOMIC_IS_MEMBAR is set, in
   which case it can be elided.

   The second membar_exit() added here might be safely hoisted out of
   the loop but I'm not sure -- needs more analysis to prove that
   would be safe.
2022-02-11 21:40:58 +00:00
rillig 6600de342a libc/getenv: remove trailing whitespace
No binary change.
2022-02-11 21:36:46 +00:00
rillig 657445084f libedit: fix typos, apply KNF to newly imported code (PR/56693)
No binary change.
2022-02-08 21:13:22 +00:00
christos 001f54a461 PR/56693: Walter Lozano: Add support for rl_delete_text and rl_set_key 2022-02-08 15:05:10 +00:00
christos ea988183cf PR/56622: Walter Lozano: Improve readline compatibility by adding
rl_readline_state support.
2022-01-31 14:44:49 +00:00
christos af918e051e Add more refreshes from Walter Lozano. The readline example in
http://www.mcld.co.uk/blog/2009/simple-gnu-readline-callback-style-example.html
still does not work, but it is better.
2022-01-29 20:52:45 +00:00
tnn 64af69d8bc librefuse: default_log_func is __printflike 2022-01-29 00:03:41 +00:00
andvar 7c674e8e6e remove double t from targeted, add missing r to arbitrary
And fix few more typos along the way in comments and man pages.
2022-01-26 11:48:53 +00:00
blymn f1942931a2 Correct (hopefully) the handling of wide characters.
* Remove the WCOL family of macros, these were "stealing" the upper bits
  of a character attribute to store the column width of a character.  No
  warning was given about this in curses.h which meant it was easy to
  accidentally reuse the bits in use by the WCOL macros (we already did).
  Add couple of 16bit ints to the character structure iff HAVE_WCHAR is
  true to hold the display width and wide char related flags (just
  continuation at the moment)
* Convert all instances of WCOL macros to just reference the column width
  in the char structure so it is not obfuscated.
* Fix cursor positioning so placing a cursor in the middle of a wide char
  actually does just that.
* Fix plod so it understands that if the cursor is going to be positioned
  in the middle of a wide char it cannot just reprint the char to get there.
* Fix plodput so it correctly counts the number of output characters for
  wide characters.
* Fix slk routines to properly size the wctomb() buffer.
2022-01-25 03:05:06 +00:00
andvar 492c086f0a s/begining/beginning/ in comments and messages. 2022-01-24 09:14:36 +00:00
rillig 5d27a0722d librefuse: fix lint warnings about void function returning a value
lib/librefuse/refuse_compat.c(155):
    error: void function fuse_unmount cannot return value [213]
lib/librefuse/refuse/v30.c(57):
    error: void function fuse_destroy_v30 cannot return value [213]
2022-01-23 21:07:28 +00:00
pho b2cb7fcce3 Use sysconf(_SC_PAGESIZE) instead of PAGE_SIZE
It broke build on platforms where PAGE_SIZE was not defined in
<machine/vmparam.h>.
2022-01-22 13:25:55 +00:00
pho ec9afb4282 lib/librefuse: Implement all sorts of compat tweaks to appease various file systems
ReFUSE now supports all the FUSE API variants from FUSE 1.1 to FUSE
3.10. Sorry for the freaking giant patch. I could not break it down
any further.
2022-01-22 08:09:39 +00:00
pho a7ce7be0fd Zero-clear the fuse_context in fuse_destroy(3) 2022-01-22 08:07:02 +00:00
pho e9501242bf Add some missing struct fields, structs, and constants that are part of the API 2022-01-22 08:06:21 +00:00
pho d61ee2ebc0 Support the FUSE option -ho
It is supposed to print a help message without the usage
line. Although it is deprecated and has been removed as of FUSE 3.0,
filesystems in the wild still use it.
2022-01-22 08:05:35 +00:00
pho fb59fa675b Implement some missing functions that are part of the API 2022-01-22 08:03:32 +00:00
pho 9733de6685 Correct the wrong prototype of fuse_daemonize(3) while retaining ABI compatibility 2022-01-22 08:02:49 +00:00
pho 8a6bfb22b5 Cosmetic changes 2022-01-22 08:01:50 +00:00
pho a045b4fd1a Change the way how FUSE_*_VERSION are handled
* FUSE_MAKE_VERSION(maj, min) now generates a 3-digits number if the
  version is higher than 3.9. This is needed to support FUSE 3.10 API.

* FUSE_{MAJOR,MINOR}_VERSION no longer have a fixed value but are
  derived from FUSE_USE_VERSION specified by the user code. This is
  needed to support more FUSE filesystems in the wild.
2022-01-22 08:01:12 +00:00
pho b40bd486c8 Implement a dummy pathconf() which always returns EINVAL 2022-01-22 08:00:17 +00:00
pho 12c809c691 Do not call fuse_operations.getattr() before initializing filesystem 2022-01-22 07:59:33 +00:00
pho c68139a4b6 Increase the warning level to spot more mistakes 2022-01-22 07:58:32 +00:00
pho a95017a87a lib/librefuse: Add support for legacy types and functions 2022-01-22 07:57:30 +00:00
pho 97dc09a69d lib/librefuse: Add stub functions for FUSE polling API 2022-01-22 07:56:15 +00:00
pho ce847e0a0b lib/librefuse: Implement data buffer API appeared on FUSE 2.9 2022-01-22 07:54:56 +00:00
pho 9f39150738 lib/librefuse: Implement FUSE session API and its signal handling functionality 2022-01-22 07:53:05 +00:00
pho 153b9c141b lib/librefuse: Implement logging API appeared on FUSE 3.7 2022-01-22 07:38:45 +00:00
pho 0585557a98 Allow calling puffs_mount(3) before puffs_daemon(3)
puffs_daemon(3) creates a pipe before forking, and the parent process
waits for the child to either complete puffs_mount(3) or fail. If a
user calls puffs_daemon(3) after puffs_mount(3), the function
deadlocks. While this error-reporting functionality is really a nice
thing to have, deadlocking is not great. If the filesystem has already
been mounted, puffs_mount(3) should just daemonize the process and
return.

This became an issue because fuse_daemonize(3) in FUSE API had no such
requirement and some FUSE filesystems in the wild suffered deadlocks.
2022-01-22 07:35:26 +00:00
christos 0f6437ba99 PR/56640: Kimmo Suominen: Correct HISTORY section. 2022-01-17 17:56:48 +00:00
rillig fba4f6e3e8 libpam: remove stray semicolon
No binary change.
2022-01-16 10:52:18 +00:00
rillig 7af2475f78 libcurses: remove unreachable statements
Found by lint.

No binary change.
2022-01-16 10:30:45 +00:00
christos daa505a92e Don't use __printflike, use the explicit attribute so that this works outside
NetBSD.
2022-01-14 13:31:05 +00:00
tnn 27a90dcd8a libedit: rl_message: annotate __printflike 2022-01-14 12:48:30 +00:00
christos b7e56637d9 PR/56618: Walter Lozano: Improve libedit compatibility with readline by
implementing:

    rl_copy_text, rl_erase_empty_line, rl_message, rl_on_new_line,
    rl_replace_line, rl_restore_prompt, rl_save_prompt
2022-01-11 18:30:15 +00:00
christos 68f6d39511 read the ps arguments from the correct place. 2022-01-10 20:04:01 +00:00
christos 104ea67795 Get rid of usrstack/USRSTACK. Document that the old version of getargv is
broken because of ASLR.
2022-01-10 19:51:30 +00:00
blymn 47946660f2 Revert change for array definition, it was incorrect, thanks Uwe. 2022-01-06 20:50:18 +00:00
blymn ebe5c3e633 Properly size and array to hold the larget return from wctomb. 2022-01-06 06:18:13 +00:00
andvar 1f6edd928c s/compnent/component/ 2022-01-04 22:10:08 +00:00
uwe bcb93c2ab4 exec(3): execlpe() first argument should be named "file"
"path" arguments are names used as-is, "file" arguments to "p"
functions are used to construct the pathname using $PATH if necessary.
2022-01-04 20:01:52 +00:00
uwe b4852c3567 getopt_long(3): "index" is an argument, not a field. 2022-01-04 19:36:16 +00:00
uwe 868269f7b0 getopt_long(3): use NULL, not 0, for flag in the example. 2022-01-04 19:32:16 +00:00
uwe f139c7cd08 ptsname(3): fix equivalence example
The buffer is static, don't make it appear that we are returning a
pointer to a local variable.
2022-01-02 03:46:40 +00:00
christos 8a3a1ac9a9 zero out the tzh structure to fix reproducibile builds. 2022-01-01 21:01:21 +00:00
msaitoh 988ab2c9fa s/sytem/system/ 2022-01-01 10:32:28 +00:00
msaitoh 777518dc50 s/implemenation/implementation/ in comment. 2022-01-01 08:34:34 +00:00
andvar 3746949308 fix few typos in comments, mainly in word "parameter". 2021-12-31 20:22:48 +00:00
uwe 017b38e5d1 curses: spell "foreground" correctly in comments 2021-12-17 03:50:18 +00:00
blymn 395d5f8537 Fix for PR lib/56298
Remove the DIAGASSERT for str being NULL in the puts/putp functions,
add protection so that the functions just return OK if str is NULL.
This prevents the assert firing when libcurses passes through a NULL
due to an undefined terminfo entry.
2021-12-15 21:07:12 +00:00
andvar 0e6a3361ec fix typos in word "request(s)". 2021-12-12 09:00:07 +00:00
andvar eb03b08ccf fix typos in word "operation(s)". 2021-12-12 08:49:57 +00:00
mrg d914a3c1b9 remove clause 3 from all my licenses that aren't conflicting with
another copyright claim line.  again.  (i did this in 2008 and then
did not update all of my personal templates.)
2021-12-11 19:24:18 +00:00
andvar cbf5c65aff s/occured/occurred/ in comments, log messages and man pages. 2021-12-10 20:36:02 +00:00
andvar 8c4df4824b s/unaccessible/inaccessible/ 2021-12-10 19:30:05 +00:00
msaitoh 98b4f01524 s/premissions/permissions/ 2021-12-10 11:08:45 +00:00
andvar 6012d766dc fix various typos in comments and log messages. 2021-12-08 20:50:01 +00:00
andvar 42412bc75c s/efficent/efficient/ in comments. 2021-12-08 20:11:54 +00:00
andvar 253f520862 s/listner/listener/ 2021-12-07 22:09:59 +00:00
gson 8774b772cf In unix_parse(), always allocate memory for the entire struct sockaddr_un
and not just the part used by the present pathname, because the entire
struct will be passed to bind() and an EFAULT can result if not all of
it is a valid allocation.  Fixes PR kern/56533.
2021-12-07 10:39:33 +00:00
christos 12df8a1ef8 PR/56538: coypu: For compat ctime and friends (when time_t was 32 bits)
we want to load the timezone data using the same structs they were saved as.
Introduce __time_t which is always 64 bits and make the minimal changes for
this to work. Yes, it is ugly.
2021-12-05 18:06:24 +00:00
rillig a1de340f77 jemalloc.3: fix malformed CVS Id 2021-12-05 14:25:04 +00:00
msaitoh 73b5f8505b s/supress/suppress/ 2021-12-05 08:09:30 +00:00
msaitoh e44b4c4dd0 s/succesful/successful/ in comment. 2021-12-05 08:03:06 +00:00
msaitoh 2b50e65cd3 s/numberic/numeric/ in comment. 2021-12-05 05:03:05 +00:00
msaitoh 1316021699 s/argumetn/argument/ in comment. 2021-12-05 04:22:50 +00:00
pho 1f6f9b8380 librefuse: Preparation of a proper API versioning; no more #ifdef woes in user code
The goal is to fully support FUSE API version 3.0 while maintaining
API/ABI compatibility with code written for 2.6 (or even older).

* <fuse.h> now emits a compiler warning if it's included without
  defining FUSE_USE_VERSION. It had been silently defaulted to the
  latest supported version prior to this change. This is permissive
  compared to the original FUSE, as it emits an error instead.

* <fuse.h> now emits a warning if FUSE_USE_VERSION is higher than what
  can be provided.

* Added a macro FUSE_MAKE_VERSION(maj, min). It was missing from
  librefuse <fuse.h>.

No actual API updates have been made (yet).
2021-12-04 06:42:39 +00:00
pho f347108ede Use size_t in place of voff_t in puffs_setrootinfo(3)
Chuck Silvers pointed out that voff_t was also supposed to be
kernel-only. The correct type to use in userland would be off_t, but
since changing vsize_t to either voff_t or off_t is an ABI change on
32-bit platforms, we use size_t knowing that it is technically
incorrect.
2021-12-03 17:12:17 +00:00
pho 52a1252312 Avoid using register_t or vsize_t in <puffs.h>
<puffs.h> is a user-space header, and should not use any of
kernel-only types. It's not reasonable to require user-land
filesystems to #define _KERNTYPES.
2021-12-03 14:00:59 +00:00
andvar d1c4e519a3 fix various typos in comments, log messages and documentation. 2021-12-03 13:27:37 +00:00
pho f970914ed4 Revert my previous change to struct fuse_opt
I should have thought twice before commiting it. Of course changing
the layout of a struct breaks ABI compatibility. Change the offset
back to fixed 32 bits.
2021-12-01 14:17:50 +00:00
pho a399eed30e Use correct types for the fields of struct fuse_opt
This change shouldn't make any behavioral differences in reality, but
compilers these days dislike converting -1U to int32_t implicitly,
which is indeed understandable.
2021-12-01 13:51:33 +00:00
pho 13646d1209 Move the call of fuse_operations::init() from fuse_new() to fuse_loop()
Prior to this change we were calling init() before daemonizing the
process. Some filesystems call chdir(2) in init() but fuse_daemonize()
call chdir("/"), which breaks assumptions about the state of the
process.
2021-11-30 12:13:12 +00:00
skrll 3f3a46002b Trailing whitespace 2021-11-27 10:00:01 +00:00
thorpej 5696be5584 Decorate the VAX signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.

N.B. This is currently disabled, as these .cfi directives cause
linker warnings about incompatible TEXTREL relocations in .eh_frame.
2021-11-24 15:05:15 +00:00
thorpej cb0c5a1873 Decorate the SuperH signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
2021-11-24 02:01:15 +00:00
thorpej 389a070437 Decorate the ARM signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
2021-11-23 18:45:53 +00:00
thorpej 445de9ccf9 Because the PC is not a general purpose register on aarch64, we need
to use DWARF pseudo-register for the signal trampoline return address.

Adjust the style to match other platforms.
2021-11-23 02:49:55 +00:00
blymn fc986dbc59 Don't waste time setting the dirty flag multiple times. 2021-11-22 21:25:25 +00:00
nia 1569bcc0b3 cgdconfig(8): Add an argon2id password-based key generation method
This provides an extra level of side-channel and cracking resistance
compared to the pre-existing pkcs5_pbkdf2/sha1 method used for
password-based disk encryption.

Several new keygen parameters are supported:

	memory (integer, in kilobytes)
	parallelism (integer, usually the number of CPU cores)
	version (integer, usually 19...)

We do our best to calibrate these automatically when the paramsfile
is initially generated.

lgtm riastradh@
2021-11-22 14:34:35 +00:00
nia 5a3dc90041 crypt(3): document some of the memory units we're dealing with 2021-11-22 14:30:24 +00:00
thorpej 93b0ea009f Decorate the m68k signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
2021-11-21 23:58:09 +00:00
thorpej f8ce691891 Decorate the powerpc signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
2021-11-21 21:31:24 +00:00
thorpej a7d9970d1b Use the DWARF pseudo-register for the signal trampoline return address. 2021-11-20 19:26:20 +00:00
wiz 5ef525c783 Mention that fchmod conforms to XPG 4.2. Bump date. 2021-11-19 23:51:16 +00:00
thorpej 91fe750880 Decorate the MIPS signal trampoline with the appropriate .cfi
directives to allow exception unwind / backtrace across a signal
handler.
2021-11-18 04:33:20 +00:00
kre 3ba1fc18cc Move 'i' into DEBUG only code (now there be three).
Hopefully unbreaks !DEBUG builds.
2021-11-16 23:23:02 +00:00
blymn 145a760e05 Fix handling of the tab special character. 2021-11-16 21:00:50 +00:00
kre 676e85297d More cleanups and typo corrections. 2021-11-15 16:00:25 +00:00
wiz 0c114f84f3 Clean up. 2021-11-15 14:07:30 +00:00
wiz 4769a7f2b1 Sort SEE ALSO. 2021-11-15 14:06:50 +00:00
christos 18b914f008 Add man pages for posix_spawn_file_actions_add{f,}chdir from piyush 2021-11-15 14:01:50 +00:00
blymn 84d376be86 Fix for PR lib/55433
Correct the behaviour for ins_wstr:
* Properly check the string will fit by processing any special
  characters present when preforming the check.
* Simplify the routine by removing code that duplicates the code in
  _cursesi_addwchar and just call _cursesi_addwchar.
2021-11-15 06:27:06 +00:00
andvar 369abe069b fix various typos, mainly s/prefered/preferred/ 2021-11-07 20:31:09 +00:00
christos 1c05296632 Commit the userland portion of the posix_spawn_chdir project by Piyush Sachdeva 2021-11-07 14:34:30 +00:00
nia cce5ae2abd usbhid(3): use reallocarr 2021-11-03 16:18:09 +00:00
thorpej cb352d50ab CFI: Saved RA needs to point to the PC slot in the ucontext_t. 2021-11-03 04:52:51 +00:00
thorpej c570a44480 Set up the CFI in a slightly more rational way. 2021-11-03 03:58:31 +00:00
nia 464e94c8b5 fts(3): Use reallocarr instead of realloc(x * y), eliminate a temporary
variable.
2021-11-02 08:39:20 +00:00
thorpej 7c30b7e17f Adjust for new __sigaction_siginfo symbol. 2021-11-02 06:54:10 +00:00
nia 122b5006ee Force at most partial RELRO for rump_server and related libraries
rump_server with -l uses lazy resolution by default and thus cannot be
used with full RELRO/BIND_NOW.
2021-11-01 21:37:32 +00:00
andvar 9a662625bc fix typos, mainly in words minimum and maximum, but also few others. 2021-11-01 21:28:01 +00:00
christos 04f561bb0b Remove workaround, @rillig fixed the issue. 2021-11-01 15:56:53 +00:00
christos 637f9844ca work around lint bug 2021-11-01 12:26:18 +00:00
thorpej 02edde8aa3 Version the sigaction(2) libc wrapper. The new version uses the "siginfo"
trampoline exclusively, thus relegating "sigcontext"-style handlers (which
have not been documented for many years now) to the dustbin of the compat
library.
2021-11-01 05:53:45 +00:00
thorpej 2b286a53d4 Don't mention the "struct sigaltstack" name of "stack_t". 2021-11-01 05:29:35 +00:00
agc 2c1df105e9 Remove the
COPTS.*+=       -Wno-error=.*

lines for building argon2 sources, by fixing the problems at source.

Addresses Rin Okuyama's concerns on tech-userlevel/tech-crypto in

	Message-ID: <f1eab199-3607-bb05-15cc-033e38721ba4@gmail.com>
2021-11-01 03:09:58 +00:00
thorpej 0d8e07b5c7 Tidy up how __sigaction14_sigtramp.c is added to SRCS. 2021-10-31 22:24:34 +00:00
nia 9c5ddbe34d libcrypt: Compile with USE_FORT, for this is cryptographic software. 2021-10-31 09:16:08 +00:00
christos 7a6d5cb630 Put back the sigcontext sigtramp code. 2021-10-30 21:39:28 +00:00
nia e2fa600c84 pam_exec: Convert realloc(x * y) to reallocarr.
Eliminate a now-redundant temporary variable.
2021-10-30 11:34:59 +00:00
nia b893c4d5e4 libtelnet: convert malloc(x * y) to reallocarr 2021-10-30 10:46:57 +00:00
nia 8221e07e84 puffs(3): Replace realloc(x * y) with reallocarr 2021-10-30 10:34:18 +00:00
nia 31c52db692 refuse(3): Simplify reallocation logic with reallocarr. 2021-10-30 09:06:34 +00:00
kre f3643917bc Add "--" 'options end' parameter to the sh -c call that runs the
command, so that the command cannot appear to be more options
(which always then fails, as there would be no arg for "-c" to
treat as the command string in that case).

For the full (LONG) explanation, see:
   http://mail-index.netbsd.org/current-users/2021/10/29/msg041629.html
2021-10-29 19:27:06 +00:00
nia 129cb9a54f libcrypt: Fix a floating point exception when a low number of HMAC-SHA1
iterations are specified.
2021-10-29 13:22:08 +00:00
nia 99f42ade26 reallocarr does not set errno. 2021-10-29 11:03:46 +00:00
nia 7ab7c5f604 citrus: Use calloc instead of malloc'ing and clearing the array manually 2021-10-29 10:54:56 +00:00
nia 2ee81e7b06 scandir(3): Convert malloc(x * y) and realloc(x * y) to reallocarr 2021-10-29 10:40:00 +00:00
nia 1aca51f7f5 radixsort(3): use reallocarr instead of malloc(x * y) 2021-10-29 10:29:51 +00:00
nia 46bf9c16cb wcsdup(3): use reallocarr to catch integer overflow 2021-10-29 10:11:57 +00:00
riastradh 436ee50286 Fix typo in comment: allows, not alows.
I don't know what an alow is, maybe some cousin of the alot.
Awaiting a nature documentary by Allie Brosh about these perhaps more
elusive beasts.

PR misc/56473, from jschauma
2021-10-28 20:56:32 +00:00
kim 3590d12b68 Use .Sq instead of a dangling .So 2021-10-28 09:51:39 +00:00
nia f76dddbc66 getaddrinfo(3): malloc + memset -> calloc 2021-10-27 19:24:38 +00:00
christos 1971734547 fix problem with uninitialized variable on malformed 32 bit time. 2021-10-27 11:27:25 +00:00
thorpej 5184898635 - Use the signal trampoline version constants from <sys/signal.h>.
- Declare the sigtramp externs as as char arrays, not int arrays; not all
  platforms have fixed-sized 32-bit instructions.
2021-10-27 04:48:33 +00:00
nia 78b3fd4666 libcrypt: Make Werror-disables for external Argon2 library per-file.
Requested by rin.
2021-10-26 20:37:18 +00:00
christos 0faead2ffb Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
  no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
  sigcontext before. all the other ports that supported sigcontext had
  the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.
2021-10-26 16:16:34 +00:00
nia 1008642e66 libcrypt: fine-grained warnings for argon2, requested by rin 2021-10-26 07:51:23 +00:00
blymn d84a936f4b Fix for PR lib/47398
Move cursor to end of the currently active field and sync the cursor
location so the cursor get positioned correctly when the form window
is refreshed.
2021-10-25 06:25:18 +00:00
gutteridge e036c8bd09 setlocale.3: minor updates to reflect the current implementation
Reflect a couple of amendments noted by John Marino on tech-userlevel:
http://mail-index.netbsd.org/tech-userlevel/2021/10/19/msg013091.html
2021-10-24 17:30:19 +00:00
thorpej d5b8844629 Add support for the EVFILT_EMPTY filter, which is activated when the
write buffer associated with the file descriptor is empty.  This is
currently implemented only for sockets, and is intended primarily to
provide visibility to applications that all previously written data
has been acknowledged by the TCP layer on the receiver.  Compatible
with the same filter in FreeBSD.
2021-10-23 01:28:33 +00:00
ryoon e41648e26b Fix build failure
* Fix merge mistake.
* Cast to int for strict comparison like before.
2021-10-22 16:57:14 +00:00
christos 1b58480149 Change to code and documentation from 2021a -> 2021e
Release 2021e - 2021-10-21 18:41:00 -0700

  Changes to code

    none


Release 2021d - 2021-10-15 13:48:18 -0700

  Changes to code

    'zic -r' now uses "-00" time zone abbreviations for intervals
    with UT offsets that are unspecified due to -r truncation.
    This implements a change in draft Internet RFC 8536bis.


Release 2021c - 2021-10-01 14:21:49 -0700

  Changes to code

    Fix a bug in 'zic -b fat' that caused old timestamps to be
    mishandled in 32-bit-only readers (problem reported by Daniel
    Fischer).

  Changes to documentation

    Distribute the SECURITY file (problem reported by Andreas Radke).


Release 2021b - 2021-09-24 16:23:00 -0700

  Changes to maintenance procedure

    The new file SECURITY covers how to report security-related bugs.

    Several backward-compatibility links have been moved to the
    'backward' file.  These links, which range from Africa/Addis_Ababa
    to Pacific/Saipan, are only for compatibility with now-obsolete
    guidelines suggesting an entry for every ISO 3166 code.
    The intercontinental convenience links Asia/Istanbul and
    Europe/Nicosia have also been moved to 'backward'.

  Changes to code

    zic now creates each output file or link atomically,
    possibly by creating a temporary file and then renaming it.
    This avoids races where a TZ setting would temporarily stop
    working while zic was installing a replacement file or link.

    zic -L no longer omits the POSIX TZ string in its output.
    Starting with 2020a, zic -L truncated its output according to the
    "Expires" directive or "#expires" comment in the leapseconds file.
    The resulting TZif files omitted daylight saving transitions after
    the leap second table expired, which led to far less-accurate
    predictions of times after the expiry.  Although future timestamps
    cannot be converted accurately in the presence of leap seconds, it
    is more accurate to convert near-future timestamps with a few
    seconds error than with an hour error, so zic -L no longer
    truncates output in this way.

    Instead, when zic -L is given the "Expires" directive, it now
    outputs the expiration by appending a no-change entry to the leap
    second table.  Although this should work well with most TZif
    readers, it does not conform to Internet RFC 8536 and some pickier
    clients (including tzdb 2017c through 2021a) reject it, so
    "Expires" directives are currently disabled by default.  To enable
    them, set the EXPIRES_LINE Makefile variable.  If a TZif file uses
    this new feature it is marked with a new TZif version number 4,
    a format intended to be documented in a successor to RFC 8536.

    zic -L LEAPFILE -r @LO no longer generates an invalid TZif file
    that omits leap second information for the range LO..B when LO
    falls between two leap seconds A and B.  Instead, it generates a
    TZif version 4 file that represents the previously-missing
    information.

    The TZif reader now allows the leap second table to begin with a
    correction other than -1 or +1, and to contain adjacent
    transitions with equal corrections.  This supports TZif version 4.

    The TZif reader now lets leap seconds occur less than 28 days
    apart.  This supports possible future TZif extensions.

    Fix bug that caused 'localtime' etc. to crash when TZ was
    set to a all-year DST string like "EST5EDT4,0/0,J365/25" that does
    not conform to POSIX but does conform to Internet RFC 8536.

    Fix another bug that caused 'localtime' etc. to crash when TZ was
    set to a POSIX-conforming but unusual TZ string like
    "EST5EDT4,0/0,J365/0", where almost all the year is DST.

    Fix yet another bug that caused 'localtime' etc. to mishandle slim
    TZif files containing leap seconds after the last explicit
    transition in the table, or when handling far-future timestamps
    in slim TZif files lacking leap seconds.

    Fix localtime misbehavior involving positive leap seconds.
    This change affects only behavior for "right" system time,
    which contains leap seconds, and only if the UT offset is
    not a multiple of 60 seconds when a positive leap second occurs.
    (No such timezone exists in tzdb, luckily.)  Without the fix,
    the timestamp was ambiguous during a positive leap second.
    With the fix, any seconds occurring after a positive leap second
    and within the same localtime minute are counted through 60, not
    through 59; their UT offset (tm_gmtoff) is the same as before.
    Here is how the fix affects timestamps in a timezone with UT
    offset +01:23:45 (5025 seconds) and with a positive leap second at
    1972-06-30 23:59:60 UTC (78796800):

	time_t    without the fix      with the fix
	78796800  1972-07-01 01:23:45  1972-07-01 01:23:45 (leap second)
	78796801  1972-07-01 01:23:45  1972-07-01 01:23:46
	...
	78796815  1972-07-01 01:23:59  1972-07-01 01:23:60
	78796816  1972-07-01 01:24:00  1972-07-01 01:24:00

    Fix an unlikely bug that caused 'localtime' etc. to misbehave if
    civil time changes a few seconds before time_t wraps around, when
    leap seconds are enabled.

    Fix bug in zic -r; in some cases, the dummy time type after the
    last time transition disagreed with the TZ string, contrary to
    Internet RFC 8563 section 3.3.

    Fix a bug with 'zic -r @X' when X is a negative leap second that
    has a nonnegative correction.  Without the fix, the output file
    was truncated so that X appeared to be a positive leap second.
    Fix a similar, even-less-likely bug when truncating at a positive
    leap second that has a nonpositive correction.

    zic -r now reports an error if given rolling leap seconds, as this
    usage has never generally worked and is evidently unused.

    zic now generates a POSIX-conforming TZ string for TZif files
    where all-year DST is predicted for the indefinite future.
    For example, for all-year Eastern Daylight Time, zic now generates
    "XXX3EDT4,0/0,J365/23" where it previously generated
    "EST5EDT,0/0,J365/25" or "".  (Thanks to Michael Deckers for
    noting the possibility of POSIX conformance.)

    zic.c no longer requires sys/wait.h (thanks to spazmodius for
    noting it wasn't needed).

    When reading slim TZif files, zdump no longer mishandles leap
    seconds on the rare platforms where time_t counts leap seconds,
    fixing a bug introduced in 2014g.

    zdump -v now outputs timestamps at boundaries of what localtime
    and gmtime can represent, instead of the less-useful timestamps
    one day after the minimum and one day before the maximum.
    (Thanks to Arthur David Olson for prototype code, and to Manuela
    Friedrich for debugging help.)

    zdump's -c and -t options are now consistently inclusive for the
    lower time bound and exclusive for the upper.  Formerly they were
    inconsistent.  (Confusion noted by Martin Burnicki.)

  Changes to build procedure

    You can now compile with -DHAVE_MALLOC_ERRNO=0 to port to
    non-POSIX hosts where malloc doesn't set errno.
    (Problem reported by Jan Engelhardt.)

  Changes to documentation

    tzfile.5 better matches a draft successor to RFC 8536
    <https://datatracker.ietf.org/doc/draft-murchison-rfc8536bis/01/>.
2021-10-22 14:26:04 +00:00
andvar 6ff503baef Revert "Does not work" back to "Does no work". It wasn't a typo. 2021-10-21 21:35:02 +00:00
andvar 6f8dc1509f fix various typos, mainly in comments, but also in man pages and log messages. 2021-10-21 13:21:53 +00:00
nia 58856d1265 crypt.3: add a reference for Argon2 2021-10-20 20:29:33 +00:00
nia cb1631f686 Be a little bit more eager to let Argon2 use memory. 2021-10-20 20:21:44 +00:00
nia ac4429015a crypt(3): For argon2, default to time=3.
Good enough for a 50MHz SPARC, a shark, and the spec.
2021-10-20 16:46:33 +00:00
nia 364b5e2621 crypt(3): return 0 -> return NULL for function returning char * 2021-10-20 15:35:42 +00:00
nia 08100292d3 crypt(3): Adapt default Argon2 parameters to system performance
If the parameters are unspecified:

- Set the default memory consumption based on the amount of memory
available to userspace.

The algorithm actually slows down incredibly quickly as the "memory"
parameter is increased. We want to avoid running out of memory on low
memory systems, but increase the difficulty of bruteforcing passwords
from systems with a lot of memory. At the same time, we want to avoid
problems when concurrent logins are happening.

- Run a hashing loop for one second with steadily increasing "time"
until we settle on a value for "time". We want to use as much CPU time
as reasonable for computing the password hash without making logins
inconvenient.
2021-10-20 13:03:29 +00:00
thorpej 56265c7c8b Oops, forgot to note the history of NOTE_OPEN, NOTE_CLOSE, NOTE_CLOSE_WRITE,
and NOTE_READ.
2021-10-20 03:26:20 +00:00
thorpej 982ae832c3 Overhaul of the EVFILT_VNODE kevent(2) filter:
- Centralize vnode kevent handling in the VOP_*() wrappers, rather than
  forcing each individual file system to deal with it (except VOP_RENAME(),
  because VOP_RENAME() is a mess and we currently have 2 different ways
  of handling it; at least it's reasonably well-centralized in the "new"
  way).
- Add support for NOTE_OPEN, NOTE_CLOSE, NOTE_CLOSE_WRITE, and NOTE_READ,
  compatible with the same events in FreeBSD.
- Track which kevent notifications clients are interested in receiving
  to avoid doing work for events no one cares about (avoiding, e.g.
  taking locks and traversing the klist to send a NOTE_WRITE when
  someone is merely watching for a file to be deleted, for example).

In support of the above:

- Add support in vnode_if.sh for specifying PRE- and POST-op handlers,
  to be invoked before and after vop_pre() and vop_post(), respectively.
  Basic idea from FreeBSD, but implemented differently.
- Add support in vnode_if.sh for specifying CONTEXT fields in the
  vop_*_args structures.  These context fields are used to convey information
  between the file system VOP function and the VOP wrapper, but do not
  occupy an argument slot in the VOP_*() call itself.  These context fields
  are initialized and subsequently interpreted by PRE- and POST-op handlers.
- Version VOP_REMOVE(), uses the a context field for the file system to report
  back the resulting link count of the target vnode.  Return this in tmpfs,
  udf, nfs, chfs, ext2fs, lfs, and ufs.

NetBSD 9.99.92.
2021-10-20 03:08:16 +00:00
blymn 5b90c1a33c Fix for PR lib/47397
Fix a misinterpretation of the role of field fore and back.  Now field
pad is rendered in the back attribute always instead of only being used
for the non-current field.
2021-10-19 21:22:20 +00:00
blymn 63621d5a6b Add a bit more debug. 2021-10-19 06:41:03 +00:00
blymn 669adb1459 Fix for PR pkg/55931
Don't move the cursor when getch is called if input is not going to
be echoed.  Lynx uses the cursor to mark the current selection in a
pop-up, previously the cursor was being relocated when getch was called
which broke the Lynx item marking.
2021-10-19 06:37:29 +00:00
nia f9151ba943 libcrypt: Hide more private symbols by default. Fix style. 2021-10-16 10:53:33 +00:00
nia 6d05989be6 libcrypt: work around compiler bugs to get MKARGON2 working on vax 2021-10-13 14:28:32 +00:00
thorpej dbceac44db Add support for the NOTE_SECONDS, NOTE_MSECONDS, NOTE_USECONDS,
NOTE_NSECONDS, and NOTE_ABSTIME filter flags to EVFILT_TIMER,
API-compatible with the same in FreeBSD.
2021-10-13 04:57:19 +00:00
wiz 0fe65de003 Capitalize word. 2021-10-12 21:41:13 +00:00
nia a5ad08a454 crypt.3: note parallelism caveats 2021-10-12 17:27:26 +00:00
nia 87c3d6fe5c Fix release builds with MKARGON2=yes
This changes argon2 from a separately built library into a private
dependency of libcrypt and removes the argon2(1) utility (we already
have pwhash(1)). Giving libcrypt more library dependencies
complicates things (e.g. libcrypt is a dependency of openssl).
pthreads support gets disabled in argon2 for similar reasons.

For testing argon2, we rely on the libcrypt test suite.
2021-10-12 17:24:36 +00:00