summaryrefslogtreecommitdiffstats
path: root/stdlib
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-09-25 13:09:01 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-09-25 13:09:01 -0700
commitba75167d1e7c609b829978b3f4a748ce3cf69ad9 (patch)
treed7f4342eec79bd472ac0b0409346c679946f0442 /stdlib
parentd95be98dd8b2feaffc296a19f9a6e59f76133568 (diff)
downloadtxr-ba75167d1e7c609b829978b3f4a748ce3cf69ad9.tar.gz
txr-ba75167d1e7c609b829978b3f4a748ce3cf69ad9.tar.bz2
txr-ba75167d1e7c609b829978b3f4a748ce3cf69ad9.zip
New function: replace-env.
Using this new function together with env, it's now possible to save the set of environment variables, clobber it to a specified set (possibly empty) and then restore it. Useful for improved security in running child processes. * lib.[ch] (chk_substrdup_utf8): New function. * sysif.c (replace_env): New function. (sysif_init): Register replace-env intrinsic. * sysif.h (replace_env): Declared. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/doc-syms.tl1
1 files changed, 1 insertions, 0 deletions
diff --git a/stdlib/doc-syms.tl b/stdlib/doc-syms.tl
index c9fcf582..9cc7068e 100644
--- a/stdlib/doc-syms.tl
+++ b/stdlib/doc-syms.tl
@@ -1584,6 +1584,7 @@
("repeat" "D-006A")
("replace" "N-035991E1")
("replace-buf" "N-01C59E4E")
+ ("replace-env" "N-03C59E3B")
("replace-list" "N-03E43DA2")
("replace-str" "N-02059F0A")
("replace-struct" "N-01A8343B")