Skip to content

Commit

Permalink
Merge pull request #9449 from habitat-sh/jah/halt-perms-at-pkgs
Browse files Browse the repository at this point in the history
Stops setting permissions in ensure_path_permissions when we reach pkgs directory
  • Loading branch information
jasonheath authored Nov 4, 2024
2 parents b05f6c7 + ff5f807 commit c4fc381
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/core/src/util/posix_perm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ pub(crate) fn ensure_path_permissions(path: &Path, permissions: u32) -> Result<(
let euid = users::get_effective_uid();
let egid = users::get_effective_gid();
for ancestor in path.ancestors() {
if ancestor.ends_with(crate::fs::PKG_PATH) {
break;
}
if euid_egid_matches(&euid, &egid, ancestor) {
set_permissions(ancestor, permissions)?
}
Expand Down

0 comments on commit c4fc381

Please sign in to comment.