Skip to content

Commit 66eb6c8

Browse files
committed
Fix chown to not dereference symlink
1 parent e8fa517 commit 66eb6c8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: src/docker/container.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ impl Container {
215215
}
216216

217217
pub async fn chown_to_user(&self, path: &str) -> Result<()> {
218-
self.exec_as_root(&["chown", &format!("{}:", self.user), path])
218+
// Use `-h` to not follow symlink, and `user:` will use user's login group.
219+
self.exec_as_root(&["chown", "-h", &format!("{}:", self.user), path])
219220
.await?
220221
.collect()
221222
.await?;

0 commit comments

Comments
 (0)