Skip to content

Commit

Permalink
Includes the changes from:
Browse files Browse the repository at this point in the history
zbackup#72
zbackup#70
so this build of zbackup is usable.
  • Loading branch information
DuncanRobertson authored and p2k committed Jul 7, 2015
1 parent 9f93eca commit 8c25c45
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backup_collector.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ private:
Bundle::Id savedId;
int totalChunks, usedChunks, indexTotalChunks, indexUsedChunks;
int indexModifiedBundles, indexKeptBundles, indexRemovedBundles;
bool indexModified;
vector< string > filesToUnlink;

public:
bool indexModified;
string bundlesPath;
bool verbose;
ChunkStorage::Reader *chunkStorageReader;
Expand Down
7 changes: 6 additions & 1 deletion tmp_mgr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ sptr< TemporaryFile > TmpMgr::makeTemporaryFile()
{
string name( Dir::addPath( path, "XXXXXX") );

umask( S_IRUSR | S_IWUSR | S_IRGRP );
// Set the umask to remove permisions of grp and other
// in case an insecure (older) mkstemp is used.
mode_t old_mask = umask( S_IRWXG | S_IRWXO );
// Create the temporary file.
int fd = mkstemp( &name[ 0 ] );
// Reset the umask to the previous setting
umask(old_mask);

if ( fd == -1 || close( fd ) != 0 )
throw exCantCreate( path );
Expand Down
1 change: 1 addition & 0 deletions zutils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ void ZCollector::gc()
Dir::Entry entry;

BundleCollector collector;
collector.indexModified = true;
collector.bundlesPath = getBundlesPath();
collector.chunkStorageReader = &this->chunkStorageReader;
collector.chunkStorageWriter = &chunkStorageWriter;
Expand Down

0 comments on commit 8c25c45

Please sign in to comment.