From: Francois Fleuret Date: Tue, 29 Jul 2014 10:47:00 +0000 (+0200) Subject: Set the file mode creation default to user only. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=9a94a953917f0ae9eeacecdde79f7b3ac6dbf5e5;p=selector.git Set the file mode creation default to user only. --- diff --git a/selector.c b/selector.c index 6695bb6..0efdd1c 100644 --- a/selector.c +++ b/selector.c @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -1009,6 +1010,9 @@ int main(int argc, char **argv) { struct hash_table_t *hash_table; char *bash_histsize; + /* Group and others have no access to created files */ + umask(S_IRWXG | S_IRWXO); + if(!isatty(STDIN_FILENO)) { fprintf(stderr, "selector: The standard input is not a tty.\n"); exit(EXIT_FAILURE);