summaryrefslogtreecommitdiffstats
path: root/cryptodev_main.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-05-27 12:32:28 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-06-17 20:47:37 +0200
commit02eb90375d9975252647ac285d0ba9fa61435640 (patch)
treeb15be668291bc941e56cebba0baf591372569921 /cryptodev_main.c
parent71eb8aa3b9c05b5ab8b8ab9cc0e245349dc2402d (diff)
downloadcryptodev-linux-02eb90375d9975252647ac285d0ba9fa61435640.tar.gz
cryptodev-linux-02eb90375d9975252647ac285d0ba9fa61435640.tar.xz
cryptodev-linux-02eb90375d9975252647ac285d0ba9fa61435640.zip
Added data functionality and a test program.
Diffstat (limited to 'cryptodev_main.c')
-rw-r--r--cryptodev_main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/cryptodev_main.c b/cryptodev_main.c
index 09aa5bf..fabda2e 100644
--- a/cryptodev_main.c
+++ b/cryptodev_main.c
@@ -40,6 +40,7 @@
#include <linux/scatterlist.h>
#include "cryptodev_int.h"
#include "ncr_int.h"
+#include <linux/version.h>
MODULE_AUTHOR("Nikos Mavrogiannopoulos <nmav@gnutls.org>");
MODULE_DESCRIPTION("CryptoDev driver");
@@ -561,6 +562,13 @@ cryptodev_ioctl(struct inode *inode, struct file *filp,
struct fcrypt * fcr;
uint32_t ses;
int ret, fd;
+ unsigned int uid;
+
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,27)
+ uid = filp->f_uid;
+#else
+ uid = filp->f_cred->fsuid;
+#endif
if (unlikely(!pcr))
BUG();
@@ -596,7 +604,7 @@ cryptodev_ioctl(struct inode *inode, struct file *filp,
return copy_to_user((void*)arg, &cop, sizeof(cop));
default:
- return ncr_ioctl(filp->f_cred->fsuid, pcr->ncr, cmd, arg);
+ return ncr_ioctl(uid, pcr->ncr, cmd, arg);
}
}