Permalink
Browse files

Make sure that a reverted file has the same permissions as the origin…

…al file
  • Loading branch information...
1 parent 313f3c8 commit 4ce4b86262bc77e8e30716806e199681ef6e612b Ken Moore committed Aug 16, 2013
Showing with 5 additions and 2 deletions.
  1. +5 −2 life-preserver/LPBackend.cpp
View
7 life-preserver/LPBackend.cpp
@@ -251,8 +251,11 @@ QString LPBackend::revertSnapshotFile(QString dsmountpoint, QString snapshot, QS
//perform the copy
bool ok = QFile::copy(filepath,newfilepath);
//return the path to the new file if the copy was successful
- if(ok){ return newfilepath; }
- else{ return ""; }
+ if(ok){
+ //reset the permissions on the reverted file to match the original
+ QFile::setPermissions(newfilepath, QFile::permissions(filepath));
+ return newfilepath;
+ }else{ return ""; }
}
// ==================

0 comments on commit 4ce4b86

Please sign in to comment.