Skip to content

Commit

Permalink
fix(logger): Set narrower permissions on temporaryFolderLogDirPath
Browse files Browse the repository at this point in the history
Signed-off-by: Josh <[email protected]>
  • Loading branch information
joshtrichards authored Mar 11, 2024
1 parent 0071daa commit 298251a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libsync/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ void Logger::setupTemporaryFolderLogDir()
auto dir = temporaryFolderLogDirPath();
if (!QDir().mkpath(dir))
return;

// Since we're using the temp folder, lock down permissions to owner only
QFile::Permissions perm = QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner;
QFile file(dir);
dir.setPermissions(perm);

setLogDebug(true);
setLogExpire(4 /*hours*/);
setLogDir(dir);
Expand Down

0 comments on commit 298251a

Please sign in to comment.