X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=security%2Fkeys%2Fkey.c;h=0e2584e113082d0af7f2535e5da9c2c1c52ef2f0;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=b6061fa29da7fc7eb5278530ebb26769dc4ebcde;hpb=f7ed79d23a47594e7834d66a8f14449796d4f3e6;p=linux-2.6.git diff --git a/security/keys/key.c b/security/keys/key.c index b6061fa29..0e2584e11 100644 --- a/security/keys/key.c +++ b/security/keys/key.c @@ -1,6 +1,6 @@ /* key.c: basic authentication token and access key management * - * Copyright (C) 2004-6 Red Hat, Inc. All Rights Reserved. + * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) * * This program is free software; you can redistribute it and/or @@ -271,7 +271,7 @@ struct key *key_alloc(struct key_type *type, const char *desc, * its description */ if (!not_in_quota) { spin_lock(&user->lock); - if (user->qnkeys + 1 >= KEYQUOTA_MAX_KEYS || + if (user->qnkeys + 1 >= KEYQUOTA_MAX_KEYS && user->qnbytes + quotalen >= KEYQUOTA_MAX_BYTES ) goto no_quota; @@ -799,16 +799,12 @@ key_ref_t key_create_or_update(key_ref_t keyring_ref, goto error_3; } - /* if it's possible to update this type of key, search for an existing - * key of the same type and description in the destination keyring and - * update that instead if possible + /* search for an existing key of the same type and description in the + * destination keyring */ - if (ktype->update) { - key_ref = __keyring_search_one(keyring_ref, ktype, description, - 0); - if (!IS_ERR(key_ref)) - goto found_matching_key; - } + key_ref = __keyring_search_one(keyring_ref, ktype, description, 0); + if (!IS_ERR(key_ref)) + goto found_matching_key; /* decide on the permissions we want */ perm = KEY_POS_VIEW | KEY_POS_SEARCH | KEY_POS_LINK | KEY_POS_SETATTR;