role_fix_callback skips out-of-scope roles during expansion.
PATCH 1/1 role_fix_callback skips out-of-scope roles during expansion.
If a role identifier is out of scope it would be skipped over during expansion, accordingly, be it a role attribute, it should be skipped over as well when role_fix_callback tries to propagate its capability to all its sub-roles.
--- libsepol/src/expand.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
libsepol/src/expand.c +5 -0
@@ -688,6 +688,11 @@ static int role_fix_callback(hashtab_key_t key, hashtab_datum_t datum,return 0 ; } +if (!is_id_enabled (id, state->base,SYM_ROLES )) { +/* identifier's scope is not enabled */ +return 0 ; + } +if (role->flavor !=ROLE_ATTRIB )return 0 ;
Signature · 7 lines
1.7.0.4 -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 4 lines · Harry Ciao
If a role identifier is out of scope it would be skipped over during expansion, accordingly, be it a role attribute, it should be skipped over as well when
role_fix_callbacktries to propagate its capability to all its sub-roles.
This fixes my assertion failure with role attributes required by optional blocks in the base module.
Quoted 26 lines
Signed-off-by Harry Ciao <[email protected]>--- libsepol/src/expand.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)libsepol/src/expand.c +5
-1@@ -688,6 +688,11 @@ static int role_fix_callback(hashtab_key_t key,hashtab_datum_t datum, return 0; } +if (!is_id_enabled (id, state->base,SYM_ROLES )) { +/* identifier's scope is not enabled */ +return 0 ; + } +if (role->flavor !=ROLE_ATTRIB )return 0 ; --1.7.0.4
Quoted 5 lines
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.