patch-2.4.0-test8 linux/net/econet/af_econet.c
Next file: linux/net/ipv4/igmp.c
Previous file: linux/net/decnet/af_decnet.c
Back to the patch index
Back to the overall index
- Lines: 33
- Date:
Mon Aug 28 21:16:05 2000
- Orig file:
v2.4.0-test7/linux/net/econet/af_econet.c
- Orig date:
Thu Jul 27 17:38:02 2000
diff -u --recursive --new-file v2.4.0-test7/linux/net/econet/af_econet.c linux/net/econet/af_econet.c
@@ -641,17 +641,15 @@
static int econet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{
struct sock *sk = sock->sk;
- int err;
int pid;
switch(cmd)
{
case FIOSETOWN:
case SIOCSPGRP:
- err = get_user(pid, (int *) arg);
- if (err)
- return err;
- if (current->pid != pid && current->pgrp != -pid && !suser())
+ if (get_user(pid, (int *) arg))
+ return -EFAULT;
+ if (current->pid != pid && current->pgrp != -pid && !capable(CAP_NET_ADMIN))
return -EPERM;
sk->proc = pid;
return(0);
@@ -661,10 +659,7 @@
case SIOCGSTAMP:
if(sk->stamp.tv_sec==0)
return -ENOENT;
- err = -EFAULT;
- if (!copy_to_user((void *)arg, &sk->stamp, sizeof(struct timeval)))
- err = 0;
- return err;
+ return copy_to_user((void *)arg, &sk->stamp, sizeof(struct timeval)) ? -EFAULT : 0;
case SIOCGIFFLAGS:
case SIOCSIFFLAGS:
case SIOCGIFCONF:
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)