Daemon-Control icon indicating copy to clipboard operation
Daemon-Control copied to clipboard

Set supplementary groups for target user

Open dev97 opened this issue 11 years ago • 0 comments

Please test and accept my patch for setting supplementary groups.

I'm sorry for missing documentation (with my English it would be easier to write it from scratch) and I'm sorry for missing formal tests (I afraid tests would be much more complex than code, mock-ups for getpwuid, getgrent would be needed and code would look uglier if to wrap $) access to a hook method, which is to be overridden by the testsuite).

I have tested it on my workstation (1. test without root permissions, 2. test with user with many groups, 3. test with user without supplementary groups) and on server as init.d script for real application.

I have also tested the case where 'uid' is specified without 'group' or 'gid' and there is no entry for such 'uid' in /etc/passwd. In this case 'gid' and supplementary groups remain intact. Probably it would be better to die in such case.

dev97 avatar Mar 18 '14 18:03 dev97