]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add a clean_environment call to libutil.
authorkientzle <kientzle@FreeBSD.org>
Thu, 26 Feb 2004 22:41:47 +0000 (22:41 +0000)
committerkientzle <kientzle@FreeBSD.org>
Thu, 26 Feb 2004 22:41:47 +0000 (22:41 +0000)
commit8b8fb9aae5628c7005a6ddca3f43524536e45a67
tree5e278436635ecd11128c037e5897c960d101598c
parent58a98b5bd1671c30f49bae2eadb70fb996c4ac0b
Add a clean_environment call to libutil.

This function removes all environment variables except
the ones listed on a "whitelist."

The function accepts two whitelist arguments.
If the first is NULL, a built-in default list will be
used.  This allows callers to get a variety of behaviors:
  * Default screening: provide NULL for both lists
  * Custom screening: provide a custom list for the first argument
  * Modified default screening: provide NULL for first arg,
     list of additional variables to preserve in the second arg

Idea from: Jacques Vidrine

MFC after: 2 weeks
lib/libutil/Makefile
lib/libutil/clean_environment.3 [new file with mode: 0644]
lib/libutil/clean_environment.c [new file with mode: 0644]