Respect umask when creating backup files.
authorMichael Vrable <mvrable@cs.ucsd.edu>
Thu, 19 Jul 2007 16:42:38 +0000 (09:42 -0700)
committerMichael Vrable <mvrable@turin.ucsd.edu>
Thu, 19 Jul 2007 16:42:38 +0000 (09:42 -0700)
Previously backup files were created with permissions of 0600 before the
umask was subtracted.  Set it to 0666 now; the user can adjust the
permissions to make them more restrictive by changing the umask or
permissions in the parent directories.

store.cc

index eb1c6da..8f2c8b3 100644 (file)
--- a/store.cc
+++ b/store.cc
@@ -57,7 +57,7 @@ Tarfile::Tarfile(const string &path, const string &segment)
     filter_fd = spawn_filter(real_fd);
 
     if (tar_fdopen(&t, filter_fd, (char *)path.c_str(), NULL,
-                   O_WRONLY | O_CREAT, 0600, TAR_VERBOSE | TAR_GNU) == -1)
+                   O_WRONLY | O_CREAT, 0666, TAR_VERBOSE | TAR_GNU) == -1)
         throw IOException("Error opening Tarfile");
 }