-
Notifications
You must be signed in to change notification settings - Fork 247
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
GPO evaluation of primary group #7071
Conversation
src/providers/ad/ad_gpo.c
Outdated
SYSDB_PRIMARY_GROUP_GIDNUM, | ||
0); | ||
if (orig_gid != 0) { | ||
sss_idmap_unix_to_sid(idmap_ctx, orig_gid, &orig_gid_sid); |
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.
Hi,
please check return code of sss_idmap_unix_to_sid()
because it might return IDMAP_EXTERNAL
. In this case there is no id-mapping for the domain the orig_gid
is coming from but the values are stored in the group object. In this case you have to search the cache for the group with orig_gid
and take the SID from the cached group.
bye,
Sumit
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 explanation/hint, will do
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.
done
dccf804
to
d9365bc
Compare
src/providers/ad/ad_gpo.c
Outdated
return NULL; | ||
} | ||
|
||
sid = discard_const(ldb_msg_find_attr_as_string(msg, SYSDB_SID_STR, NULL)); |
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.
Hi,
I would prefer to avoid discard_const()
even if this would mean to declare another variable like e.g. const char *tmp;
.
bye,
Sumit
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.
done
d9365bc
to
c53e7a9
Compare
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.
Hi,
thanks for the update, works for me, ACK.
bye,
Sumit
To be rebased on the top of #7107 |
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.
Tested, working.
(2024-01-08 11:20:02): [be[domain-8l9d.com]] [ad_gpo_access_check] (0x0400): [RID#34] user_sid = S-1-5-21-1477186385-3752140279-2633954784-1122
(2024-01-08 11:20:02): [be[domain-8l9d.com]] [ad_gpo_access_check] (0x0400): [RID#34] group_sids[0] = S-1-5-21-1477186385-3752140279-2633954784-513
(2024-01-08 11:20:02): [be[domain-8l9d.com]] [ad_gpo_access_check] (0x0400): [RID#34] group_sids[1] = S-1-5-21-1477186385-3752140279-2633954784-1113
(2024-01-08 11:20:02): [be[domain-8l9d.com]] [ad_gpo_access_check] (0x0400): [RID#34] group_sids[2] = S-1-5-11
c53e7a9
to
b4794ed
Compare
@sumit-bose, @danlavu, please re-review after rebase. |
JFI, The rebase went smoothly, I had to add one more change when calling |
b4794ed
to
31bb4b9
Compare
When we are evaluating GPO the SID of user's primary group is not returned in the list. This patch converts the value of origPrimaryGroupGidNumber attribute back to SID and that SID is added to the list of SIDs before evaluating the GPO rules.
31bb4b9
to
8fa54e6
Compare
ret = ad_gpo_get_sids(tmp_ctx, host_fqdn, host_domain, idmap_ctx, &host_sid, | ||
&host_group_sids, &host_group_size); |
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.
@sumit-bose, @danlavu, This has been added since last review
Tested.
patched
Working as expected, approved. |
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.
Hi,
rebased and updated version still works for me, ACK.
bye,
Sumit
When we are evaluating GPO the SID of user's primary group is not returned in the list. This patch converts the value of origPrimaryGroupGidNumber attribute back to SID and that SID is added to the list of SIDs before evaluating the GPO rules.