Skip to content

Commit

Permalink
solv_repo: Add read permissions to cached solv files
Browse files Browse the repository at this point in the history
In order to reuse cached `*.solv` and `*.solvx` files by users, we need to add read permissions.
  • Loading branch information
jan-kolarik authored and kontura committed Dec 7, 2023
1 parent 491f3df commit 2c1c2f3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libdnf5/repo/solv_repo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,10 @@ void SolvRepo::write_main(bool load_after_write) {
}
}

std::filesystem::permissions(
cache_tmp_file.get_path(),
std::filesystem::perms::group_read | std::filesystem::perms::others_read,
std::filesystem::perm_options::add);
std::filesystem::rename(cache_tmp_file.get_path(), solvfile_path);
cache_tmp_file.release();
}
Expand Down Expand Up @@ -668,6 +672,10 @@ void SolvRepo::write_ext(Id repodata_id, RepodataType type) {
data->state = REPODATA_AVAILABLE;
}

std::filesystem::permissions(
cache_tmp_file.get_path(),
std::filesystem::perms::group_read | std::filesystem::perms::others_read,
std::filesystem::perm_options::add);
std::filesystem::rename(cache_tmp_file.get_path(), solvfile_path);
cache_tmp_file.release();
}
Expand Down

0 comments on commit 2c1c2f3

Please sign in to comment.