mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-21 09:10:10 +00:00
files: don't use PROC_SELF during restoring file descriptors
open_proc_pid(PROC_SELF) returns a non-service file descriptor, but it can take a place of a target file descriptor. Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
parent
42bc32f6c0
commit
8800da2b77
1 changed files with 5 additions and 1 deletions
|
|
@ -1593,7 +1593,11 @@ int open_path(struct file_desc *d,
|
|||
tmp = inherit_fd_lookup_id(rfi->rfe->name);
|
||||
if (tmp >= 0) {
|
||||
inh_fd = tmp;
|
||||
mntns_root = open_pid_proc(PROC_SELF);
|
||||
/*
|
||||
* PROC_SELF isn't used, because only service
|
||||
* descriptors can be used here.
|
||||
*/
|
||||
mntns_root = open_pid_proc(getpid());
|
||||
snprintf(path, sizeof(path), "fd/%d", tmp);
|
||||
orig_path = rfi->path;
|
||||
rfi->path = path;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue