Project

General

Profile

Feature #7024

Add getgrouplist() to illumos

Added by Aurélien Larcher over 4 years ago. Updated 3 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2016-05-31
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

A number of opensource software uses getgrouplist() but it is not part of illumos.
Several BSD implementations are used for patching software and actually an implementation already exists in illumos-gate:

https://github.com/illumos/illumos-gate/blob/master/usr/src/cmd/ssh/libopenbsd-compat/common/getgrouplist.c

This function was added in Solaris 11.2 SRU 11.2.10.5.0.


Files

group.c (1.46 KB) group.c Test program Jason King, 2020-11-24 01:26 AM
#1

Updated by Robert Mustacchi over 4 years ago

It looks like this can be a small wrapper around the private function _getgroupsbymember(). It shouldn't be too bad to add. If I were able to put together a prototype, would you be able to test it with a bunch of third-party software?

#2

Updated by Aurélien Larcher over 4 years ago

Hi Robert,
this would be just fine and I can try your prototype on the software for which I encountered the issue.
Kind regards,

Aurélien

#3

Updated by Aurélien Larcher almost 4 years ago

Hi Robert,
I just ran today into the same issue with the OAR resource manager.
Just updating the ticket activity to keep the issue under radar.
Kind regards

Auréien

#4

Updated by Electric Monk 3 days ago

  • Gerrit CR set to 1074
#5

Updated by Jason King 3 days ago

  • Gerrit CR deleted (1074)

I've put together an implementation of this.

For testing, I created a test user and added the test user to the system. I then ran a simple test program that would invoke getgrouplist:

root@pi:~# ./group test 5
ngroups_max = 16
getgrouplist returned -1 (ngids = 16)
getgrouplist returned 16
test: test(1000), test2(1002), test3(1003), test5(1004), test6(1006), test7(1007), test8(1008), test9(1009), test10(1010), test11(1011), test12(1012), test13(1013), test14(1014), test15(1015), test16(1016), test17(1017)
getgrouplist returned 16 (ngids = 16)
root@pi:~# ./group test 16
ngroups_max = 16
getgrouplist returned 16
test: test(1000), test2(1002), test3(1003), test5(1004), test6(1006), test7(1007), test8(1008), test9(1009), test10(1010), test11(1011), test12(1012), test13(1013), test14(1014), test15(1015), test16(1016), test17(1017)
getgrouplist returned 16 (ngids = 16)
#6

Updated by Jason King 3 days ago

Also available in: Atom PDF