[PATCH 4/5] AF_RXRPC: Key facility changes for AF_RXRPC [try #2]

2007-03-16 Thread David Howells
Export the keyring key type definition.

Add extra alternative types into the key's type_data union to make it more
useful.

Signed-Off-By: David Howells [EMAIL PROTECTED]
---

 include/linux/key.h |2 ++
 security/keys/keyring.c |2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/linux/key.h b/include/linux/key.h
index 169f05e..a9220e7 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -160,6 +160,8 @@ struct key {
 */
union {
struct list_headlink;
+   unsigned long   x[2];
+   void*p[2];
} type_data;
 
/* key data
diff --git a/security/keys/keyring.c b/security/keys/keyring.c
index ad45ce7..88292e3 100644
--- a/security/keys/keyring.c
+++ b/security/keys/keyring.c
@@ -66,6 +66,8 @@ struct key_type key_type_keyring = {
.read   = keyring_read,
 };
 
+EXPORT_SYMBOL(key_type_keyring);
+
 /*
  * semaphore to serialise link/link calls to prevent two link calls in parallel
  * introducing a cycle

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/5] AF_RXRPC: Key facility changes for AF_RXRPC [try #2]

2007-03-16 Thread Christoph Hellwig
On Fri, Mar 16, 2007 at 12:50:31PM +, David Howells wrote:
 Export the keyring key type definition.
 
 Add extra alternative types into the key's type_data union to make it more
 useful.

You wrote the code so there must be some reason for this, but these
changes look rather odd to me :)

 diff --git a/security/keys/keyring.c b/security/keys/keyring.c
 index ad45ce7..88292e3 100644
 --- a/security/keys/keyring.c
 +++ b/security/keys/keyring.c
 @@ -66,6 +66,8 @@ struct key_type key_type_keyring = {
   .read   = keyring_read,
  };
  
 +EXPORT_SYMBOL(key_type_keyring);
 +

Having a type exported is really odd, how is this supposed to be a public API?
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/5] AF_RXRPC: Key facility changes for AF_RXRPC [try #2]

2007-03-16 Thread David Howells
Christoph Hellwig [EMAIL PROTECTED] wrote:

 You wrote the code so there must be some reason for this, but these
 changes look rather odd to me :)

The union is for use by the type in any way it sees fit, but it may not want to
use it as a list_head.  So all I've done is to make it available as a pair of
arbitrary pointers or a pair of arbitrary numbers.

Maybe a better way would be to have an overlay struct that's private to the
type, sort of how sk_buff::cb works.

 Having a type exported is really odd, how is this supposed to be a public API?

Keyrings are a special type.

It occurred to me whilst doing this that the best way to achieve what I wanted
was by dealing with rings of keys.  What I needed was for the server app to
give the kernel a key for each security type it wanted to support, which the
kernel would then have to retain.  It seems natural to use a keyring to do the
retension as that's its purpose.

Another way to look at it is that in the client I need just one key at once,
and I can get that from the process as it's setting up the connection.
However, in the server I need to have several keys, and I need them available
up front because the server app doesn't set up a connection, the kernel does,
and it needs the keys immediately.

I'll add a mention to Documentation/keys.txt to record this exportation.

David
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/5] AF_RXRPC: Key facility changes for AF_RXRPC

2007-03-08 Thread David Howells
Export the keyring key type definition.

Add extra alternative types into the key's type_data union to make it more
useful.

Signed-Off-By: David Howells [EMAIL PROTECTED]
---

 include/linux/key.h |2 ++
 security/keys/keyring.c |2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/linux/key.h b/include/linux/key.h
index 169f05e..a9220e7 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -160,6 +160,8 @@ struct key {
 */
union {
struct list_headlink;
+   unsigned long   x[2];
+   void*p[2];
} type_data;
 
/* key data
diff --git a/security/keys/keyring.c b/security/keys/keyring.c
index ad45ce7..88292e3 100644
--- a/security/keys/keyring.c
+++ b/security/keys/keyring.c
@@ -66,6 +66,8 @@ struct key_type key_type_keyring = {
.read   = keyring_read,
 };
 
+EXPORT_SYMBOL(key_type_keyring);
+
 /*
  * semaphore to serialise link/link calls to prevent two link calls in parallel
  * introducing a cycle

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html