summaryrefslogtreecommitdiffstats
path: root/lisplib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-03-18 08:02:21 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-03-18 08:02:21 -0700
commit03eb076fdeb10974dcadfd2cabfc51faa4770416 (patch)
treef48ac4c9e2455ba7fbf35705de22ed78fa91a196 /lisplib.c
parent1417fd8d7b07bba0ffe574d42e3c787ce067f9c5 (diff)
downloadtxr-03eb076fdeb10974dcadfd2cabfc51faa4770416.tar.gz
txr-03eb076fdeb10974dcadfd2cabfc51faa4770416.tar.bz2
txr-03eb076fdeb10974dcadfd2cabfc51faa4770416.zip
Use original *packages-alist* value for auto-load.
* lisplib.c (lisplib_try_load): Around the load, don't just bind *package* to the user package, but also *package-alist* to the original initialization-time list of packages. This allows auto-loading to work in sandboxed code. This has security implications: if sandboxed code can somehow trigger an error situation in an auto-load which then calls back into a handler in the sandboxed code, it then has access to the full usr and sys packages.
Diffstat (limited to 'lisplib.c')
-rw-r--r--lisplib.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lisplib.c b/lisplib.c
index cbe2de5d..93e48def 100644
--- a/lisplib.c
+++ b/lisplib.c
@@ -570,6 +570,7 @@ val lisplib_try_load(val sym)
val saved_dyn_env = dyn_env;
dyn_env = make_env(nil, nil, dyn_env);
env_vbind(dyn_env, package_s, user_package);
+ env_vbind(dyn_env, package_alist_s, packages);
funcall(fun);
dyn_env = saved_dyn_env;
debug_restore_state(ds);