summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/getenv.3
Commit message (Collapse)AuthorAgeFilesLines
* libc: indicate existing functions that are POSIX 2024Ed Maste2024-11-211-1/+2
| | | | | | | | Reviewed by: brooks, imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47581 (cherry picked from commit dfa0ac74c2fbc1cde3e8cdb1ab9fe5cbb90a9b16)
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* secure_getenv: Improve documentation wordingWarner Losh2023-03-251-14/+16
| | | | | | | | Improve the documentation wording to be more consistent with FreeBSD manual pages. Suggested by: mjg (though reworded) Sponsored by: Netflix
* Add GNU glibc compatible secure_getenvlucy2023-03-141-1/+25
| | | | | | | | | | | | Add mostly glibc and msl compatible secure_getenv. Return NULL if issetugid() indicates the process is tainted, otherwise getenv(x). The rational behind this is the fact that many Linux applications use this function instead of getenv() as it's widely consider a, "best practice". Reviewed by: imp, mjg (feedback) Pull Request: https://github.com/freebsd/freebsd-src/pull/686 Signed-off-by: Lucy Marsh <seafork@disroot.org>
* libc: add clearenv functionMariusz Zaborski2021-11-071-2/+18
| | | | | | | | | | The clearenv(3) function allows us to clear all environment variable in one shot. This may be useful for security programs that want to control the environment or what variables are passed to new spawned programs. Reviewed by: scf, markj (secteam), 0mp (manpages) Differential Revision: https://reviews.freebsd.org/D28223
* Renumber clauses to reduce diffs to other versionsEd Maste2013-05-281-1/+1
| | | | | | | | NetBSD, OpenBSD, and Android's Bionic number the clauses 1 through 3, so follow suit to make comparison easier. Notes: svn path=/head/; revision=251069
* General mdoc(7) and typo fixes.Glen Barber2012-05-111-1/+2
| | | | | | | | | PR: 167734 Submitted by: Nobuyuki Koganemaru (kogane!jp.freebsd.org) MFC after: 3 days Notes: svn path=/head/; revision=235286
* Remove trailing whitespace per mdoc lint warningEitan Adler2012-03-291-1/+1
| | | | | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days Notes: svn path=/head/; revision=233648
* Update the getenv(3) man page to reflect the recent change to the behaviorSean Farley2009-12-061-9/+9
| | | | | | | | | | of setenv(), putenv() and unsetenv() when dealing with corrupt entries in environ. They now output a warning and complete their task without error. MFC after: 1 week Notes: svn path=/head/; revision=200195
* Significantly reduce the memory leak as noted in BUGS section forSean Farley2007-07-041-24/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | setenv(3) by tracking the size of the memory allocated instead of using strlen() on the current value. Convert all calls to POSIX from historic BSD API: - unsetenv returns an int. - putenv takes a char * instead of const char *. - putenv no longer makes a copy of the input string. - errno is set appropriately for POSIX. Exceptions involve bad environ variable and internal initialization code. These both set errno to EFAULT. Several patches to base utilities to handle the POSIX changes from Andrey Chernov's previous commit. A few I re-wrote to use setenv() instead of putenv(). New regression module for tools/regression/environ to test these functions. It also can be used to test the performance. Bump __FreeBSD_version to 700050 due to API change. PR: kern/99826 Approved by: wes Approved by: re (kensmith) Notes: svn path=/head/; revision=171195
* Back out all POSIXified *env() changes.Andrey A. Chernov2007-05-011-35/+18
| | | | | | | | | | | | Not because I admit they are technically wrong and not because of bug reports (I receive nothing). But because I surprisingly meets so strong opposition and resistance so lost any desire to continue that. Anyone who interested in POSIX can dig out what changes and how through cvs diffs. Notes: svn path=/head/; revision=169177
* Bump .DdAndrey A. Chernov2007-04-301-1/+1
| | | | | | | Suggested by: Henrik Brix Andersen <henrik@brixandersen.dk> Notes: svn path=/head/; revision=169146
* Add phraseAndrey A. Chernov2007-04-301-1/+2
| | | | | | | | "so altering the argument shall change the environment." into putenv description. Notes: svn path=/head/; revision=169142
* Make putenv() fully conforms to Open Group specs Issue 6Andrey A. Chernov2007-04-301-6/+13
| | | | | | | | | | | | | | (also IEEE Std 1003.1-2001) The specs explicitly says that altering passed string should change the environment, i.e. putenv() directly puts its arg into environment (unlike setenv() which just copies it there). It means that putenv() can't be implemented via setenv() (like we have before) at all. Putenv() value lives (allows modifying) up to the next putenv() or setenv() call. Notes: svn path=/head/; revision=169138
* Remove special case skipping initial '=' of the setenv() value "forAndrey A. Chernov2007-04-301-5/+0
| | | | | | | | | | | | compatibility with the different environment conventions" (man page). With the standards, we don't have them different anymore and IEEE Std 1003.1-2001 says that "The values that the environment variables may be assigned are not restricted except that they are considered to end with a null byte" Notes: svn path=/head/; revision=169111
* Make setenv, putenv, getenv and unsetenv conforming to Open Group specsAndrey A. Chernov2007-04-301-9/+23
| | | | | | | | | | | | Issue 6 (also IEEE Std 1003.1-2001) in following areas: args, return, errors. Putenv still needs rewriting because specs explicitly says that altering passed string later should change the environment (currently we copy the string so can't provide that). Notes: svn path=/head/; revision=169109
* Per Regents of the University of Calfornia letter, remove advertisingWarner Losh2007-01-091-4/+0
| | | | | | | | | clause. # If I've done so improperly on a file, please let me know. Notes: svn path=/head/; revision=165903
* Note that the value from getenv() should not be modified by applications.Tom Rhodes2006-10-121-1/+5
| | | | | | | | PR: 60544 Reviewed by: ru Notes: svn path=/head/; revision=163262
* getenv.3: Put "is" on a line with other wordsTom Rhodes2006-10-071-2/+1
| | | | | | | | | | | getobjformat.3: "takes precedence over" is not an envrionment variable. PR: 75545 Submitted by: n-kogane@syd.odn.ne.jp MFC after: 3 days Notes: svn path=/head/; revision=163108
* Sort sections.Ruslan Ermilov2005-01-201-11/+11
| | | | Notes: svn path=/head/; revision=140505
* mdoc(7) fixes.Ruslan Ermilov2004-07-071-2/+3
| | | | Notes: svn path=/head/; revision=131754
* Move the return value information about the getenv(3) library functionHiten Pandya2004-07-061-4/+10
| | | | | | | | | | | | under the RETURN VALUES section so it is consistent with others. Cleanup the return value text for getenv(3) a little while I am here. PR: docs/58033 MFC after: 3 days Notes: svn path=/head/; revision=131728
* Mechanically kill hard sentence breaks.Ruslan Ermilov2004-07-021-2/+4
| | | | Notes: svn path=/head/; revision=131504
* mdoc(7) police: Fixed abuses of the .Ar and .Em macros.Ruslan Ermilov2002-12-181-13/+14
| | | | Notes: svn path=/head/; revision=108040
* Move to using .In instead of .Fd #include <> for include mark-up.Jeroen Ruigrok van der Werven2001-09-071-1/+1
| | | | | | | Inspired by comment from: dd Notes: svn path=/head/; revision=83206
* Use ``.Rv -std'' wherever possible.Ruslan Ermilov2001-08-311-8/+1
| | | | | | | Submitted by: yar Notes: svn path=/head/; revision=82642
* Remove whitespace at EOL.Dima Dorfman2001-07-151-1/+1
| | | | Notes: svn path=/head/; revision=79754
* .St -ansiC -> .St -isoCRuslan Ermilov2001-02-261-1/+1
| | | | Notes: svn path=/head/; revision=73088
* mdoc(7) police: split punctuation characters + misc fixes.Ruslan Ermilov2001-02-011-1/+1
| | | | Notes: svn path=/head/; revision=71895
* Use Fx macro wherever possible.Ruslan Ermilov2000-11-141-1/+3
| | | | Notes: svn path=/head/; revision=68716
* Use `Er' variable to define first column width in ERRORS section.Alexey Zelkin2000-05-061-1/+1
| | | | Notes: svn path=/head/; revision=60075
* Introduce ".Lb" macro to libc manpages.Alexey Zelkin2000-04-211-0/+2
| | | | | | | More libraries manpages updates following. Notes: svn path=/head/; revision=59460
* Document the memory leak that is inherent in FreeBSD's semanticsArchie Cobbs2000-01-261-0/+15
| | | | | | | | | for getenv()/putenv(). PR: 10341 5604 Notes: svn path=/head/; revision=56652
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50476
* Add $Id$, to make it simpler for members of the translation teams toNik Clayton1999-07-121-0/+1
| | | | | | | | | | | | | | | | | | | | track. The $Id$ line is normally at the bottom of the main comment block in the man page, separated from the rest of the manpage by an empty comment, like so; .\" $Id$ .\" If the immediately preceding comment is a @(#) format ID marker than the the $Id$ will line up underneath it with no intervening blank lines. Otherwise, an additional blank line is inserted. Approved by: bde Notes: svn path=/head/; revision=48794
* BSD 4.4 Lite Lib SourcesRodney W. Grimes1994-05-271-0/+151
Notes: svn path=/cvs2svn/branches/unlabeled-1.1.1/; revision=1573