summaryrefslogtreecommitdiff
path: root/lib/libc/gen
AgeCommit message (Collapse)Author
2002-12-17Make SysV-style shared memory and semaphore limits sysctl'able.Todd C. Miller
Instead of allocating a static amount of memory for the data structures via valloc() in allocsys(), allocate things dynamically using pool(9) when possible and malloc(9) when not. The various members of struct seminfo and struct shminfo are in kern.seminfo and kern.shminfo respectively (not all members of kern.seminfo are changable). The data structures used still leave something to be desired but things are not made worse in that respect by this commit.
2002-12-15Casting to unsigned int in isfoo() causes problems on alpha andTodd C. Miller
sparc64. Change cast back to unsigned char but do a bitwise AND with 0xff to avoid any sign extension weirdness and to make it impossible for us to overflow _C_ctype_. The bitwise AND is probably not needed and may be removed later if this does not trigger compiler bugs.
2002-12-15more writeable -> writable by torhHenning Brauer
2002-12-14Instead of doing "if (c == EOF) return 0;" use the hook ('?') operatorTodd C. Miller
instead to make these one-liners. Works around a compiler bug on vax that affects both the libc and inline versions identically.
2002-12-13Less stupid check for 7-bit ascii in toupper/tolowerTodd C. Miller
Remove useless check for EOF in isascii
2002-12-13Cast to unsigned int, not unsigned char, since what is being cast is anTodd C. Miller
int, not a char.
2002-12-11Convert ctype.h macros into inline functions. This fixes the issues weTodd C. Miller
currently have with the macro versions and makes the ctype.h versions 100% identical to what is in libc. Discussed with pjanzen@ and OK'd by deraadt@.
2002-11-25Mention the net.inet.tcp.ecn sysctl.Wilbern Cobb
ok kjc@
2002-11-24Fix comment: s/trailing NULL/trailing NUL/, no code changes.Chad Loder
2002-11-24Fix instance where syslog(3) after closelog(3) could access freed logChad Loder
tag name. OK millert@, deraadt@
2002-11-22Initialize status to zero before calling waitpid(). That way, ifTodd C. Miller
there is nothing to be waited for (for instance if SIGCHLD is being ignored) we don't check WIFEXITED(garbage off the stack).
2002-11-22more snprintf; ok millertTheo de Raadt
2002-11-21shadow -> _shadowTodd C. Miller
2002-11-21Add a "shadow" group and make the shadow passwd db readable by thatTodd C. Miller
group. This changes getpw* to always try the shadow db first and then fall back to the db w/o password hashes. In the future, /usr/libexec/auth/login_passwd (and others) will be setgid shadow instead of setuid root. OK deraadt@ If you track -current you should do the following: o add group shadow to /etc/group o chgrp shadow /etc/spwd.db o chmod 640 /etc/spwd.db o rebuild and install src/usr.sbin/pwd_mkdb You do not need to rebuild libc yet, but it would't hurt to do so.
2002-10-30Revert this va_copy addition, it cannot work on macppc (which is theDale Rahn
only arch where va_copy is currently required), current version of va_copy uses alloca, but since the results of the va_copy are not used here, only after return, stack trashing will occur. This will have to be revised again for gcc 3.2 support on powerpc.
2002-10-24Use va_copy() for varargs assignemnt. va_copy() is standard with C99Dale Rahn
and gcc3.2 requires this on powerpc.
2002-10-16Replace "if (value != NULL && value == as->FOO)" with justTodd C. Miller
"if (value == as->FOO)" -- NULL needs no special handling. Pointed out by Paul Borman.
2002-10-16Implement isfdtype(3) as per the POSIX.1g draft; requested by David HillTodd C. Miller
2002-10-15Fix typo introduce in last commitTodd C. Miller
2002-10-15cast NULL varargs sentinel to char * so it is 64 bit on alpha & sparc64Todd C. Miller
2002-10-15Document the fact that calling auth_setitem() with a NULL valueTodd C. Miller
clears (frees) the corresponding value in the auth session.
2002-10-15If auth_setitem() is called with the current value (ie: the pointerTodd C. Miller
is the same as the private value) then just return 0 as there is nothing to do. This fixes a potentially nasty problem where the caller could grab the username or style from the auth session via auth_getitem() and then call auth_verify() with those values. auth_setitem() would eventually get called which would make a private copy and free the old values in the auth session. After all this, the stashed username and/or style pointers would point to freed memory.
2002-10-15Note that when calling auth_verify() with a style and/or username,Todd C. Miller
the old values in the auth session will get freed and the new values added.
2002-10-15Cast NULL sentinel in auth_call() to a pointerTodd C. Miller
2002-10-13Move the clearing of as->state in auth_challenge() to after the sanityTodd C. Miller
checks. The check for "as != NULL" is useless if you have already dereferenced "as". Also fix some comment typos. From Moritz Jodeit.
2002-10-09Use strtoll() and strtoull() instead of strtoq() and strtouq() nowTodd C. Miller
that we have them as per the original BSDi code.
2002-08-04If fork() fails, log/report the error *before* we close our fd's justTodd C. Miller
in case close(2) were to set errno.
2002-07-30malloc paranoia; it is unlikely that any filesystem will supportTodd C. Miller
enough directory entries to cause a problem but it is good form anyway. deraadt@ OK.
2002-07-30be even more careful with strlcpy()Theo de Raadt
2002-07-18typoTodd C. Miller
2002-07-14indent, and double free fix; millert okTheo de Raadt
2002-07-12Add a missing check for fts_alloc() returning NULL; Chad LoderTodd C. Miller
2002-07-08Use qsort() instead of mergesort() since the latter can fail dueTodd C. Miller
to malloc(). opendir() requires a stable sort so we rig the compare routine to never return 0. From Lars J. Buitinck
2002-07-06Remove kernel support for NTP. ok deraadt@ and tholo@Thomas Nordin
2002-07-06KNFTheo de Raadt
2002-07-06KNFTheo de Raadt
2002-07-06cope better if realloc fails; better fix than cloder@acm.orgTheo de Raadt
2002-07-05more refinementTheo de Raadt
2002-07-02missing priority argument in example; ok millert@Kevin Steves
2002-07-01need string.hTheo de Raadt
2002-07-01Disc -> Disk for EDQUOT; now the error and log messages that appear whenPaul Janzen
quotas are exceeded are consistent. deraadt@ ok
2002-07-01Fix strnvis(): don't truncate unnecessarily, set the return value correctlyPaul Janzen
if we had to truncate, and don't NUL-terminate if size == 0.
2002-07-01indentTheo de Raadt
2002-06-28Add RPP_STDIN flag which acts as the converse of RPP_REQUIRE_TTY.Todd C. Miller
Based on a patch from Brett Eldridge.
2002-06-28Lies, damn lies and getcap(3). The description for cgetclose() wasTodd C. Miller
completely wrong and has apparently caused people to believe that cgetclose() frees memory allocated by cgetent() which is *not* the case.
2002-06-27%uTheo de Raadt
2002-06-27KNFTheo de Raadt
2002-06-27%u and uid/gidTheo de Raadt
2002-06-23uid_t is unsignedTheo de Raadt
2002-06-22use strtok_r() instead of strtok(); millert okTheo de Raadt