[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

license request for mgetgroups

From: Eric Blake
Subject: license request for mgetgroups
Date: Wed, 22 May 2013 11:49:52 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6

I am trying to fix a bug in libvirt where a child process deadlocked
because it called initgroups() in between fork and exec when the parent
was multithreaded; it turns out that looking up group membership
information requires a mutex, but if some other thread in the parent
owns that mutex at the time of the fork, then the child will no longer
have that thread around to ever release the mutex.  The solution is to
not call initgroups, but to instead split the use of the underlying
pieces of what initgroups does - a call to getgrouplist prior to forking
(requires the mutex, but pre-fork is safe) and a call to setgroups after
forking (no lookup required, therefore no mutex involved and no deadlock
possible).  I ended up writing my own wrapper around getgrouplist, and
only then discovered that gnulib's mgetgroups module does a better job
at the task, except for one bit: mgetgroups is currently GPLv3 but
libvirt wants LGPLv2+.

Since getgrouplist is implemented in glibc as LGPLv2+, is there any
objection to relicensing the following modules as LGPLv2+?

For my argument on the xalloc-oversized module, observe that malloca.h
(part of the LGPLv2+ malloca module) has effectively inlined the
contents of lib/xalloc-oversized.h, so while the larger xalloc module
will never be LGPL (it calls exit), the mere use of checking for
oversized allocation has already been intentionally isolated for safe
use in LGPL code.

For my own contributions to these modules, I'm okay with relaxing to
LGPLv2+.  I've cc'd all other contributors as tracked by gnulib.git's
history (I'm not sure if coreutils.git would turn up any earlier authors
from before we promoted mgetgroups from coreutils to gnulib).  I did
track the history of xalloc-oversized changes further back from when the
macro was part of the larger xalloc.h (pre-split contributors marked in
'()').  Module maintainers are denoted with *.

getgroups [LGPLv3+] => *Jim, *Eric, Bruno, Paul
getugroups [GPLv3+] => *Jim, Eric, Paul, Bruno, Lasse
mgetgroups [GPLv3+] => *Jim, *Eric, Bruno
xalloc-oversized [GPLv3+] => [*all] Eric, Paul, Jim, (Bruno)

Also, I plan on submitting a doc patch on the gnulib initgroups.texi
page warning about the portability pitfall of trying to use it to change
the the id of a child process of a multithreaded parent.

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]