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
SELINUX: Use getseuserbyname to get IPA seuser #189
SELINUX: Use getseuserbyname to get IPA seuser #189
Conversation
|
Can one of the admins verify this patch? |
1 similar comment
|
Can one of the admins verify this patch? |
libsemanage API function semanage_seuser_query can fail in certain circumstances preventing user logins. The libselinux function getseuserbyname will be a more reliable method to retrieve SELinux usernames and is recommended by SELinux developers. Replace get_seuser function with getseuserbyname. Resolves: https://pagure.io/SSSD/sssd/issue/3308
cc5400e
to
503be66
Compare
|
ok to test |
|
@justin-stephenson are you able to reproduce bug with |
|
@lslebodn in my testing, the SELinux child process gets called twice during IPA client login. Before the patch the first call would error with similar After the patch, both calls are successful and the |
|
@justin-stephenson If you have a time could you test patch #165 with your use-case. |
|
@lslebodn I tested the patch in #165 and it successfully resolves the original sssd errors I could also modify this PR to not touch get_seuser() code and only call getseuserbyname() if get_seuser() fails. |
|
@lslebodn, @justin-stephenson: What's the state of this PR? Is this still valid? |
|
@fidencio I don't really know if this ticket is required anymore to be honest, it may not be required after https://pagure.io/SSSD/sssd/issue/3297 was fixed. I don't think any user is waiting for a fix, I will go ahead and close this PR and I will leave the decision to close upstream ticket 3308 to your team. |
|
Well, not so fast :) @mzidek-rh don't we want to use the libsemanage API anyway? Didn't this solve some real world bug? |
|
@jhrozek this patch replaces function from libsemanage with function from libselinux... The commit message says that libselinux is recommended over libsemanage by SELinux developers. If that is the case, I think it makes sense to use the preferred version. So I would not close this PR. Also this patch removes more code than it adds, which is welcomed. |
|
By the way in this issue: https://pagure.io/SSSD/sssd/issue/3308 it states that Petr Lautrbach recommended to use the libselinux function. I think that is reason enough to reopen this PR, even though it does not have high priority, because the more important selinux bug we had was resolved differently. (@justin-stephenson, you already deleted the branch so I can not reopen it, would you mind creating the branch again?) |
|
@mzidek-rh I pushed my local copy of the branch to my fork but a new PR was created(sorry for that). I rebased the patch and tested it again to be sure it still works. New PR is #342 |
Retrieve SELinux username utilizing libselinux API as a more reliable method than libsemanage calls and remove get_seuser function which is no longer needed.
Resolves:
https://pagure.io/SSSD/sssd/issue/3308
Tested on IPA client with:
semanage login -d testuser/var/log/sssd/selinux_child.log