Linux: Restore aklog -setpag functionality for kernel 2.6.32+
authorMarc Dionne <marc.c.dionne@gmail.com>
Mon, 14 Sep 2009 21:40:23 +0000 (17:40 -0400)
committerDerrick Brashear <shadow|account-1000005@unknown>
Sat, 19 Sep 2009 12:15:31 +0000 (05:15 -0700)
commit48589b5d3957c27a5944e23fd770687adc078934
treee67ebf11ad87b546d0c7d8afaa3a4991af1a1a30
parent1ea845ebc953bb49afc354afe036f7f01cd05db8
Linux: Restore aklog -setpag functionality for kernel 2.6.32+

With kernel 2.6.32 it is now possible for a process to copy its session
keyring to its parent through the use of the KEYCTL_SESSION_TO_PARENT
function of the keyctl syscall.

We can't use this easily from kernel space to cover all calls to
VIOCSETTOK with the setpag flag - we'd need to make a syscall
or have keyctl exported.  Instead, a hook is added to ktc_SetToken to
make it honour the AFS_SETTOK_SETPAG flag, which was ineffective with recent
kernels.
This should cover the most common cases (ex: aklog) where this is needed.

The syscall is coded directly to avoid introducing a dependency on the
keyutils library or header files which may not be installed everywhere.

Reviewed-on: http://gerrit.openafs.org/463
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
acinclude.m4
src/auth/ktc.c
src/cf/linux-test4.m4