diff options
author | David Howells <dhowells@redhat.com> | 2012-10-02 14:24:56 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2012-10-02 14:24:56 -0400 |
commit | f8aa23a55f813c9bddec2a6176e0e67274e6e7c1 (patch) | |
tree | 1b1927cedb4f1d769fac19242f3a365c84e40cec /net | |
parent | 96b5c8fea6c0861621051290d705ec2e971963f1 (diff) |
KEYS: Use keyring_alloc() to create special keyrings
Use keyring_alloc() to create special keyrings now that it has a permissions
parameter rather than using key_alloc() + key_instantiate_and_link().
Also document and export keyring_alloc() so that modules can use it too.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/dns_resolver/dns_key.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/net/dns_resolver/dns_key.c b/net/dns_resolver/dns_key.c index d9507dd05818..f2c379d835e3 100644 --- a/net/dns_resolver/dns_key.c +++ b/net/dns_resolver/dns_key.c | |||
@@ -259,19 +259,15 @@ static int __init init_dns_resolver(void) | |||
259 | if (!cred) | 259 | if (!cred) |
260 | return -ENOMEM; | 260 | return -ENOMEM; |
261 | 261 | ||
262 | keyring = key_alloc(&key_type_keyring, ".dns_resolver", 0, 0, cred, | 262 | keyring = keyring_alloc(".dns_resolver", 0, 0, cred, |
263 | (KEY_POS_ALL & ~KEY_POS_SETATTR) | | 263 | (KEY_POS_ALL & ~KEY_POS_SETATTR) | |
264 | KEY_USR_VIEW | KEY_USR_READ, | 264 | KEY_USR_VIEW | KEY_USR_READ, |
265 | KEY_ALLOC_NOT_IN_QUOTA); | 265 | KEY_ALLOC_NOT_IN_QUOTA, NULL); |
266 | if (IS_ERR(keyring)) { | 266 | if (IS_ERR(keyring)) { |
267 | ret = PTR_ERR(keyring); | 267 | ret = PTR_ERR(keyring); |
268 | goto failed_put_cred; | 268 | goto failed_put_cred; |
269 | } | 269 | } |
270 | 270 | ||
271 | ret = key_instantiate_and_link(keyring, NULL, 0, NULL, NULL); | ||
272 | if (ret < 0) | ||
273 | goto failed_put_key; | ||
274 | |||
275 | ret = register_key_type(&key_type_dns_resolver); | 271 | ret = register_key_type(&key_type_dns_resolver); |
276 | if (ret < 0) | 272 | if (ret < 0) |
277 | goto failed_put_key; | 273 | goto failed_put_key; |
@@ -303,3 +299,4 @@ static void __exit exit_dns_resolver(void) | |||
303 | module_init(init_dns_resolver) | 299 | module_init(init_dns_resolver) |
304 | module_exit(exit_dns_resolver) | 300 | module_exit(exit_dns_resolver) |
305 | MODULE_LICENSE("GPL"); | 301 | MODULE_LICENSE("GPL"); |
302 | |||