bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 8/8] shell: restrict BASH_SOURCE_PATH when appropriate


From: Matheus Afonso Martins Moreira
Subject: [PATCH v2 8/8] shell: restrict BASH_SOURCE_PATH when appropriate
Date: Mon, 13 May 2024 07:37:26 -0300

Make the BASH_SOURCE_PATH variable read-only and unsettable
when the shell is operating in restricted mode. This variable
should be restricted for the same reasons why PATH is restricted.

Signed-off-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
---
 shell.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/shell.c b/shell.c
index 15e005d6..940de31b 100644
--- a/shell.c
+++ b/shell.c
@@ -1294,6 +1294,7 @@ maybe_make_restricted (char *name)
       set_var_read_only ("ENV");
       set_var_read_only ("BASH_ENV");
       set_var_read_only ("HISTFILE");
+      set_var_read_only ("BASH_SOURCE_PATH");
       restricted = 1;
     }
   return (restricted);
-- 
2.44.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]