Skip to content
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

Include LDAP groups in local spawner gids #4628

Merged
merged 2 commits into from
Nov 10, 2023
Merged

Conversation

uellue
Copy link
Contributor

@uellue uellue commented Nov 8, 2023

The original code only returns local groups, at least with a Kerberos and LDAP setup with CentOS 7. The new code matches what id returns on that system.

Quick test script:

import os
import grp
import pwd

username = "weber"
user =  pwd.getpwnam(username)
gid = user.pw_gid
old_gids = [g.gr_gid for g in grp.getgrall() if username in g.gr_mem]
new_gids = os.getgrouplist(username, gid)

print("old", old_gids)
print("new", new_gids)
(jupyterhub311) [weber@iff588 ~]$ id
uid=20335(weber) gid=68100(erc-1) groups=68100(erc-1),680(iff_ms),975(docker),1020(iff),68000(pgi-5)
(jupyterhub311) [weber@iff588 ~]$ python3 grouplist.py
old [975]
new [68100, 975, 68000, 1020, 680]

The original code only returned local groups, at least with a Kerberos and LDAP
setup with CentOS 7.
Copy link

welcome bot commented Nov 8, 2023

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@minrk minrk changed the title Include LDAP groups in spawner Include LDAP groups in local spawner gids Nov 10, 2023
@minrk minrk merged commit 46a1e2b into jupyterhub:main Nov 10, 2023
18 checks passed
Copy link

welcome bot commented Nov 10, 2023

Congrats on your first merged pull request in this project! 🎉
congrats
Thank you for contributing, we are very proud of you! ❤️

@minrk
Copy link
Member

minrk commented Nov 10, 2023

Nice, thanks!

@minrk
Copy link
Member

minrk commented Mar 19, 2024

@meeseeksdev please backport to 4.x

meeseeksmachine pushed a commit to meeseeksmachine/jupyterhub that referenced this pull request Mar 19, 2024
minrk added a commit that referenced this pull request Mar 19, 2024
…8-on-4.x

Backport PR #4628 on branch 4.x (Include LDAP groups in local spawner gids)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants