diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-08-27 16:09:23 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-08-27 16:09:23 -0400 |
commit | e0392a04462888661d4d350818e378b7df2c8fd1 (patch) | |
tree | fbac57c58b2a2e1c25c8cd1a20a46072bbc27974 | |
parent | 834fb186b56420bcac38696815e2647832bfa9e4 (diff) | |
download | stasis-e0392a04462888661d4d350818e378b7df2c8fd1.tar.gz |
Change script permissions: 0700
-rw-r--r-- | src/system.c | 8 |
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 +} |