aboutsummaryrefslogtreecommitdiff
path: root/src/system.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/system.c')
-rw-r--r--src/system.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/system.c b/src/system.c
index 36500d2..a564769 100644
--- a/src/system.c
+++ b/src/system.c
@@ -30,7 +30,11 @@ int shell(struct Process *proc, char *args) {
fprintf(tp, "#!/bin/bash\n%s\n", args);
fflush(tp);
fclose(tp);
- chmod(t_name, 0755);
+
+ // Set the script's permissions so that only the calling user can use it
+ // This should help prevent eavesdropping if keys are applied in plain-text
+ // somewhere.
+ chmod(t_name, 0700);
pid = fork();
if (pid == -1) {
@@ -155,4 +159,4 @@ char *shell_output(const char *command, int *status) {
}
*status = pclose(pp);
return result;
-} \ No newline at end of file
+}