git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CRED: Wrap current->cred and a few other accessors
[pandora-kernel.git]
/
drivers
/
net
/
tun.c
diff --git
a/drivers/net/tun.c
b/drivers/net/tun.c
index
6daea0c
..
55dc70c
100644
(file)
--- a/
drivers/net/tun.c
+++ b/
drivers/net/tun.c
@@
-702,6
+702,7
@@
static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
struct tun_net *tn;
struct tun_struct *tun;
struct net_device *dev;
struct tun_net *tn;
struct tun_struct *tun;
struct net_device *dev;
+ const struct cred *cred = current_cred();
int err;
tn = net_generic(net, tun_net_id);
int err;
tn = net_generic(net, tun_net_id);
@@
-712,11
+713,12
@@
static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
/* Check permissions */
if (((tun->owner != -1 &&
/* Check permissions */
if (((tun->owner != -1 &&
- c
urrent
->euid != tun->owner) ||
+ c
red
->euid != tun->owner) ||
(tun->group != -1 &&
(tun->group != -1 &&
- c
urrent
->egid != tun->group)) &&
- !capable(CAP_NET_ADMIN))
+ c
red
->egid != tun->group)) &&
+ !capable(CAP_NET_ADMIN)) {
return -EPERM;
return -EPERM;
+ }
}
else if (__dev_get_by_name(net, ifr->ifr_name))
return -EINVAL;
}
else if (__dev_get_by_name(net, ifr->ifr_name))
return -EINVAL;
@@
-1070,8
+1072,6
@@
static int tun_chr_close(struct inode *inode, struct file *file)
DBG(KERN_INFO "%s: tun_chr_close\n", tun->dev->name);
DBG(KERN_INFO "%s: tun_chr_close\n", tun->dev->name);
- tun_chr_fasync(-1, file, 0);
-
rtnl_lock();
/* Detach from net device */
rtnl_lock();
/* Detach from net device */