config/files-reg: Add opt to skip file r/w/x check on restore

A file's r/w/x changing between checkpoint and restore does
not necessarily imply that something is wrong. For example,
if a process opens a file having perms rw- for reading and
we change the perms to r--, the process can be restored and
will function as expected.

Therefore, this patch adds an option

--skip-file-rwx-check

to disable this check on restore. File validation is unaffected
and should still function as expected with respect to the content
of files.

Signed-off-by: Younes Manton <ymanton@ca.ibm.com>
This commit is contained in:
Younes Manton 2022-05-30 17:34:20 +00:00 committed by Andrei Vagin
parent 6cef6e726a
commit 18fba41255
9 changed files with 40 additions and 3 deletions

View file

@ -555,6 +555,17 @@ void criu_set_shell_job(bool shell_job)
criu_local_set_shell_job(global_opts, shell_job);
}
void criu_local_set_skip_file_rwx_check(criu_opts *opts, bool skip_file_rwx_check)
{
opts->rpc->has_skip_file_rwx_check = true;
opts->rpc->skip_file_rwx_check = skip_file_rwx_check;
}
void criu_set_skip_file_rwx_check(bool skip_file_rwx_check)
{
criu_local_set_skip_file_rwx_check(global_opts, skip_file_rwx_check);
}
void criu_local_set_orphan_pts_master(criu_opts *opts, bool orphan_pts_master)
{
opts->rpc->has_orphan_pts_master = true;

View file

@ -78,6 +78,7 @@ void criu_set_tcp_close(bool tcp_close);
void criu_set_weak_sysctls(bool val);
void criu_set_evasive_devices(bool evasive_devices);
void criu_set_shell_job(bool shell_job);
void criu_set_skip_file_rwx_check(bool skip_file_rwx_check);
void criu_set_orphan_pts_master(bool orphan_pts_master);
void criu_set_file_locks(bool file_locks);
void criu_set_track_mem(bool track_mem);
@ -238,6 +239,7 @@ void criu_local_set_tcp_close(criu_opts *opts, bool tcp_close);
void criu_local_set_weak_sysctls(criu_opts *opts, bool val);
void criu_local_set_evasive_devices(criu_opts *opts, bool evasive_devices);
void criu_local_set_shell_job(criu_opts *opts, bool shell_job);
void criu_local_set_skip_file_rwx_check(criu_opts *opts, bool skip_file_rwx_check);
void criu_local_set_orphan_pts_master(criu_opts *opts, bool orphan_pts_master);
void criu_local_set_file_locks(criu_opts *opts, bool file_locks);
void criu_local_set_track_mem(criu_opts *opts, bool track_mem);