summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/setenv.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Delete casts to off_t and size_t that are implied by assignmentsguenther2016-09-211-2/+2
| | | | | | | or prototypes. Ditto for some of the char* and void* casts too. verified no change to instructions on ILP32 (i386) and LP64 (amd64) ok natano@ abluhm@ deraadt@ millert@
* Allow setenv(3) and putenv(3) to operate on a NULL environ pointer.millert2016-04-251-11/+15
| | | | | | The getenv(3) and unsetenv(3) functions already support this. This will make it easier to emulate the glibc clearenv() function in ports. Based on a diff from and OK jca@
* environ and __progname are not declared in a public header; declare themguenther2016-03-131-2/+1
| | | | | | in libc's hidden/stdlib.h instead of in each .c file that needs one ok deraadt@ gsoares@ mpi@
* Wrap <stdlib.h> so that calls go direct and the symbols not in theguenther2015-09-131-3/+4
| | | | | | C standard are all weak. Apply __{BEGIN,END}_HIDDEN_DECLS to gdtoa{,imp}.h, hiding the arch-specific __strtorx, __ULtox_D2A, __strtorQ, __ULtoQ_D2A symbols.
* using reallocarray() gives us multiplicative integer overflow checkingderaadt2014-10-081-3/+3
| | | | | | | | | | in case something wants to create massive amounts of environment, like a bit more than 1/4 of a 32-bit address space. unrealistic -- but why audit one code path, and not treat others the same? then you have to re-engage everytime you see the code. read the news, that isn't what developers do. At least if the code paths look the same, there is hope, because they are easier to verify for correctness. developers need to give other developers a chance to want to care.
* Make setenv(3) consistent with unsetenv(3), giving EINVAL if passedjeremy2012-09-231-3/+5
| | | | | | an empty name, NULL pointer, or a name containing an '=' character. OK millert@, guenther@
* Check for duplicate variables in the environment when setting a valuemillert2010-08-231-7/+19
| | | | via setenv() or putenv(). OK miod@
* Make unsetenv(NULL) and unsetenv("") give EINVAL, per POSIX. ok deraadt@naddy2010-06-291-1/+5
|
* Don't assume that we can overwrite strings in the environment.millert2009-06-041-1/+3
| | | | | Someone may have passed a read-only string to putenv() (I'm looking at you cron!).
* Make putenv(), setenv() and unsetenv() standards compliant. Themillert2009-06-031-11/+68
| | | | | | 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.
* zap remaining rcsid.espie2005-08-081-4/+1
| | | | | | Kill old files that are no longer compiled. okay theo
* ansi + de-registerpat2005-03-301-7/+3
| | | | ok otto deraadt
* Stash the environment pointer we get from realloc() instead of justmillert2005-02-161-32/+24
| | | | | | | | setting a flag. That way when we are called again we can be sure to realloc() the right thing, regardless of the current value of environ. When the stashed value != environ (or when we are called for the first time), copy the existing entries from environ and set environ to the new value. OK deraadt@, beck@, djm@
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* use proper __findenv() prototype; millert@ okmickey2002-12-101-2/+3
|
* a first pass at -Wallderaadt2001-07-091-3/+4
|
* Don't override environ if realloc() fails. Pointed out bymillert1998-02-021-3/+4
| | | | Dave Bodenstab <imdave@mcs.net>
* Fix RCS idstholo1996-08-191-2/+1
| | | | Make sure everything uses {SYS,}LIBC_SCCS properly
* initial import of NetBSD treederaadt1995-10-181-0/+120