[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Supplementary groups

Andrew Walrond

11/20/2003 12:18:00 AM

Is there a function for setting supllementary groups? I don't see a method
documented in Process.

I want the equivalent of man (2) setgroups:

- Function: int setgroups (size_t COUNT, gid_t *GROUPS)
This function sets the process's supplementary group IDs. It can
only be called from privileged processes. The COUNT argument
specifies the number of group IDs in the array GROUPS.


1 Answer

Lyle Johnson

11/20/2003 3:00:00 AM

0

Andrew Walrond wrote:

> Is there a function for setting supllementary groups? I don't see a method
> documented in Process.
>
> I want the equivalent of man (2) setgroups:
>
> - Function: int setgroups (size_t COUNT, gid_t *GROUPS)
> This function sets the process's supplementary group IDs. It can
> only be called from privileged processes. The COUNT argument
> specifies the number of group IDs in the array GROUPS.

Don't believe it was there for Ruby 1.6, but in Ruby 1.8 it's just:

Process.groups = [gid1, gid2, ...]

where the gidx values are either group numbers or names.

Hope this helps,

Lyle