mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-05 00:35:23 +00:00
image: Open images via openat
Using absolute paths for this is dangerous - while doing c/r we should be extremely carefully and not change tasks' roots and mount namespaces too early. Sometimes it will not work -- when restoring containers we'll be unable to switch to new CT and still have the ability to open images. Rework the images opening via openat and keep the image dir fd open all the time as the service fd (introduced earlier). Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
@@ -91,9 +91,13 @@ extern struct cr_fd_desc_tmpl fdset_template[CR_FD_MAX];
|
||||
#define FMT_FNAME_IPCNS_SEM "ipcns-sem-%d.img"
|
||||
#define FMT_FNAME_SK_QUEUES "sk-queues-%d.img"
|
||||
|
||||
extern int get_image_path(char *path, int size, const char *fmt, int pid);
|
||||
|
||||
extern char image_dir[];
|
||||
/*
|
||||
* FIXME -- this is required for legacy image copy only.
|
||||
* Don't use it for other reason and remove the former one.
|
||||
*/
|
||||
extern int image_dir_fd;
|
||||
extern int open_image_dir(void);
|
||||
extern void close_image_dir(void);
|
||||
extern int open_image_ro(int type, int pid);
|
||||
extern int open_image_ro_nocheck(const char *fmt, int pid);
|
||||
|
||||
|
Reference in New Issue
Block a user