History log of /openbsd-src/lib/libc/stdlib/setenv.c (Results 1 – 20 of 20)
Revision Date Author Comments
# 7fd658f2 08-Aug-2022 millert <millert@openbsd.org>

For putenv(3), return an error if string starts with a '=' character.
Both FreeBSD and NetBSD have this behavior. OK deraadt@


# 3240e6a8 21-Sep-2016 guenther <guenther@openbsd.org>

Delete casts to off_t and size_t that are implied by assignments
or prototypes. Ditto for some of the char* and void* casts too.

verified no change to instructions on ILP32 (i386) and LP64 (amd64)

Delete casts to off_t and size_t that are implied by assignments
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@

show more ...


# 39432227 25-Apr-2016 millert <millert@openbsd.org>

Allow setenv(3) and putenv(3) to operate on a NULL environ pointer.
The getenv(3) and unsetenv(3) functions already support this.
This will make it easier to emulate the glibc clearenv() function in

Allow setenv(3) and putenv(3) to operate on a NULL environ pointer.
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@

show more ...


# e4224292 13-Mar-2016 guenther <guenther@openbsd.org>

environ and __progname are not declared in a public header; declare them
in libc's hidden/stdlib.h instead of in each .c file that needs one

ok deraadt@ gsoares@ mpi@


# 0d943ef0 13-Sep-2015 guenther <guenther@openbsd.org>

Wrap <stdlib.h> so that calls go direct and the symbols not in the
C standard are all weak.
Apply __{BEGIN,END}_HIDDEN_DECLS to gdtoa{,imp}.h, hiding the
arch-specific __strtorx, __ULtox_D2A, __strto

Wrap <stdlib.h> so that calls go direct and the symbols not in the
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.

show more ...


# ed7f1a02 08-Oct-2014 deraadt <deraadt@openbsd.org>

using reallocarray() gives us multiplicative integer overflow checking
in case something wants to create massive amounts of environment, like
a bit more than 1/4 of a 32-bit address space. unrealist

using reallocarray() gives us multiplicative integer overflow checking
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.

show more ...


# 98da8fe0 23-Sep-2012 jeremy <jeremy@openbsd.org>

Make setenv(3) consistent with unsetenv(3), giving EINVAL if passed
an empty name, NULL pointer, or a name containing an '=' character.

OK millert@, guenther@


# 00a0724b 23-Aug-2010 millert <millert@openbsd.org>

Check for duplicate variables in the environment when setting a value
via setenv() or putenv(). OK miod@


# f1fdc1be 29-Jun-2010 naddy <naddy@openbsd.org>

Make unsetenv(NULL) and unsetenv("") give EINVAL, per POSIX. ok deraadt@


# fa860d8f 04-Jun-2009 millert <millert@openbsd.org>

Don't assume that we can overwrite strings in the environment.
Someone may have passed a read-only string to putenv() (I'm looking
at you cron!).


# 471b62ee 03-Jun-2009 millert <millert@openbsd.org>

Make putenv(), setenv() and unsetenv() standards compliant. The
standard explicitly disallows passing setenv a name with a '=' in
it but historic BSD behavior is to allow this but to ignore the '='

Make putenv(), setenv() and unsetenv() standards compliant. The
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.

show more ...


# c2c925de 08-Aug-2005 espie <espie@openbsd.org>

zap remaining rcsid.

Kill old files that are no longer compiled.

okay theo


# d8bc04e4 30-Mar-2005 pat <pat@openbsd.org>

ansi + de-register

ok otto deraadt


# 31acb996 16-Feb-2005 millert <millert@openbsd.org>

Stash the environment pointer we get from realloc() instead of just
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

Stash the environment pointer we get from realloc() instead of just
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@

show more ...


# 6580fee3 02-Jun-2003 millert <millert@openbsd.org>

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


# 0bf9f082 10-Dec-2002 mickey <mickey@openbsd.org>

use proper __findenv() prototype; millert@ ok


# 20675415 09-Jul-2001 deraadt <deraadt@openbsd.org>

a first pass at -Wall


# 48d1b8ab 02-Feb-1998 millert <millert@openbsd.org>

Don't override environ if realloc() fails. Pointed out by
Dave Bodenstab <imdave@mcs.net>


# e9b2b68c 19-Aug-1996 tholo <tholo@openbsd.org>

Fix RCS ids
Make sure everything uses {SYS,}LIBC_SCCS properly


# df930be7 18-Oct-1995 deraadt <deraadt@openbsd.org>

initial import of NetBSD tree