05fed9a55a47f47eb6f96022325725c6b6e0457c — Drew DeVault 2 months ago a2d4b7f
Set PWD to readonly
1 files changed, 5 insertions(+), 1 deletions(-)

M shell/entry.c
M shell/entry.c => shell/entry.c +5 -1
@@ 79,7 79,11 @@ fprintf(stderr, "getcwd failed: %s\n", strerror(errno));
  			return false;
  		}
- 		mrsh_env_set(state, "PWD", cwd, MRSH_VAR_ATTRIB_EXPORT);
+ 		mrsh_env_set(state, "PWD", cwd,
+ 				MRSH_VAR_ATTRIB_EXPORT | MRSH_VAR_ATTRIB_READONLY);
+ 	} else {
+ 		mrsh_env_set(state, "PWD", pwd,
+ 				MRSH_VAR_ATTRIB_EXPORT | MRSH_VAR_ATTRIB_READONLY);
  	}
  
  	mrsh_env_set(state, "OPTIND", "1", MRSH_VAR_ATTRIB_NONE);