summaryrefslogtreecommitdiff
path: root/lib/libc/gen
AgeCommit message (Collapse)Author
2014-05-25use calloc, from Benjamin BaierTed Unangst
2014-05-23Document that v?dprintf() is just as safe as v?snprintf(). OK espie@Todd C. Miller
2014-05-07Kill the {nd6_,}useloopback buttons, using the loopback interface forMartin Pieuchot
local traffic is not optional. ok mikeb@, stsp@, jca@
2014-05-04tweak previous;Jason McIntyre
2014-05-04When kern.nosuidcoredump=3, act like =2 but try to dump cores intoTheo de Raadt
the /var/crash/programname/ directory, as root. For instance, # mkdir /var/crash/bgpd/ # chmod 700 /var/crash/bgpd/ # If you skip this step, you are a moron # sysctl kern.nosuidcoredump=3 # bgpd # pkill -ABRT bgpd # ls /var/crash/bgpd/ 14764.core 23207.core 6423.core Of course, in real life the idea is that you don't kill the daemon but it crashes and you collect parallel cores. Careful you don't fill your /var. Further tuneables are being considered. Sorry to be picking on bgpd for this example. I've watched the "too difficult to debug privsep code" angst for far too long. ok guenther
2014-04-27zap trailing whitespace;Jason McIntyre
2014-04-27Document net.inet6.ip6.dad_pending.Loganaden Velvindron
OK from jmc@, and thanks to sthen@ for pointing out my mistake in the first version of the diff.
2014-04-23tweak previous; sorry ingo, my review was pretty poor;Jason McIntyre
2014-04-23more info about HISTORY; ok jmc@Ingo Schwarze
2014-04-22Oh yeah, MLINKS for errc familyPhilip Guenther
Prodded by deraadt@
2014-04-22Add errc/verrc/warnc/vwarnc family: versions of err/... that take the errnoPhilip Guenther
value to use for the strerror() message as an argument. Originally from FreeBSD 3.0 Patch from Steffen Nurpmeso (sdaoden (at) gmail.com) with minor tweaks.
2014-04-19Add missing description for IPv6 mtudisctimeout sysctl andlogan
rework the wording for both IPv4 and IPv6. OK from sthen@, henning@ and claudio@
2014-04-19Add missing man page descriptions for the following IPv6 sysctls:logan
-maxdynroutes -maxifprefixes -maxifdefrouters -neighborgcthresh OK from sthen@, claudio@ and henning@
2014-04-08Use VM_UVMEXP instead of VM_METER for memory usages and directlyMartin Pieuchot
include <sys/vmmeter.h> where it is needed instead of relying on it being included by <uvm/uvm_extern.h>. miod@ likes it, ok guenther@
2014-04-01Use setresuid() and setresgid(). OK guenther@ deraadt@Todd C. Miller
2014-03-16lint is dead (long live the lint!), so stop using it as a cpp conditionalPhilip Guenther
(namespace pollution!) or talking about its opinion on code. ok krw@
2014-03-12since we are documenting that setpwfile() is no longer available, maybeJason McIntyre
don;t cross reference (Xr) its also no longer available man page: use Fn instead;
2014-03-12Add ERRORS and STANDARDS, thanks to brad@ for the reminder.Ingo Schwarze
Fix the description of the RETURN VALUES of get*_r(). Minor polishing while here. Feedback and ok jmc@, ok millert@ jca@.
2014-03-12Make sure that setgrent(), endgrent(), and endpwent() do not clobberIngo Schwarze
errno; they might do so on open() and close() failures, but by POSIX, they are not supposed to fail. Note that ignoring failures inside setgrent() does not matter, the following getgrent() is bound to fail the same way again, anyway. If you insist on detecting open() failure, use setgroupent(), even though that is less portable. While here, remove two pointless (void) casts. ok millert@ jca@
2014-03-12The functions getpw{nam,uid}_r() no longer set errno, not even if anIngo Schwarze
error occurs, but of course they do return the error. This matches what getgr{nam,gid}_r() have already been doing. Original idea by kettenis@, and deraadt@ called that idea "the only sane approach". ok kettenis@ millert@
2014-03-10Optimization, no functional change:Ingo Schwarze
Save a cookie pointing to the very first entry in the DIR.dd_buf cache buffer and use that to speed up seekdir(3) when rewinding to that first entry. No libc bump because DIR is an opaque struct. When the optimization applies, which in particular it always does for rewinddir(3) after reading less than about 500 entries, seekdir(3) execution time drops from 100 to 0.05 milliseconds on my i386 notebook. Other cases are not slowed down. Based on an idea from and ok by guenther@.
2014-03-08Fix getpw{nam,uid}{,_r}() errno handling for the non-YP case.Ingo Schwarze
Prevent close(2) and syslog(3) from stomping on errno; from guenther@. Set ERANGE if the buf is too small, required by POSIX; from jca@. ok millert@
2014-03-06If RPP_STDIN is set the prompt is not displayed.Todd C. Miller
Use explicit_bzero in the example code.
2014-03-05Fix the return values of getpwnam_r(), getpwuid_r(), getgrnam_r(),Ingo Schwarze
and getgrgid_r() to agree with POSIX. Not touching errno handling yet, which will also need fixing. Problem originally reported by william at 25thandClement dot com on bugs@. OK sthen@, and kettenis@ agrees it's "a step in the right direction".
2014-02-21remove section 2/3 pointers from section 1,Ingo Schwarze
and do not point programmers at the obsolete usleep(3); based on a diff from Jan Klemkow <j dot klemkow at wemelug dot de>, but removing more as suggested by jmc@ and deraadt@
2014-01-22Use consistent phrasing for bitmask flags.Philip Guenther
tweaking and ok millert@ jmc@
2014-01-22fix a leak in getgrouplist()Jonathan Gray
problem reproduced and fix verified by schwarze who wrote the code ok krw@ deraadt@ schwarze@
2014-01-21obvious .Pa fixes; found with mandocdb(8)Ingo Schwarze
2014-01-20Add missing section numbers to .Xr; found while testing mandocdb(8).Ingo Schwarze
While here, improve the wording at one place. OK jmc@.
2014-01-20Obvious .Xr fixes, found while testing mandocdb(8).Ingo Schwarze
2014-01-19Fix one more off-by-one (making it an off-by-two):Tobias Stoeckmann
1. integer division can give an off-by-one (like 2/3 = 0 for calloc) 2. ending the shells array with NULL takes space, too ok millert@
2014-01-19Rename the hidden symbol __elf_fdnlist to __fdnlist, and remove theTheo de Raadt
format handling wrapper. __fdnlist is used by libkvm. Avoid cranking libc because the time is inconvenient, and __elf_fdnlist is not used anywhere. ok millert jsing
2014-01-19Usually, you don't want macros in the .Nd line, so remove instances of .TnIngo Schwarze
marking up words that are not trademarks (ASCII, I/O, NFS, TCP, TELNET). While here, remove .Tn markup from the same words in the body of these pages, too.
2014-01-19Punctuation after macro arguments needs to be in a separate argument.Ingo Schwarze
Found while testing mandocdb(8).
2014-01-17Fix off-by-one on specially crafted /etc/shells file.Tobias Stoeckmann
ok gilles@, millert@
2013-11-24most obvious unsigned char casts for ctypeTheo de Raadt
ok jca krw ingo
2013-11-22doc nit okay millert@Marc Espie
2013-11-16In getdiskbyname() set partition size with DL_SETPSIZE(). Make sureKenneth R Westerback
d_secperunith and p_offseth are set to 0 since they can't be read from disktab and lower 32 bits (d_secperunit and p_offset) are read directly from the input.
2013-11-15getpwnam_r() and getpwuid_r() reopen the passwd even when called withSebastian Benoit
setpassent(stayopen). Bug found and fixed by Erik Lax <erik-AT-halon-DOT-se> ok millert@ guenther@
2013-11-12put the _readdir_unlocked() prototype in an obvious placeTheo de Raadt
2013-11-12ANSI prototypesTheo de Raadt
2013-11-12pull in missing includes (math.h, unistd.h, stdlib.h) needed forTheo de Raadt
prototypes
2013-11-12pull in stdlib.h as requiredTheo de Raadt
2013-11-12ttyslot() needs <stdlib.h>Theo de Raadt
ok guenther
2013-11-06Nowadays, seekdir(3) doesn't call _readdir_unlocked().Ingo Schwarze
Consequently, the "skipdeleted" argument is always == 1. Remove it, effectively reverting readdir.c rev. 1.14. ok millert@ guenther@
2013-11-06Search the userland buffer of dirent structures before falling back toIngo Schwarze
getdents(2). No functional change, but considerable speedup in many cases, see http://marc.info/?l=openbsd-tech&m=138369623117934 for some approximate numbers. ok guenther@, "good diagnosis" deraadt@
2013-11-05Cleanup, no functional change:Ingo Schwarze
1. avoid code duplication in rewinddir() by calling seekdir() directly 2. move __seekdir() into seekdir() and _telldir_unlocked() into telldir() Both functions were called from nowhere else. 3. remove some unused #include directives and one unused function prototype ok otto@ millert@
2013-11-05Make sure seekdir(3) works even when dirp->dd_buf still contains someIngo Schwarze
pending entries: At the time of the lseek(2), also invalidate the buffer in order to force getdents(2) during the next readdir(3). Because this throws away buffered data that could still be used in some cases, this is not particularly efficient, but at least it works; i will suggest optimizations soon. Bug found when investigating perl-5.18.1/t/op/threads-dirh.t that was reported broken by Andrew Fresh <andrew at afresh1 dot com>. ok guenther@ deraadt@
2013-10-28kill kame version symbols and sysctlTheo de Raadt
ports tree grep run by sthen
2013-10-25close(fd), then set errnoTed Unangst