[OpenAFS] unpagsh fails with recent glibc
Jeffrey Hutzelman
jhutz@cmu.edu
Tue, 08 Mar 2005 11:01:35 -0500
On Tuesday, March 08, 2005 09:31:16 +0000 Dr A V Le Blanc
<LeBlanc@mcc.ac.uk> wrote:
> I wrote:
>> Some while ago someone -- probably Jeffrey Hutzelman -- published
>> here a program called 'unpagsh', which deletes AFS PAG groups
>> from a process or its children, and which has been very useful for
>> starting daemons without giving them a PAG. Unfortunately the
>> program, which worked well with glibc-2.2.5, is failing when it is
>> run on a machine with glibc-2.3.2:
>>
>> # unpagsh
>> getgroups: Invalid argument
>>
>> Has anyone patched this to work with later versions of glibc?
>
> Further to this, I can confirm that it's actually the kernel which
> is the problem, not the C library; unpagsh on the same machine works
> with the 2.4.29 kernel, but not with the 2.6.11 kernel.
That's not surprising. unpagsh is not my code, but I did take a quick look
at it when you posted your first message. It works by overflowing the
fixed-size group list maintained by the kernel with "real" groups, leaving
no room for the groups added by AFS to represent the PAG. In Linux 2.6,
the list of groups associated with a process is not a fixed-size array; it
is dynamic, and our setgroups wrapper always grows the list to make room
for the PAG groups. So you can't get rid of them by overflowing the array.
Making this work would require a change to the OpenAFS kernel code.
-- Jeff