Skip to content

Commit

Permalink
passwd: Don't traverse symlinks when querying metadata
Browse files Browse the repository at this point in the history
I hit this when experimenting with:

- dnf --installroot
- rpm-ostree compose commit
  • Loading branch information
cgwalters committed Mar 30, 2024
1 parent aae3313 commit 16f4917
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rust/src/passwd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ fn dir_contains_uid_gid(dir: &Dir, uid: &Option<Uid>, gid: &Option<Gid>) -> Resu
let subdir = dir.open_dir(dir_entry.file_name())?;
dir_contains_uid_gid(&subdir, uid, gid)?
} else {
let metadata = dir.metadata(dir_entry.file_name())?;
let metadata = dir_entry.metadata()?;
compare_uid_gid(metadata, uid, gid)
};

Expand Down

0 comments on commit 16f4917

Please sign in to comment.