master
better placement for dnssocket/dnsconnect
Move mutex, condvar, and thread-specific data routes, pthread_once, and pthread_exit from libpthread to libc, along with low-level bits to support them. Major bump to both libc and libpthread.
Switch if_nameindex(3) to use the new NET_RT_IFNAMES sysctl to get the list of interface names. At the same time switch if_nametoindex(3) and if_indextoname(3) to use if_nameindex(3) instead of getifaddrs(3). if_nameindex(3) exposes much less then getifaddrs(3) and is allowed by pledge(2). With and OK deraadt@
Wrap <ifaddrs.h>, <netinet/in.h>, and <netinet/if_ether.h> so internal calls go direct and all the symbols are weak
Wrap <rpc/*.h> so that calls go direct and the symbols are all weak. Hide __xprt_register() and _authenticate(); truncate <rpc/svc_auth.h>
Stop publicly declaring _yp_dobind() and struct dom_binding, closing out a rant Theo wrote 24 years ago. Mark __ypexclude_{add,is,free}() as hidden
Add elf_aux_info(3)
Allow the caller of asr functions to create and use a specific context. Diff from eric@ and florian@, commiting on their behalf since they are absent and we want to ride the minor shlib bump.
Wrap <assert.h> so that __assert2() goes direct
Wrap blowfish, sha*, md5, and rmd160 so that internal calls go direct
libc's authentication privsep layer performed insufficient username validation. Repair work mostly by markus and millert, first of all solving the primary problem, then adding some additional validation points. And then futher validation in login and su. This will be 6.5/021_libcauth.patch.sig and 6.6/010_libcauth.patch.sig Reported by Qualys
New POSIX xlocale implementation written from scratch. Complete in the sense that all POSIX *locale(3) and *_l(3) functions are included, but in OpenBSD, we of course only really care about LC_CTYPE and we only support ASCII and UTF-8.
Remove dead support for changing BDB hash algorithm and cache of alternatives
Add scandirat(3); from freebsd
Correct error returns, do not print eror message to stdout (there is a dlerror() function for that) and mark dladdr() as PROTO_NORMAL to be able to call it from a malloc.c MALLOC_STATS leak reporting project I'm working on. ok kettenis@
Pull in namespace.h when building all .c files using gcc's -include option, so that we can provide asm labels for the memcpy/memset/__stack_smash_handler calls that it generates ab initio. Eliminate direct #includes of it. Make sure it's a dependency of all objects (unnecessary for asm, but close enough).
Use a Thread Information Block in both single and multi-threaded programs. This stores errno, the cancelation flags, and related bits for each thread and is allocated by ld.so or libc.a. This is an ABI break from 5.9-stable!
Make sure attributes are applied to function declarations before they're used or defined, as clang isn't as forgiving as gcc. Also, declare __flt_rounds() so that libc can build it despire clang providing its own <float.h>
Wrap <fstab.h> so that calls go direct and the symbols are all weak (Do you sense a theme?)
Wrap <fts.h> and <ftw.h> so that internal calls to fts_*() go direct and fts_*(), ftw(), and nftw() are weak symbols
Don't wrap initialized variables: binutils appears to be mishandling them on arm and m88k
Add uid_from_user() and gid_from_group(), derived from pax's cache.c. It replaces the existing pwcache.c functions user_from_uid(3) and group_from_gid(3) with the pax equivalents. Adapted from NetBSD (mycroft) changes from our own pax's cache.c. OK guenther@
Wrap <icdb.h> so that calls go direct and the symbols are all weak
Wrap fpgetround() so internal calls to it (seen on arm, powerpc, and sh) go direct instead of through the PLT.
Wrap <inttypes.h> and finish wrapping of <wchar.h> so that calls go direct and the symbols not in the C standard are weak
Complete the ld.so boot cleanup: move most libc initialization from _csu_finish() to _libc_preinit(), which is an .init_array function in shared libc (and mark it INITFIRST) or a .preinit_array function in static libc, grabbing the _dl_cb callback there from ld.so. Then in _csu_finish(), invoke the dl_clean_boot() callback to free ld.so's startup bits before main() gets control.
secure_path(3) hasn't been called since we recognized the TOCTOU issues a few years back, so we can remove it. Since nothing in the ecosystem calls it, I am not cranking the libc major as required, surely another crank will come along soon. noticed by Dante Catalfamo ok millert
Wrap the remaining math functions in libc: __fpclassify*(), __flt_rounds(), and ldexp().
namespace.h is pulled in via -include, so don't do it here
Wrap <dbm.h> and <ndbm.h> so that calls go direct and the symbols are all weak
Finish wrapping <netdb.h> so that calls go direct and the symbols are all weak
Wrap <netgroup.h> so internal calls go direct and the symbols are all weak
Mark pthread_equal() as unused inside libc
Wrap <readpassphrase.h> so internal calls go direct and readpassphrase is weak
Wrap <langinfo.h> and <regexp.h> so internal calls go direct and the symbols are weak
Wrap <resolv.h> so that internal calls go direct
Wrap <sched.h> and <sys/futex.h> so that internal calls go direct
lsearch(3): reimplement using lfind(3)
Add functions for SHA512/256. The standard says you're supposed to start with different magic numbers, so we need to add some functions instead of just asking the user to truncate as desired. Sigh. SHA512 is quite a bit faster than SHA256 on 64 bit CPUs, but 256 bit hashes are usually quite sufficient. Best of both. ok deraadt tom
Move sigwait(3) from libpthread to libc
Make softfloat's internal float_raise also available under a hidden, internal name, so that local references to it do not need to go through the plt. (this routine is used by libm and thus can't be made internal to libc)
Wrap <spawn.h> to make all the symbols there weak
Use fseeko() instead of fseek() inside libc, as the latter just calls the former with a loss of range. Mark fseek symbol as deprecated to block accidental use in the future.
Add <stdio_ext.h> with the seven APIs needed to have gnulib operate without poking directly into the FILE structure.
Add mkdtemps(3), like mkdtemp(3) but with a suffix. OK deraadt@ tb@
Instead of trying to handle ffs() with the normal rename-mark-hidden-and-alias dance, mark it protected. This works better for both gcc and clang: gcc blocks overriding of internal calls, while clang permits inlining again.
Declare sendsyslog to match its man page
Use PROTO_DEPRECATED() make tcdrain() weak in libc, to guarantee libpthread can override it
spelling fixes; from paul tagliamonte any changes not taken noted on tech, but chiefly here i did not take the cancelation - cancellation changes;
Add support for timeconting in userland.
Wrap <ttyent.h> so that calls go direct and the symbols are all weak.
Provide C11 <uchar.h>. OK millert@. Tested by naddy@ in a bulk and by matthieu@ in the new foot(1) port. I originally wrote the code in 2022 at the prodding of espie@. Using one improvement to a manual page from jmc@.
Add pathconfat(2): pathconf(2) but with at-fd and flags arguments, the latter supporting the ability to get timestamp resolution of symlinks.
Wrap <utime.h> to make utime() a weak symbol
Wrap <uuid.h> so that calls go direct and the symbols are all weak
Wrap <vis.h> so that calls go direct and the symbols are all weak
Add wcsnlen(3), wcslen(3) with a max len argument
Simplify wctype() and wctype_l(): we have one set of classification types used by all (== both) locales; put their implementation in one file and make the mapping static there. The rl_wctype member of _RuneLocale and its initialization go away at the same time.