summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove the "error" variable; we no longer fall back to writing tomillert2016-02-191-5/+5
| | | | | /dev/console so the value of "error" is never read. Also mention that sendsyslog2 can fail due to ENOBUFS in the comment. OK deraadt@
* be more forceful about not using these.espie2016-02-051-7/+19
| | | | improvements sthen@, jmc@. okay millert@, jca@ jmc@
* sigsuspend is section 2, not 3.jmc2016-01-281-2/+2
|
* The CSRG declared alarm(3) obsolete 30 years ago (before 4.2BSD),schwarze2016-01-282-12/+7
| | | | | | | | | | | | but it is likely to remain in POSIX for the forseeable future, and there is nothing wrong with using it, so remove the marker. By contrast, POSIX 2008 now declared setitimer(3) obsolescent. While here, remove a few cross references pointing to obsolete or non-standard functions and update the POSIX reference. Triggered by a question from <ChrisBennett at bennettconstruction dot us>. OK millert@ tb@
* Verify that the section header size supplied in the ELF header is whatmmcc2015-12-291-1/+4
| | | | | | | we expect it to be. This prevents out-of-bounds access or excessive memory allocation on a malformed ELF header. Found by Serguey Parkhomovsky with AFL. Improved by and ok kettenis@
* Remove NULL-checks before free() and a few related dead assignments.mmcc2015-12-284-32/+18
| | | | ok and valuable input from millert@
* use geteuid to make it easier for root to communicate.tedu2015-12-101-2/+2
| | | | reported by Jeunder Yu
* rewrite guts of getusershell() to avoid possibility of overflow.tedu2015-12-081-41/+45
| | | | | | | | instead of trying to allocate "just enough" memory based on the size of the file (which is mostly comments, in fact), allocate memory on demand. i.e., save memory by wasting it. also be a little stricter about parsing. after discussion with tobias. (with a bug fix from patrick keshishian) descended from bug glibc bug 18660 via tobias.
* modify getpw*(), getgr*(), and getgrouplist() functions to access thederaadt2015-12-013-4/+24
| | | | | | | | | YP lock file unconditionally. This hints to the kernel that a "getpw" operation is happening, even in the non-YP case. This looks like a gruesome hack, but helps refine the ways these functions are called and mandates the right pledge requests. Once the tree is fully annotated we will know better how to improve the backing store management. ok semarie espie beck
* group_from_gid: use _GR_BUF_LEN instead of _PW_BUF_LENjcs2015-11-251-2/+2
|
* Add a syscall stub for sendsyslog2(2), and use it in syslog_r(3), passingderaadt2015-11-251-19/+2
| | | | | | LOG_CONS to the kernel. As a result, the /dev/console opening code can be removed. ok kettenis millert beck
* Use reentrant versions of getpw{nam,uid} and getgr{nam,gid} withinmillert2015-11-248-90/+56
| | | | | | | libc to avoid reusing the static buffers returned by the non-reentrant versions. Since this is inside libc we can use constants for the buffer sizes instead of having to call sysconf(). OK guenther@ deraadt@
* mlinks for _shadowtedu2015-11-181-1/+2
|
* document the _shadow functionstedu2015-11-181-5/+17
|
* Add _shadow variants to the two popular getpw functions (uid and nam).tedu2015-11-181-14/+66
| | | | | | | | | This version of the function will always open the secure/shadow/master password files. Soon, the regular variants of these functions will not. (Intermixing shadow and regular gets a little weird; don't do that.) Not using struct spwd and getspwnam functions to reduce churn in callers. Should just be a one line diff in most places. ok deraadt
* change passwd caches to be 4-way "associative". still primitive, but atedu2015-11-171-24/+62
| | | | little better than winner take all caching.
* update NAME section to include all documented functions,jmc2015-11-1010-45/+54
| | | | | | or otherwise change Dt to reflect the name of an existing function; feedback/ok schwarze
* Split the intra-thread functionality from kill(2) into its own syscallguenther2015-11-101-2/+2
| | | | | | | | | | | | thrkill(2), rolling the kill(2) syscall number with the ABI change to avoid breaking binaries during during the transition. thrkill(2) includes a 'tcb' argument that eliminates the need for locking in pthread_kill() and simplifies pthread_cancel(). Switch __stack_smash_handler() to use thrkill(2) and explicitly unblock SIGABRT. Minor bump to both libc and libpthread: make sure you install a new kernel! ok semarie@
* document the net.inet6.ip6.ifq variables in sysctl(3) as well, referring backsthen2015-11-051-2/+12
| | | | | to the 'struct ifqueue' description for net.inet.ip.ifq to reduce chance of them getting out of sync. ok logan, ok/tweak mikeb
* clean up HISTORY;jmc2015-11-041-6/+4
|
* (struct timezone *)NULL -> NULLmmcc2015-11-021-3/+3
|
* (struct timezone *)0 -> NULLmmcc2015-11-021-2/+2
|
* delete old lint ARGSUSED commentsguenther2015-11-011-2/+1
|
* Do not include a timestamp in the syslog message. There is no need --deraadt2015-10-312-33/+11
| | | | | | | | syslogd will fill it in immediately upon reception on the other side of sendsyslog(2). Our libc only talks to our syslogd, which will fix the timestamp before forwarding. syslog_r has done this for a long time already. ok tedu bluhm
* For getgrent.3:guenther2015-10-303-28/+36
| | | | | | | | | | | | | | | - delete the commented out setgrfile bits, as well as the MLINK - rename getgr{nam,gid}_r()'s 'buffer' parameters to 'buf' to be consistent with getpwnam(3) and practically all other section 3 manpages - we have sysconf(_SC_GETGR_R_SIZE_MAX) now, so uncomment and revise the text For getpwnam.3: - rename buflen to bufsize for consistency - rewrite the description of the getpw{nam,uid}_r functions to match the better getgr{nam,gid}_r() description, adding sysconf() bits Add sysconf(3) to SEE ALSO for both encouraged by schwarze@ ok millert@
* (struct timezone *)0 -> NULL, while I'm here.mmcc2015-10-291-2/+2
|
* Wrap the remaining math functions in libc: __fpclassify*(), __flt_rounds(),guenther2015-10-272-3/+7
| | | | | | and ldexp(). ok millert@
* The fd of the passwd database is marked close-on-exec nowguenther2015-10-272-14/+8
| | | | | Incorrect text pointed out by tedu@ ok deraadt@ millert@ tedu@
* don't keep the passwd database open; callers do not expect that they willtedu2015-10-261-11/+1
| | | | | become responsible for calling endpwent. ok deraadt
* Wrap waitpid() so calls go direct; weaken wait() and wait3().guenther2015-10-253-12/+6
| | | | Strip out unnecessary #includes and use NULL instead of (struct rusage *)0
* Nuke union of d_packname with un_d_boot0 & un_d_boot1, keepingkrw2015-10-251-5/+0
| | | | | | | d_packname as a simple field. Also nuke the access #defines, and support for b0 and b1 capabilities in disktab. ok deraadt@ miod@
* Use sigaction() instead of signal() to avoid pulling in unnecessaryguenther2015-10-251-2/+1
| | | | | | | wrappers. To keep uses from crawling back in, mark signal() as deprecated inside libc. ok deraadt@
* Unify all the errno names inbluhm2015-10-241-2/+2
| | | | | | | | - include comment - libc errlist - nls C msg - man page OK tedu@
* Fix waitpid() loop again: do the errno check only if waitpid() returns -1guenther2015-10-231-11/+11
| | | | | | | and check WIFEXITED() only if it returns != -1. Delete the logging of errors other than ECHILD: EFAULT and EINVAL are impossible here. ok deraadt@ millert@
* Merge the sigaction() and sigprocmask() overloads/wrappers from libpthreadguenther2015-10-233-8/+9
| | | | | | | | | into libc, and move pthread_sigmask() as well (just a trivial wrapper). This provides consistent handling of SIGTHR between single- and multi-threaded programs and is a step in the merge of all the libpthread overloads, providing some ASM and Makefile bits that the other wrappers will need. ok deraadt@ millert@
* Cast ctype function arguments to unsigned char.mmcc2015-10-221-2/+2
| | | | ok guenther@
* Check file sizes only for regular files. The current code breaks savecoretobias2015-10-161-3/+3
| | | | | | due to its kvm handling. ok deraadt
* Merge nlist out of boundary access fix with other nlist implementations.tobias2015-10-161-6/+7
| | | | | | While at it, merge style and typo fixes back into nlist(3), too. ok deraadt, jsing, millert
* Validate parsed ELF values to prevent out of boundary accesses.tobias2015-10-161-33/+44
| | | | | | | | While at it, return proper return value when encountering a stripped binary. Instead of -1 (illegal file), it should be the amount of symbols that were tried to be resolved. ok millert
* When isatty() was switched to F_ISATTY, the inline copy in ttyname()naddy2015-10-121-4/+2
| | | | was forgotten. Just call isatty(). ok deraadt@
* Fix empty .No macros, use .Pf to prefix delimiters to macros.schwarze2015-10-111-4/+4
| | | | | Based on a patch from guenther@, tweaked by me. OK jmc@ guenther@
* Document that execve(2) resets SIGCHLD to SIG_DFLguenther2015-10-111-3/+6
| | | | wordsmithing and ok jmc@
* __fdnlist() is exported for libkvm, but the internal call can go directguenther2015-10-041-1/+3
|
* Eliminate the last of the LINTEDn and PRINTFLIKEn comments. In oneguenther2015-10-011-2/+1
| | | | | | | case, by deleting some useless '& of an array' we also eliminate the need for the casts which prompted the original lint warnings ok deraadt@
* typo.sobrado2015-09-231-3/+3
|
* Don't wrap initialized variables: binutils appears to be mishandling themguenther2015-09-196-7/+19
| | | | | | on arm and m88k problems with optind observed by jsg@
* remove null check before free. from Michael McConvilletedu2015-09-1411-143/+77
| | | | ok semarie
* Remove useless quoting from .Fo and .Fn function names, to preventschwarze2015-09-141-5/+5
| | | | | | development of a cargo cult in case people look at existing files for examples. This achieves a consistent .Fo and .Fn quoting style across the whole tree.
* Wrap <readpassphrase.h> so internal calls go direct and readpassphrase is weakguenther2015-09-141-1/+2
|
* Wrap <netgroup.h> so internal calls go direct and the symbols are all weakguenther2015-09-141-1/+5
|