]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add a clean_environment call to libutil.
authorTim Kientzle <kientzle@FreeBSD.org>
Thu, 26 Feb 2004 22:41:47 +0000 (22:41 +0000)
committerTim Kientzle <kientzle@FreeBSD.org>
Thu, 26 Feb 2004 22:41:47 +0000 (22:41 +0000)
commitf9efe8694a302bea13ea053658430fcbed691eb8
tree5e278436635ecd11128c037e5897c960d101598c
parent0d60ad30ca6d9e71aeaca783266b22ea711979f3
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]