|
From: villate <vi...@us...> - 2025-09-14 16:49:36
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
via ecf6621191402edd31bc4cf2e9576d846249308c (commit)
from 7d78aa96b227bdd2e6526566e8e6c53c6a6bbdc1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit ecf6621191402edd31bc4cf2e9576d846249308c
Author: villate <vi...@fe...>
Date: Sun Sep 14 17:44:40 2025 +0100
Parses the maximarc file instead of sourcing it.
Sourcing a file poses a high security risk. The maximarc file should only
be used to set some environment variables such as MAXIMA_LISP for the preferred Lisp flavor.
Lines which are not used to set environment variables will now be ignored.
diff --git a/src/maxima.in b/src/maxima.in
index ce84356a6..a2240b6bb 100755
--- a/src/maxima.in
+++ b/src/maxima.in
@@ -63,7 +63,7 @@ fi
}
# make a special check for --userdir argument, because it influences location
-# of maximarc, which is sourced before other command-line options are
+# of maximarc, which is parsed before other command-line options are
# processed
process_userdir_argument "$@"
@@ -72,8 +72,15 @@ if [ -z "$MAXIMA_USERDIR" ]; then
else
maximarc_path="`unixize \"$MAXIMA_USERDIR\"`/maximarc"
fi
+
+# Parses the maximarc file. For any line of the type keyword=<value>,
+# the line will be "exported" (enviroment variable keyword set to <value>).
+# Lines which something different than that are ignored.
if [ -f "$maximarc_path" ]; then
- . "$maximarc_path"
+ while IFS= read -r line; do
+ n=$(expr "$line" : '^[a-zA-Z\_]\+=')
+ [ $n -ne 0 ] && export "$line"
+ done < "$maximarc_path"
fi
# For some reason TeXmacs sets MAXIMA_DIRECTORY to the empty string,
-----------------------------------------------------------------------
Summary of changes:
src/maxima.in | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
hooks/post-receive
--
Maxima CAS
|