-
Notifications
You must be signed in to change notification settings - Fork 333
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
ipa_sam: remove dependency to sid_string_talloc() and sid_string_dbg() #2943
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch, @mastersin. I have a few comments and also please rebase on top of #2926.
daemons/ipa-sam/ipa_sam.c
Outdated
| @@ -100,12 +101,15 @@ struct unixid { | |||
| enum id_type type; | |||
| }/* [public] */; | |||
|
|
|||
| /* from samba/libcli/security/dom_sid.h */ | |||
| #define MAX(a,b) ((a)>(b)?(a):(b)) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can get MAX from #include <sys/param.h>.
daemons/ipa-sam/ipa_sam.c
Outdated
| @@ -283,6 +287,62 @@ static bool is_null_sid(const struct dom_sid *sid) | |||
| return true; | |||
| } | |||
|
|
|||
| static int dom_sid_string_buf(const struct dom_sid *sid, char *buf, int buflen) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename to _domain_sid_string_buf to avoid possible conflicts when loading in the same process.
daemons/ipa-sam/ipa_sam.c
Outdated
| return ofs; | ||
| } | ||
|
|
||
| static char *dom_sid_str_buf(const struct dom_sid *sid, struct dom_sid_buf *dst) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, please rename to _domain_sid_str_buf
|
Actually, I have a better idea. We are linking anyway to SSSD's |
0cdeca2
to
e16bc89
Compare
|
Fix and rebase current variant. Thinks about better idea as next step. |
080b49f
to
284d380
Compare
ipa_sam uses Samba's sid to string construction functions. Recent Samba versions removed this functions from libsmbconf.so and replace new functions to internal libsamba-security-samba4.so Thus, we reimplement new style function dom_sid_str_buf() from Samba-4.10. Resolves: https://pagure.io/freeipa/issue/7893
|
@mastersin let me know if you are able to work on the proposed approach. If not, I'll do it myself next week. |
|
@abbra I try it and understand, that I don't know enough clearly how works talloc contexts in this code, and also I don't have time to debug it yet. I afraid that I may add memory leaks in proposed approach. |
|
@mastersin I submitted #2966 that should solve the issue and obsoletes this PR. Please review. |
|
PR #2966 with an alternative fix has landed. |
|
Thanks for your patch any way! 🥇 |
ipa_sam uses Samba's sid to string construction functions. Recent Samba
versions removed this functions from libsmbconf.so and replace new functions
to internal libsamba-security-samba4.so
Thus, we reimplement new style function dom_sid_str_buf() from Samba-4.10.
Resolves: https://pagure.io/freeipa/issue/7893