-
Notifications
You must be signed in to change notification settings - Fork 18k
os/user: add LookupGroup and LookupGroupId #2617
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
Comments
The os/user package has a complex conditional Makefile. include ../../../Make.inc TARG=os/user GOFILES=\ user.go\ ifeq ($(CGO_ENABLED),1) CGOFILES_linux=\ lookup_unix.go CGOFILES_freebsd=\ lookup_unix.go CGOFILES_darwin=\ lookup_unix.go endif ifneq ($(CGOFILES_$(GOOS)),) CGOFILES+=$(CGOFILES_$(GOOS)) else GOFILES+=lookup_stubs.go endif include ../../../Make.pkg |
By analogy with LookupUser, LookupGroup should return information about a specific group by name. There should probably be a Group type, with the group name, group ID, and a user list. LookupGroupId would take a group ID and return the group information. We should also have a function to return the list of groups for a user. This would have to work for Windows also. I have no idea what groups look like on Windows. |
CL at https://golang.org/cl/4589049/ but for after Go 1.1. |
Since the issue(golang/go#2617) of golang, we may not support to set the file's group
Is there still interest in adding this? I was surprised to find it missing. I could try writing it. |
It's mostly written already; I'm not sure why it never made it in. See the CLs linked above. |
@zombiezen, do you want to usher it through? |
I'll take a look tomorrow. I'll reach out to the CL author for permission On Tue, Jan 19, 2016 at 9:53 PM Brad Fitzpatrick notifications@github.com
|
That'll save me trying to consolidate the ~20 scattered copies of @andrenth's code down to one stable dependency, @zombiezen. All luck to you. |
I have the CL mostly ready, but when I go to test locally, the size of the group is too large in memory. Turns out that |
CL https://golang.org/cl/19235 mentions this issue. |
Has this been implemented? I don't see it in the doc for os/user |
@cgkades it will be in 1.7, which is not yet released. You can see the upcoming docs here: |
The text was updated successfully, but these errors were encountered: