diff options
author | Younes Manton <ymanton@ca.ibm.com> | 2022-08-12 21:56:53 +0300 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2022-10-25 17:26:42 +0300 |
commit | 3b5f5c7d485964500215ba74b874195b60df85fd (patch) | |
tree | c42bd68928a6044dd43f8d77b0dc960103d897e4 /lib | |
parent | de70d2c9c10daac00d8e7c0f20da33eb31c48993 (diff) |
non-root: enable non-root checkpoint/restore
This commit enables checkpointing and restoring of applications as
non-root.
First goal was to enable checkpoint and restore of the env00 and
pthread00 test case.
This uses the information from opts.unprivileged and opts.cap_eff to
skip certain code paths which do not work as non-root.
Co-authored-by: Adrian Reber <areber@redhat.com>
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 | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/c/criu.c b/lib/c/criu.c index 8171f7a12..fc8159999 100644 --- a/lib/c/criu.c +++ b/lib/c/criu.c @@ -566,6 +566,17 @@ 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_unprivileged(criu_opts *opts, bool unprivileged) +{ + opts->rpc->has_unprivileged = true; + opts->rpc->unprivileged = unprivileged; +} + +void criu_set_unprivileged(bool unprivileged) +{ + criu_local_set_unprivileged(global_opts, unprivileged); +} + 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 c32a8a646..28a083d88 100644 --- a/lib/c/criu.h +++ b/lib/c/criu.h @@ -79,6 +79,7 @@ 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_unprivileged(bool unprivileged); 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); |