Skip to content

Commit 19ac522

Browse files
committed
fix: chown the symlink itself
1 parent 880d5d6 commit 19ac522

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/api/exec.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ impl<'a> ExecApi<'a> {
290290
&self,
291291
container_id: &str,
292292
mounts: &HashMap<TargetDir, VolumeFilesSpec>,
293+
uid: &str,
293294
) -> Result<(), AnyError> {
294295
for (_, spec) in mounts {
295296
for file in &spec.files {
@@ -300,9 +301,10 @@ impl<'a> ExecApi<'a> {
300301
);
301302

302303
let cmd = format!(
303-
"mkdir -p $(dirname {0}) && ln -sf {1} {0}",
304+
"mkdir -p $(dirname {0}) && ln -sf {1} {0} && chown -h {2}:{2} {0}",
304305
&file.user_file.as_str().replace("~", "${ROOZ_META_HOME}"),
305306
&file.target_file.as_str(),
307+
uid
306308
);
307309

308310
let output = self

src/api/workspace/enter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl<'a> WorkspaceApi<'a> {
102102
.await?;
103103
}
104104

105-
self.api.exec.symlink_files(container_id, &config.real_mounts).await?;
105+
self.api.exec.symlink_files(container_id, &config.real_mounts, chown_uid).await?;
106106
}
107107

108108
match self

0 commit comments

Comments
 (0)