diff options
author | Younes Manton <ymanton@ca.ibm.com> | 2022-05-30 20:34:20 +0300 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2022-07-13 09:43:50 +0300 |
commit | 290a998ec827dac96f22bdbc978dc931784b6d1e (patch) | |
tree | 5f33a9f0f4f12ab348ff32c6feb77a4d77d6823e /lib | |
parent | c8f9880adab038481f7806173b698fc6e17ba76a (diff) |
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/c/criu.c | 11 | ||||
-rw-r--r-- | lib/c/criu.h | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/c/criu.c b/lib/c/criu.c index 7807d7bc5..8171f7a12 100644 --- a/lib/c/criu.c +++ b/lib/c/criu.c @@ -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; diff --git a/lib/c/criu.h b/lib/c/criu.h index 7cc6a199c..c32a8a646 100644 --- a/lib/c/criu.h +++ b/lib/c/criu.h @@ -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); |