possible regression in "semanage user"
Hi list,
we have a report about a possible regression in "semanage user" and I'd like to hear your opinion on what the correct behaviour should be.
Given that local changes have been made to a SELinux user definition (originally defined in policy) e.g. # semanage user -m staff_u -r "s0"
and the SELinux user is mapped to some Linux user
# semanage login -a -s staff_u staff both # semanage user -d staff_u and # semanage user --deleteall will fail to remove the local change with the following message: "libsemanage.lookup_seuser: staff_u is being used by staff login record (Invalid argument)."
Is this the intended behaviour?
I would assume that this error message was intended only for locally defined SELinux users (in which case "semanage user -d selinux_user" would remove the only definition of "selinux_user"). If so, is there any way to determine if a SELinux user has been defined only locally (as opposed to being defined in policy) after some local changes have been made?
Best regards,
Vit Mojzis
Quoted 21 lines · Vit Mojzis
Hi list,
we have a report about a possible regression in "semanage user" and I'd
like to hear your opinion on what the correct behaviour should be.Given that local changes have been made to a SELinux user definition (originally defined in policy)
e.g. # semanage user -mstaff_u-r "s0"
and the SELinux user is mapped to some Linux user# semanage login -a -s staff_u staff both # semanage user -d staff_u and # semanage user --deleteall will fail to remove the local change with the following message: "libsemanage.lookup_seuser: staff_u is being used by staff login record (Invalid argument)."Is this the intended behaviour?
Quoted 7 lines
I would assume that this error message was intended only for locally defined SELinux users (in which case "semanage user -d
selinux_user" would remove the only definition of "selinux_user"). If so, is there any
way to determine if a SELinux user has been defined only locally (as opposed to being defined in policy) after some local changes have been made?
This appears to work correctly for me with release 20161014 (2.6); the two delete commands you specified above succeeded and the entry was removed. What version are you using?
Quoted 36 lines · Stephen Smalley
Quoted 23 lines · Vit Mojzis
Hi list,
we have a report about a possible regression in "semanage user" and I'd
like to hear your opinion on what the correct behaviour should be.Given that local changes have been made to a SELinux user definition
(originally defined in policy)
e.g. # semanage user -mstaff_u-r "s0"
and the SELinux user is mapped to some Linux user# semanage login -a -s staff_u staff both # semanage user -d staff_u and # semanage user --deleteall will fail to remove the local change with the following message: "libsemanage.lookup_seuser: staff_u is being used by staff login record (Invalid argument)."Is this the intended behaviour?
Quoted 11 lines
I would assume that this error message was intended only for locally
defined SELinux users (in which case "semanage user -dselinux_user"
would remove the only definition of "selinux_user"). If so, is there
any
way to determine if a SELinux user has been defined only locally (as
opposed to being defined in policy) after some local changes have been made?
Quoted 4 lines
This appears to work correctly for me with release 20161014 (2.6); the
two delete commands you specified above succeeded and the entry was removed. What version are you using?
Never mind, my mistake. I can reproduce it.
Quoted 21 lines · Vit Mojzis
Hi list,
we have a report about a possible regression in "semanage user" and I'd
like to hear your opinion on what the correct behaviour should be.Given that local changes have been made to a SELinux user definition (originally defined in policy)
e.g. # semanage user -mstaff_u-r "s0"
and the SELinux user is mapped to some Linux user# semanage login -a -s staff_u staff both # semanage user -d staff_u and # semanage user --deleteall will fail to remove the local change with the following message: "libsemanage.lookup_seuser: staff_u is being used by staff login record (Invalid argument)."Is this the intended behaviour?
Quoted 7 lines
I would assume that this error message was intended only for locally defined SELinux users (in which case "semanage user -d
selinux_user" would remove the only definition of "selinux_user"). If so, is there any
way to determine if a SELinux user has been defined only locally (as opposed to being defined in policy) after some local changes have been made?
Looks like this change came in via commit 56d9d20a647a52146494f0aef4494cafe328dc5d from Dan Walsh (in 2013). I agree it doesn't make sense for policy-defined users. Offhand, I don't see a clean interface for doing what you want; I'm wondering if we truly need this check at all.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 46 lines · Vit Mojzis
Quoted 38 lines · Stephen Smalley
Quoted 25 lines · Vit Mojzis
Hi list,
we have a report about a possible regression in "semanage user" and
I'd
like to hear your opinion on what the correct behaviour should be.Given that local changes have been made to a SELinux user definition
(originally defined in policy)
e.g. # semanage user -mstaff_u-r "s0"
and the SELinux user is mapped to some Linux user# semanage login -a -s staff_u staff both # semanage user -d staff_u and # semanage user --deleteall will fail to remove the local change with the following message: "libsemanage.lookup_seuser: staff_u is being used by staff login record (Invalid argument)."Is this the intended behaviour?
Quoted 11 lines
I would assume that this error message was intended only for locally
defined SELinux users (in which case "semanage user -dselinux_user"
would remove the only definition of "selinux_user"). If so, is there
any
way to determine if a SELinux user has been defined only locally (as
opposed to being defined in policy) after some local changes have been made?Quoted 6 lines
Looks like this change came in via commit
56d9d20a647a52146494f0aef4494cafe328dc5dfrom Dan Walsh (in 2013). I agree it doesn't make sense for policy-defined users. Offhand, I don't see a clean interface for doing what you want; I'm wondering if
we truly need this check at all.
Quoted 5 lines
We do, I just tried defining new local SELinux user, assigned it to Linux user and then removed it (after removing the check). You can actually even log in to the account with invalid SELinux user, but "semanage login" and "semanage user" stop working (errors regarding non-existent user).
(restored list and cc)
I don't see any easy way to fix. Obviously they could remove the login entry first and then the user, then re-add the login entry, but that's certainly sub-optimal. Is this truly a regression though?
Hi,
Quoted 53 lines · Stephen Smalley
Quoted 46 lines · Vit Mojzis
Quoted 38 lines · Stephen Smalley
Quoted 25 lines · Vit Mojzis
Hi list,
we have a report about a possible regression in "semanage user" and
I'd
like to hear your opinion on what the correct behaviour should be.Given that local changes have been made to a SELinux user definition
(originally defined in policy)
e.g. # semanage user -mstaff_u-r "s0"
and the SELinux user is mapped to some Linux user# semanage login -a -s staff_u staff both # semanage user -d staff_u and # semanage user --deleteall will fail to remove the local change with the following message: "libsemanage.lookup_seuser: staff_u is being used by staff login record (Invalid argument)."Is this the intended behaviour?
Quoted 11 lines
I would assume that this error message was intended only for locally
defined SELinux users (in which case "semanage user -dselinux_user"
would remove the only definition of "selinux_user"). If so, is there
any
way to determine if a SELinux user has been defined only locally (as
opposed to being defined in policy) after some local changes have been made?Quoted 6 lines
Looks like this change came in via commit
56d9d20a647a52146494f0aef4494cafe328dc5dfrom Dan Walsh (in 2013). I agree it doesn't make sense for policy-defined users. Offhand, I don't see a clean interface for doing what you want; I'm wondering if
we truly need this check at all.Quoted 5 lines
We do, I just tried defining new local SELinux user, assigned it to Linux user and then removed it (after removing the check). You can actually even log in to the account with invalid SELinux user, but "semanage login" and "semanage user" stop working (errors regarding non-existent user).
Quoted 5 lines
(restored list and cc)
I don't see any easy way to fix. Obviously they could remove the login entry first and then the user, then re-add the login entry, but that's certainly sub-optimal.
That is actually how we currently workaround this, so if semanage could do this, it would help.
Quoted 1 line
Is this truly a regression though?
That is a good question. I do not mind keeping the current functionality, which from a point of view, makes sense. But we should document this properly in the man page.
Best regards,
/M
Quoted 8 lines
_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected]. To get help, send an email containing "help" to [email protected].
Signature · 5 lines
Miroslav Vadkerti :: Senior QE / RHCSS :: BaseOS QE Security IRC mvadkert #qe #urt #brno #rpmdiff :: GPG 0x25881087 Desk Phone +420 532 294 129 <+420%20532%20294%20129> :: Mobile +420 773 944 252 <+420%20773%20944%20252> Red Hat Czech s.r.o, Purkyňova 99/71, 612 00, Brno, CR