search for: opt_of

Displaying 1 result from an estimated 1 matches for "opt_of".

Did you mean: opt_af
2003 Nov 23
1
[PATCH] dd O_CREAT permission
...#include <stdio.h> #include <stdlib.h> #include <string.h> +#include <sys/types.h> +#include <sys/stat.h> #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) @@ -483,7 +485,7 @@ int main(int argc, char *argv[]) * Open the output file, if specified. */ if (OPT_OF->str) { - wr_fd = open(OPT_OF->str, O_RDWR|O_CREAT); + wr_fd = open(OPT_OF->str, O_RDWR|O_CREAT,~umask(0) & (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)); if (wr_fd == -1) { perror("open output file"); return 1; -- USB is for mice, FireWire is for men! sUs...