summaryrefslogtreecommitdiffstats
path: root/ncr-key.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-06-16 22:57:16 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-06-17 20:49:05 +0200
commit6b060c1dc5486cbf51f13d168c442e7df116b26c (patch)
tree45ab36ae9f4a405c22dc082b226c361e886fe726 /ncr-key.c
parent5797051e8b1f3ac4d6cc5edf181a04536b496d3d (diff)
downloadcryptodev-linux-6b060c1dc5486cbf51f13d168c442e7df116b26c.tar.gz
cryptodev-linux-6b060c1dc5486cbf51f13d168c442e7df116b26c.tar.xz
cryptodev-linux-6b060c1dc5486cbf51f13d168c442e7df116b26c.zip
Use current_euid() and task_pid_nr(current) to get identifiers for owners (for imposed limits).
Diffstat (limited to 'ncr-key.c')
-rw-r--r--ncr-key.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ncr-key.c b/ncr-key.c
index fd5b489..339ce0c 100644
--- a/ncr-key.c
+++ b/ncr-key.c
@@ -81,18 +81,18 @@ struct key_item_st* item;
void _ncr_key_item_put( struct key_item_st* item)
{
if (atomic_dec_and_test(&item->refcnt)) {
- ncr_limits_remove(item->filp, LIMIT_TYPE_KEY);
+ ncr_limits_remove(item->uid, item->pid, LIMIT_TYPE_KEY);
kfree(item);
}
}
-int ncr_key_init(struct file *filp, struct list_sem_st* lst, void __user* arg)
+int ncr_key_init(struct list_sem_st* lst, void __user* arg)
{
ncr_key_t desc;
struct key_item_st* key;
int ret;
- ret = ncr_limits_add_and_check(filp, LIMIT_TYPE_KEY);
+ ret = ncr_limits_add_and_check(current_euid(), task_pid_nr(current), LIMIT_TYPE_KEY);
if (ret < 0) {
err();
return ret;
@@ -113,7 +113,8 @@ int ncr_key_init(struct file *filp, struct list_sem_st* lst, void __user* arg)
down(&lst->sem);
key->desc = _ncr_key_get_new_desc(lst);
- key->filp = filp;
+ key->uid = current_euid();
+ key->pid = task_pid_nr(current);
list_add(&key->list, &lst->list);