[OpenAFS-devel] 1.4.2rc1 fails on RHEL4 2.6.9 kernel: missing keyring defines?

Derek Atkins warlord@MIT.EDU
Thu, 24 Aug 2006 10:32:37 -0400


"chas williams - CONTRACTOR" <chas@cmf.nrl.navy.mil> writes:

> In message <sjmlkpemfge.fsf@cliodev.pgp.com>,Derek Atkins writes:
>>Indeed, KEY_POS_* isn't defined ANYWHERE in the kernel headers, so
>>I think the configure test didn't work properly when it detected
>>keyring support.
>>
>>Any suggestions for what I should look for or how to correct this?
>
> you could change the configure test and stick a KEY_POS_VIEW in the
> key_alloc() instead of just a 0.
>
> rhel4 is a common enough case though that i guess i would like this
> to work.  i am not familiar with the 2.6.9-RHEL keyring version so
> i dont know if the behavior will be right, but you could try:

Actually, I just looked more closely at this patch -- I have no way to
test that it works because I'm not running the kernel that has this
weird case.  Yes, it will get the code to compile, but will
it do the right thing?  I mean, if it's safe to use '0' instead
of "KEY_POS_VIEW | KEY_POS_SEARCH" then why not just use '0' all
the time?

If we really need KEY_POS_* then actually we should fail the keyring
test itself, not the key_alloc test.  I.e., we should fail the test
where we look for keyctl() and request_key().  A simple:

#if !defined(KEY_POS_VIEW) || !defined(KEY_POS_SEARCH)
#error "Your version of keyring support does not have KEY_POS_"
#endif

will cause the test the fail...

Which is the preferred method?

-derek
-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available