2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 01:51:51 +00:00

lsm: use the user provided lsm label

Currently CRIU has the possibility to specify a LSM label during
restore. Unfortunately the information is completely ignored in the case
of SELinux.

This change selects the lsm label from the user if it is provided and
else the label from the checkpoint image is used.

Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:
Adrian Reber 2025-02-06 11:07:17 +01:00 committed by Andrei Vagin
parent 3025ee1f7c
commit 4b099510b3

View File

@ -370,7 +370,7 @@ int render_lsm_profile(char *profile, char **val)
case LSMTYPE__APPARMOR:
return render_aa_profile(val, profile);
case LSMTYPE__SELINUX:
if (asprintf(val, "%s", profile) < 0) {
if (asprintf(val, "%s", opts.lsm_supplied ? opts.lsm_profile : profile) < 0) {
*val = NULL;
return -1;
}