Skip to content

BUG: filter_exclude fails when execute in specific context  #51

@The-Mule

Description

@The-Mule

SElinux context is parsed in filter_exclude test incorrectly:

if($subj =~ /([^:]+):([^:]+):([^:]+):([^-]+)-([^-]+)/) {
        ($subj_user, $subj_role, $subj_type, $subj_sen, $subj_clr) = ($1, $2, $3, $4, $5);
}

When there is no clearance (eg. system_u:unconfined_r:unconfined_t:s0 [*]) parsing will not work. The following regex works: ([^:]+):([^:]+):([^:]+):([^-]+)-?([^-]+)?.

Please notice that clearance is used in several places of the test and hence we need to fix those parts as well.

[*] FYI, when I am running testsuite via Beaker, tests are executed with this context.

Reproducer: runcon system_u:unconfined_r:unconfined_t:s0 make tests

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions