Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: filter_exclude fails when execute in specific context #51

Open
The-Mule opened this issue Apr 19, 2017 · 2 comments
Open

BUG: filter_exclude fails when execute in specific context #51

The-Mule opened this issue Apr 19, 2017 · 2 comments

Comments

@The-Mule
Copy link
Contributor

The-Mule commented Apr 19, 2017

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

@The-Mule
Copy link
Contributor Author

Quick fix - The-Mule@783e2a5

@rgbriggs
Copy link
Contributor

Understood. The fix looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants