patch 8.2.4282: restricted mode requires the -Z command line option
Problem: Restricted mode requires the -Z command line option.
Solution: Use restricted mode when $SHELL ends in "nologin" or "false".
(closes #9681)
diff --git a/src/option.c b/src/option.c
index 339ea42..03274a4 100644
--- a/src/option.c
+++ b/src/option.c
@@ -307,6 +307,17 @@
*/
set_options_default(0);
+#ifdef UNIX
+ // Force restricted-mode on for "nologin" or "false" $SHELL
+ p = get_isolated_shell_name();
+ if (p != NULL)
+ {
+ if (fnamecmp(p, "nologin") == 0 || fnamecmp(p, "false") == 0)
+ restricted = TRUE;
+ vim_free(p);
+ }
+#endif
+
#ifdef CLEAN_RUNTIMEPATH
if (clean_arg)
{