]> git.donarmstrong.com Git - samtools.git/commitdiff
Changed the mode for newly created files to 0666. This allows less strict permissions...
authorPetr Danecek <pd3@sanger.ac.uk>
Mon, 28 Sep 2009 08:51:29 +0000 (08:51 +0000)
committerPetr Danecek <pd3@sanger.ac.uk>
Mon, 28 Sep 2009 08:51:29 +0000 (08:51 +0000)
bgzf.c
bgzip.c
razf.c
razip.c

diff --git a/bgzf.c b/bgzf.c
index 646b2b4a142e2c35f4ab039b515e68fcd9126d66..59f902ff85501bade5a5a2f079ed9e8f7b52c38b 100644 (file)
--- a/bgzf.c
+++ b/bgzf.c
@@ -199,7 +199,7 @@ bgzf_open(const char* __restrict path, const char* __restrict mode)
 #ifdef _WIN32
                oflag |= O_BINARY;
 #endif
-               fd = open(path, oflag, 0644);
+               fd = open(path, oflag, 0666);
                if (fd == -1) return 0;
         fp = open_write(fd, strstr(mode, "u")? 1 : 0);
     }
diff --git a/bgzip.c b/bgzip.c
index eb88195ec279a99f63b9a6780103d00f7e5829ca..ac2a98ea35eb2503d94652918054575b341f5cc1 100644 (file)
--- a/bgzip.c
+++ b/bgzip.c
@@ -50,7 +50,7 @@ static int write_open(const char *fn, int is_forced)
        int fd = -1;
        char c;
        if (!is_forced) {
-               if ((fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0644)) < 0 && errno == EEXIST) {
+               if ((fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0666)) < 0 && errno == EEXIST) {
                        printf("bgzip: %s already exists; do you wish to overwrite (y or n)? ", fn);
                        scanf("%c", &c);
                        if (c != 'Y' && c != 'y') {
@@ -60,7 +60,7 @@ static int write_open(const char *fn, int is_forced)
                }
        }
        if (fd < 0) {
-               if ((fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0) {
+               if ((fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) {
                        fprintf(stderr, "bgzip: %s: Fail to write\n", fn);
                        exit(1);
                }
diff --git a/razf.c b/razf.c
index 9b9267e494fe95cddde5e1e31c50cfc958701a11..2ce364e91ecc2229bf17a2426194cc4b70a96df5 100644 (file)
--- a/razf.c
+++ b/razf.c
@@ -511,9 +511,9 @@ static inline RAZF* _razf_open(const char *filename, const char *mode, int _load
                rz = razf_open_r(fd, _load_index);
        } else if(strstr(mode, "w")){
 #ifdef _WIN32
-               fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644);
+               fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
 #else
-               fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0644);
+               fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666);
 #endif
                if(fd < 0) return NULL;
                rz = razf_open_w(fd);
diff --git a/razip.c b/razip.c
index 2b49883aefc6d607e7a44fbc9a3906443f8b7cbd..dff9347770f281fc90631dcc24fbe77f7fc5cc94 100644 (file)
--- a/razip.c
+++ b/razip.c
@@ -27,7 +27,7 @@ static int write_open(const char *fn, int is_forced)
        int fd = -1;
        char c;
        if (!is_forced) {
-               if ((fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0644)) < 0 && errno == EEXIST) {
+               if ((fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0666)) < 0 && errno == EEXIST) {
                        printf("razip: %s already exists; do you wish to overwrite (y or n)? ", fn);
                        scanf("%c", &c);
                        if (c != 'Y' && c != 'y') {
@@ -37,7 +37,7 @@ static int write_open(const char *fn, int is_forced)
                }
        }
        if (fd < 0) {
-               if ((fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0) {
+               if ((fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) {
                        fprintf(stderr, "razip: %s: Fail to write\n", fn);
                        exit(1);
                }