mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-14 22:24:14 +00:00
Merge pull request #7365 from alakesh/symlink-fix
agent: exclude symlinks from recursive ownership change
This commit is contained in:
commit
5385ddc560
@ -756,6 +756,14 @@ pub fn recursive_ownership_change(
|
|||||||
mask |= EXEC_MASK;
|
mask |= EXEC_MASK;
|
||||||
mask |= MODE_SETGID;
|
mask |= MODE_SETGID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We do not want to change the permission of the underlying file
|
||||||
|
// using symlink. Hence we skip symlinks from recursive ownership
|
||||||
|
// and permission changes.
|
||||||
|
if path.is_symlink() {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
nix::unistd::chown(path, uid, gid)?;
|
nix::unistd::chown(path, uid, gid)?;
|
||||||
|
|
||||||
if gid.is_some() {
|
if gid.is_some() {
|
||||||
|
Loading…
Reference in New Issue
Block a user