Bug 41458: Pass a valid GID to Net::Server for SIP
When starting SIP, Koha passes an incorrect value to the
Net::Server "group" parameter, which can generate an
error in the logs":
Couldn't become gid "<uid>": Operation not permitted
This change ensures that a valid numeric GID is passed instead.
Test plan:
1. Enter KTD shell.
2. To reproduce the error: sudo groupmod -g 8001 kohadev-koha
3. Restart SIP: sudo koha-sip --restart kohadev
4. Check SIP logs:
/var/log/koha/kohadev/sip-output.log
5. Observe the error:
Couldn't become gid "<uid>": Operation not permitted
6. Apply this patch.
7. Repeat steps 2 to 4.
8. Verify that the "Couldn't become gid" error is no longer logged.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b16ff5a8a0)
Signed-off-by: Chloé Zermatten <chloe.zermatten@openfifth.co.uk>
This commit is contained in:
parent
02e5298c6b
commit
93c2f7bd41
|
|
@ -87,7 +87,11 @@ if ( defined( $config->{'server-params'} ) ) {
|
|||
|
||||
# Add user and group to prevent warn from Net::Server.
|
||||
push @params, 'user=' . $>;
|
||||
push @params, 'group=' . $>;
|
||||
|
||||
# $) can contain supplementary groups like "1010 1010" -> Net::Server tries setgroups() and fails.
|
||||
my ($egid) = split /\s+/, $);
|
||||
$egid ||= $(; # fallback to real gid just in case
|
||||
push @params, 'group=' . $egid;
|
||||
|
||||
#
|
||||
# This is the main event.
|
||||
|
|
|
|||
Loading…
Reference in New Issue