Skip to content

Commit

Permalink
patch.c: Change ulp cache file owner to target task.
Browse files Browse the repository at this point in the history
Just like issue [0] shows

[0] #14

Signed-off-by: Rong Tao <[email protected]>
  • Loading branch information
Rtoax committed May 8, 2024
1 parent 857f220 commit 82297ea
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/patch/patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,16 @@ int init_patch(struct task_struct *task, const char *obj_file)
goto err;
}

/**
* Target task will open/mmap the object ulp file, thus, it must has
* permission to open and modify the object file.
*/
err = chown(obj_to, task->status.uid, task->status.gid);
if (err) {
lerror("chown %s failed.\n", obj_to);
goto err;
}

/**
* Create and mmap a temp file into target task, this temp file is under
* ULP_PROC_ROOT_DIR/PID/TASK_PROC_MAP_FILES directory, it's named by
Expand Down

0 comments on commit 82297ea

Please sign in to comment.