summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2019-07-14Unlike gas, clang's assembler complains about duplicate symbol assignments.Philip Guenther
Tweak the PSEUDO() macro to avoid that. problem noted and tested by kettenis@
2019-07-13explain the acronym "CRT"; suggested by tb@Ingo Schwarze
2019-07-12Add affinity between the program and its mixer control.Alexandre Ratchov
Currently, if there are two instances of the same program, sndiod will allocate one volume control to each. If both programs disconnect and reconnect, the information of which control is assigned to which program is lost. This makes difficult to run two instances of a player and crossfade between each other with a MIDI controller. To address this, the program chooses a 32-bit "id" (for now the process pid) and sends it to the server. The server records the id in the client's slot structure. When the server accepts a new connection, it uses the id to identify the slot the client used during the previous connection; if it was not recycled yet, it's assigned to the program.
2019-07-11Using pthread_atfork instead of __register_atfork with uClibc on noMMUKinichiro Inoguchi
uClibc on noMMU doesn't provide __register_atfork(). Reported by redbirdtek on Github issue. https://github.com/libressl-portable/portable/issues/538 ok bcook@
2019-07-09Group tls_{handshake,read,write,close}() return values documentation.Joel Sing
Move the documentation for tls_error() down so that both the special return values for tls_{handshake,read,write,close}() directly follow the standard return values for the same functions. Prompted by deraadt@. ok deraadt@ schwarze@
2019-07-08fix typo: RCF -> RFCTheo Buehler
From Evan Silberman
2019-07-08Get rid of an old convention of wrapping preprocessor constants in curlyanton
braces. no objection from jmc@ and schwarze@
2019-07-08Clean up pvkfmt.cKinichiro Inoguchi
- Replace EVP_CIPHER_CTX_init with EVP_CIPHER_CTX_new and handle return value - Replace EVP_CIPHER_CTX_cleanup with EVP_CIPHER_CTX_free - Change two 'return -1;' to 'goto err;' for avoiding leak - Remove the case if enclevel == 0 - Change enclevel checking to make more consistent - Change all goto label to 'err' and insert space before goto label ok and advise from tb@
2019-07-07Fix pvk format processing in libcryptoKinichiro Inoguchi
- Return the valid pointer in i2b_PVK() - Use EVP_Decrypt* instead of EVP_Encrypt* - Fix error handling after BIO_write() in i2b_PVK_bio() ok tb@
2019-07-05Add forgotten copyright notice, found by Jason Thorpe <thorpej at me.com>.Alexandre Ratchov
Thanks!
2019-07-05improve verb-tense for explaining the calling convention of __Theo de Raadt
ok guenther jmc
2019-07-05The last consumer of pre-posix realpath behaviour has stoppedTheo de Raadt
requiring it (sftp-server). Remove the /exists///// behaviour from here. The /nonexistant behaviour remains in the kernel and needs to be shot next. There may be ports fallout, but we doubt it. ok beck djm
2019-07-03snprintf/vsnprintf return < 0 on error, rather than -1.Theo de Raadt
2019-07-02Add cpuid support for arm64 so that we can recognize whichPatrick Wildt
hardware crypto features are available. "no objections" kettenis@
2019-07-02The "always hint that getpw operation is happening with access() the YPTheo de Raadt
lock file" would trash errno, creating confusion. One instance found by richardipsum@fastmail, other two identified from original commit ok millert
2019-07-01kevent(2): remove 24hr timeout limitcheloha
As with nanosleep(2), poll(2), and select(2), here we can chip away at the timespec until it's empty. This lets us support the full range of the timespec regardless of the kernel's HZ. Update the manpage accordingly. ok visa@
2019-07-01Need to compile rcrt0.o with -fno-jump-tables on powerpc as well.Mark Kettenis
ok visa@
2019-06-30tweak previous; ok guentherJason McIntyre
2019-06-29Document that getcwd() and realpath() are built on system calls thatPhilip Guenther
have a different calling convention than the standard function...as seen in kdump output. ok deraadt@ schwarze@
2019-06-29two more syscall == -1 checksTheo de Raadt
2019-06-29Check if syscalls return -1 instead of any negative value.Alexandre Ratchov
"Looks right" deraadt
2019-06-29Update libexpat to 2.2.7. Relevant for OpenBSD is only the fix forAlexander Bluhm
CVE-2018-20843, a potential denial-of-service in libexpat due to high RAM and CPU usage. OK deraadt@
2019-06-28Specify that {v,}asprintf(3) returns precisely -1 on failure,Ingo Schwarze
and that the ret pointer is either unchanged or set to NULL in this case. Since these two functions are not standardized by POSIX, documenting the actual behaviour is the way to go, and the above matches all non-buggy implementations we are aware of. OK millert@ deraadt@
2019-06-28Actually, the C standard only guarantees that atexit(3) returns non-zeroIngo Schwarze
on error, so tweak previous to test "atexit(...) != 0" for portability. "OK ok ok sorry backwards" deraadt@
2019-06-28Since clang only supports the "secure" PLT ABI for "big" PIC/PIE on powerpc,Mark Kettenis
stop building the csu code with -fpie on that platform. ok guenther@, visa@
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
2019-06-28delete duplicate .Xr below SEE ALSOIngo Schwarze
2019-06-28local __libcpp_asprintf_l() -> libc asprintf() was inspecting the pointerTheo de Raadt
(with inderminate value) for failure, rather than the return value of -1 ok mortimer
2019-06-28failed to detect asprintf() error by observing return of -1, instead theTheo de Raadt
code was inspecting the pointer (which is, sadly, undefined on error, because the current specification of asprintf is crazy sloppy)
2019-06-28mkstemp() returns -1 on failureTheo de Raadt
2019-06-28atexit() returns -1 on failureTheo de Raadt
2016-09-03Import libc++ 3.9.0Patrick Wildt
2019-06-27The C89 standard only requires that atexit(3) returns a non-zero valueIngo Schwarze
on error, so checking for -1 only is potentially non-portable. Also mention that the C89 standard does not require errno to be set. OK deraadt@ millert@
2019-06-27Simplify the description of [v]snprintf(3), move the descriptionIngo Schwarze
of the return values to RETURN VALUES, deprecate [v]sprintf(3) and fix a punctuation typo. Joint work with and OK millert@.
2019-06-27If we don't receive a reply packet the res_send subquery will already haveMartijn van Duren
set subq_h_errno and ar_count. Remove the ar_datalen == -1 check, so we set ar_h_errno and don't have to (wrongly) guess that ar_h_errno = HOST_NOT_FOUND. This makes sure that if no nameserver responds the h_errno value is set to TRY_AGAIN instead of HOST_NOT_FOUND. OK eric@, deraadt@
2019-06-26an -> a;Jason McIntyre
2019-06-26The POSIX-compatible way of checking for {v,}{f,s,sn,d}printf(3)Theo de Raadt
failure is with < 0, not the more specific -1 from C discussed at length with millert, nicm, schwarze
2019-06-25Use the same text for EOPNOTSUPP as we do in fcntl(2) and lockf(3).Todd C. Miller
In fcntl(2) and lockf(3) the error is EINVAL but the condition is the same. OK anton@
2019-06-25POSIX.1-2008 TC3 is going to clarify how newlocale(3) uses oldloc.Ingo Schwarze
Explicitly state that our implementation now complies with the stricter requirements of TC3 because the newlocale(3) in old OpenBSD releases only complied with the weaker requirements of the old text of the standard. The complaints from our users resulted in both our implementation and the standard being improved. For details, see: http://austingroupbugs.net/view.php?id=1243#c4347
2019-06-24add missing RETURN VALUES section;Ingo Schwarze
also checked that POSIX requires exactly this behaviour
2019-06-23Export unveil state so that ps(8) can show it. Two new status flags,Theo de Raadt
you'll see one, or neither. 'u' - process installed unveils, but not yet locked with unveil(0,0) or pledge w/o "unveil" 'U' - process has installed unveils, and locked. ok rob
2019-06-21Fix conversions to long double on sparc64Jeremie Courreges-Anglas
Bug exposed by erratic sqlite3 behavior used in ports/devel/proj, as pointed out by landry@. Richard Hipps (SQLite) pointed at the culprit (_Qp_div), many thanks. Adapted from FreeBSD revision 146673 by Stephen Paskaluk and stefanf@FreeBSD. FreeBSD commit message: """ Fix long (and long long) to long double, unsigned to long double and unsigned long (and unsigned long long) to long double conversions. - Add a parameter that specifies the position of the sign bit to the _QP_TTOQ macro, previously it always looked at bit 31. Pass a negative number to disable sign inspection for unsigned types. This fixes _Qp_xtoq(), _Qp_uitoq() and _Qp_uxtoq(). - In the functions __fpu_itof() and __fpu_xtof(), look at the sign bit to decide whether we're doing a conversion from an unsigned type. If so, don't negate the mantissa if the integer exceeds the biggest signed number. """ ok deraadt@
2019-06-20open() and fstat() return precisely -1 on error, not a vague value < 0.Theo de Raadt
Follow the contract.
2019-06-20tls_read() & tls_write() return 4 possible values: TLS_WANT_POLLOUT,Theo de Raadt
TLS_WANT_POLLIN, -1, or 0. After handling the first two, check for -1 rather than vaguely "< 0". ok jsing
2019-06-20sockatmark(3), recv(2), getsockopt(2), and connect(2) return specificallyTheo de Raadt
-1 to mark failure, not arbitrary values < 0. I believe manual pages should follow the described contract precisely and accurately.
2019-06-17Merge libc++, libc++abi and libunwind version 8.0.0.Patrick Wildt
Ports build by naddy@ Tested by visa on octeon Tested by kettenis on macppc and sparc64
2019-06-17Import libunwind 8.0.0.Patrick Wildt
2019-06-17Import libc++abi 8.0.0.Patrick Wildt
2019-06-17Import libc++ 8.0.0.Patrick Wildt
2019-06-17Make BN_num_bits_word() constant time.Theo Buehler
Previously, this function would leak the most significant word of its argument due to branching and memory access pattern. This patch is enough to fix the use of BN_num_bits() on RSA prime factors in the library. The diff is a simplified and more readable (but perhaps less efficient) version of https://github.com/openssl/openssl/commit/972c87df by Andy Polyakov and David Benjamin (pre license change). Consult that commit message for details. Subsequent fixes to follow in the near future. Issue pointed out by David Schrammel and Samuel Weiser as part of a larger report. tests & ok inoguchi, ok jsing