summaryrefslogtreecommitdiff
path: root/lib/libc
AgeCommit message (Collapse)Author
2009-07-15must include <sys/types.h> before including <login_cap.h> or <bsd_auth.h>;Ingo Schwarze
noticed by joao <salvatti at gmail dot com> on tech@; feedback and ok kettenis@ deraadt@ and reminded by jmc@
2009-07-13Load symbol address with dla, not la; good thing userland is still limitedMiod Vallat
to 2GB of vm space.
2009-07-12fwrite() should also return 0 if either size or nmemb are 0.Todd C. Miller
Adapted from FreeBSD. OK deraadt@
2009-07-09promote correct style for error checkingEric Faurot
ok tedu@ deraadt@ krw@
2009-06-23getgrouplist(3) used to and ought to return 0 on success;Ingo Schwarze
fixing a regression introduced in rev. 1.16 spotted by otto@; ok millert@ otto@
2009-06-21fix rcs ids. ok sthen@Martynas Venckus
2009-06-21abs conforms c99 -> imaxabs conforms c99. ok millert@Martynas Venckus
2009-06-12YP client functions do not allocate memory when they fail;Ingo Schwarze
wording tweaked by jmc@
2009-06-11don't use freelist if it overruns; use heap memory instead notMartynas Venckus
trying to allocate large blocks from bss memory pool in this case. problem reported by Maksymilian Arciemowicz. ok otto@, millert@
2009-06-09document KERN_BUFCACHEPERCENT and KERN_MAXLOCKSPERUID; help/ok ogaJason McIntyre
2009-06-08quieten compiler by converting pointers to uintptr_t before truncating themTheo de Raadt
to u_int32_t to do integer math with (in a situation where that is legit) ok otto millert
2009-06-07de-spaghetti:Ingo Schwarze
If code is used from exactly one place, don't jump back dozens of lines to reach it, only to "goto" back where you came from. Instead, simply put the code where it belongs. Also fixes a regression that crept in in rev. 1.30: After clearing the variable __ypmode, don't try to make decisions based on its former value. As a bonus, garbage collect the grname variable and the _ypmode enum type. ok millert@
2009-06-07fix a minor memory leak spotted by deraadt@; ok millert@ deraadt@Ingo Schwarze
2009-06-07Add KERN_FILE2 sysctl analogous to KERN_PROC2 but for file structures,Todd C. Miller
along with vnode type-specific info to make it more useful for fstat(1). OK deraadt@
2009-06-07Modify the uc_entries allocation check such that the lhs is a constant.Todd C. Miller
OK deraadt@
2009-06-07No need to malloc, copy, have a single read access, and free right away.Ingo Schwarze
Thus, garbage collect one variable, one strdup, one free, two ifs, one else and a couple of assignments. No functional change. ok millert@
2009-06-06In case of memory exhaustion, ypmatch_add may both leak memory and leaveIngo Schwarze
invalid data on the list, inviting later NULL pointer access. noticed by deraadt@, algorithm proposed by millert, implemented by me; feedback and ok millert@
2009-06-06correct error codes after malloc(3) failure, as 0 means RPC_SUCCESS;Ingo Schwarze
noticed by and OK deraadt@, ok millert@
2009-06-06use calloc() and realloc() more; ok schwarzeTheo de Raadt
2009-06-05Note that f_fsid gets cleared when caller is not the superuser. OK deraadt@Todd C. Miller
2009-06-05use calloc() to provide size * nitems safetyTheo de Raadt
2009-06-05use calloc() to provide size * nitems safety; ok millertTheo de Raadt
2009-06-05The yp_bind(3) return code now distinguishes "YP not active" from "an errorIngo Schwarze
occurred". Based on this, decide to either bail or use the record as is. Prevents getgrnam(3) and friends from silently skipping YP records on system errors, for example when out of memory. Also, calling yp_get_default_domain once is enough. The first two switch cases are unchanged, just reindented. ok millert@
2009-06-05malloc(3) failure should raise YPERR_RESRC, not YPERR_YPERR;Ingo Schwarze
ok millert@
2009-06-05improve yp_bind(3) error reporting after clnttcp_create(3) failure:Ingo Schwarze
map ECONNREFUSED -> YPERR_YPBIND, ENOMEM -> YPERR_RESRC, else YPERR_YPERR while here, malloc(3) failure should raise YPERR_RESRC, not YPERR_YPERR ok millert@
2009-06-05When parsing a line stating with "+" or "-" in group(5),Ingo Schwarze
check whether YP is active up front, not half-way through the parsing. This fixes the bug that group names starting with a dash (yuck!) were skipped when YP was not active, introduced in rev. 1.27. Besides, the code becomes easier to understand. The code inside the two switch cases is unchanged, just reindented. "looks good" millert@
2009-06-05An empty sting cannot be used as a YP domain name,Ingo Schwarze
so treat it similarly to a failing call to getdomainname. ok millert@
2009-06-05abort any time adjustment in progress if the clock is set with settimeofdayChris Kuethe
ok millert
2009-06-05compare and shift buffer against a fixed length not strlen derived values.Pierre-Yves Ritschard
ok otto@
2009-06-04simplify the 'family' option parser and make it more evident what we'rePierre-Yves Ritschard
now doing. ok deraadt@
2009-06-04Recycle four ancient fields in the disklabel structure, replacing them withTheo de Raadt
bounds information, ie. the zone of the disk that OpenBSD can use. Have each pre-disklabel parser (MBR, DPME, or per-arch MD disklabel parsers) figure out this area and pass it up to userland. Then, delete all the same disk parsing code from disklabel(8) since the kernel passes it up. Lots and lots of - signs in the disklabel(8) code. Tested on as many platforms as possible, the fallout will be repaired as time goes on. To test, use disklabel -d <drive> and validate that the bounds do not overlap any boot blocks. This same information is used by disklabel -A... OK for the concept from krw, miod, and drahn
2009-06-04fix two obvious typosIngo Schwarze
2009-06-04Don't assume that we can overwrite strings in the environment.Todd C. Miller
Someone may have passed a read-only string to putenv() (I'm looking at you cron!).
2009-06-04Add a resolv.conf option to specify the order in which getaddrinfoPierre-Yves Ritschard
PF_UNSPEC queries are made. While there change the default from inet6 first then inet4 to inet4 first then inet6, this prevents the many people with IPv4 only connectivity from constantly trying to contact IPv6 addresses, and also unbreaks many ports who don't use getaddrinfo right. ok deraadt@, plenty of cheering in the room wrt the idea, not loud enough complaining from the v6 crowd.
2009-06-04in case a handling a +groupname:*:: entry fails due to lack of memory,Ingo Schwarze
do not just skip the entry, but report the error condition; ok millert@
2009-06-04Proper error handling in clntraw_create:Ingo Schwarze
Bail out and clean up after all errors, and report in libc/rpc style. Among others, this fixes a NULL pointer dereference in clntraw_call. Feedback and ok kjell@ and millert@.
2009-06-03State that clnt{raw,udp}_create can fail.Ingo Schwarze
"no objection" millert@
2009-06-03Ensure there is a statement after a label.Jonathan Gray
ok deraadt@
2009-06-03crank libc majorTheo de Raadt
2009-06-03Take advantage of the surprise libc bump to bring inIngo Schwarze
YP group(5) exclusion, i.e. support -groupname:*:: in /etc/group. Such groups will be excluded from later +:*::, in just the same was as it is already done for passwd(5). I have been running this since the autumn of 2008. Discussed with several (including deraadt@, millert@, jmc@).
2009-06-03Make putenv(), setenv() and unsetenv() standards compliant. TheTodd C. Miller
standard explicitly disallows passing setenv a name with a '=' in it but historic BSD behavior is to allow this but to ignore the '=' and anything after it.
2009-06-03Arla client rename from xfs to nnpfs for later upgrades. Tested on various ↵Janne Johansson
arches. ok todd@ beck@
2009-06-03Don't postpone memory allocation for the error message to the error handler:Ingo Schwarze
That way, memory exhaustion simply cannot be reported because it would require to... allocate memory. Instead, really use a statical buffer as it is advertised in the manual. "looks good" millert@
2009-06-02Set errno to EINVAL when fgets is given a non-positive size.Ray Lai
OK millert otto
2009-06-02- define EAI_OVERFLOW, as per IEEE Std 1003.1-2001(Interpretation #13)Jasper Lievisse Adriaanse
hint from claudio@, ok millert@
2009-06-02When authnone_create fails, do not leave behind a NULL cl_auth attribute,Ingo Schwarze
because that one will typically derefenced later without any checking. Instead, flag the error condition and bail out cleanly. useful feedback from kjell@ and ok millert@
2009-06-02make the documentation of {svc,clnt}*create complete and correctIngo Schwarze
ok millert@ jmc@
2009-06-02tweak previous;Jason McIntyre
2009-06-01When an RPC client program encounters ENOMEM while trying to printIngo Schwarze
an error message, rather skip the error message than dereferencing a NULL pointer. debugging help and ok kjell@
2009-06-01Split getpw{nam,uid} off into their own man page. Hopefully, thisTodd C. Miller
will help people understand that endpwent() is not normally needed. OK deraadt@ jmc@