Skip to content

Commit

Permalink
lsm: use the user provided lsm label
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
adrianreber committed Feb 6, 2025
1 parent d4585a0 commit 432e9f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion criu/lsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 432e9f7

Please sign in to comment.