commit 662852943ef10560c7208f2fbfa77d3c65da0f7a from: Stefan Sperling date: Fri Sep 01 14:06:22 2023 UTC make ~/.nshrc unreadable for group/others Suggested by Tom commit - 9249dbee79de9c8d12ff3ae8f6e0e9b1ee92e826 commit + 662852943ef10560c7208f2fbfa77d3c65da0f7a blob - f3464e018269b2b759b94baf557ce74f0ddcf63d blob + 321f97daac56ea301ca7f4c04bb3dc2ee3caa5b9 --- commands.c +++ commands.c @@ -2460,6 +2460,9 @@ saveenvcmd(int argc, char **argv) return 0; } + if (fchmod(fileno(f), S_IRUSR | S_IWUSR) == -1) + printf("%% chmod 600 %s: %s\n", path, strerror(errno)); + hashtable_foreach(nsh_env, savevar, f); fclose(f);