Skip to content

Commit

Permalink
apparmor: Fix wrong determination whether crun is confined
Browse files Browse the repository at this point in the history
Closes: containers#1385
Signed-off-by: 馃槑Mostafa Emami <mustafaemami@gmail.com>
  • Loading branch information
idleroamer committed Feb 1, 2024
1 parent 5078ce6 commit 8a767ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcrun/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ is_current_process_confined (libcrun_error_t *err)
if (UNLIKELY (bytes_read < 0))
return crun_make_error (err, errno, "error reading file `%s`", attr_path);

return (strncmp (buf, "unconfined", bytes_read) != 0 && buf[0] != '\0');
return (strstr(buf, "unconfined") == NULL);
}

int
Expand Down

0 comments on commit 8a767ae

Please sign in to comment.