diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1998-06-30 00:21:34 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1998-06-30 00:21:34 +0000 |
commit | 3917ac5846dd0f9ad1238166f90caab9912052e6 (patch) | |
tree | 1c298935def4f29edb39192365a65d73de999155 /net/core | |
parent | af2f803c8b2d469fe38e4a7ce952658dfcb6681a (diff) |
o Merge with Linux 2.1.100.
o Cleanup the machine dependencies of floppy and rtc. The driver for
the Dallas thingy in the Indy is still missing.
o Handle allocation of zero'd pages correct for R4000SC / R4400SC.
o Page colouring shit to match the virtual and physical colour of all
mapped pages. This tends to produce extreme fragmentation problems,
so it's deactivated for now. Users of R4000SC / R4400SC may re-enable
the code in arch/mips/mm/init.c by removing the definition of
CONF_GIVE_A_SHIT_ABOUT_COLOURS. Should get them somewhat further -
but don't shake to hard ...
o Fixed ptrace(2)-ing of syscalls, strace is now working again.
o Fix the interrupt forwarding from the keyboard driver to the psaux
driver, PS/2 mice are now working on the Indy. The fix is somewhat
broken as it prevents generic kernels for Indy and machines which handle
things different.
o Things I can't remember.
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 10 | ||||
-rw-r--r-- | net/core/scm.c | 17 | ||||
-rw-r--r-- | net/core/sock.c | 4 |
3 files changed, 17 insertions, 14 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 85312b12c..69315d948 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -321,7 +321,7 @@ struct device *dev_alloc(const char *name, int *err) void dev_load(const char *name) { - if(!dev_get(name) && suser()) + if(!dev_get(name) && capable(CAP_SYS_MODULE)) request_module(name); } @@ -1591,7 +1591,7 @@ int dev_ioctl(unsigned int cmd, void *arg) case SIOCDELMULTI: case SIOCSIFHWBROADCAST: case SIOCSIFTXQLEN: - if (!suser()) + if (!capable(CAP_NET_ADMIN)) return -EPERM; dev_load(ifr.ifr_name); rtnl_lock(); @@ -1764,6 +1764,9 @@ extern int baycom_init(void); extern int lapbeth_init(void); extern void arcnet_init(void); extern void ip_auto_config(void); +#ifdef CONFIG_8xx +extern int cpm_enet_init(void); +#endif /* CONFIG_8xx */ #ifdef CONFIG_PROC_FS static struct proc_dir_entry proc_net_dev = { @@ -1846,6 +1849,9 @@ __initfunc(int net_dev_init(void)) #if defined(CONFIG_ARCNET) arcnet_init(); #endif +#if defined(CONFIG_8xx) + cpm_enet_init(); +#endif /* * SLHC if present needs attaching so other people see it * even if not opened. diff --git a/net/core/scm.c b/net/core/scm.c index ac4aefda0..dd19cf5e0 100644 --- a/net/core/scm.c +++ b/net/core/scm.c @@ -45,19 +45,16 @@ static __inline__ int scm_check_creds(struct ucred *creds) { - /* N.B. The test for suser should follow the credential check */ - if (suser()) + if ((creds->pid == current->pid || capable(CAP_SYS_ADMIN)) && + ((creds->uid == current->uid || creds->uid == current->euid || + creds->uid == current->suid) || capable(CAP_SETUID)) && + ((creds->gid == current->gid || creds->gid == current->egid || + creds->gid == current->sgid) || capable(CAP_SETGID))) { return 0; - if (creds->pid != current->pid || - (creds->uid != current->uid && creds->uid != current->euid && - creds->uid != current->suid) || - (creds->gid != current->gid && creds->gid != current->egid && - creds->gid != current->sgid)) - return -EPERM; - return 0; + } + return -EPERM; } - static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp) { int *fdp = (int*)CMSG_DATA(cmsg); diff --git a/net/core/sock.c b/net/core/sock.c index 30e5d3e77..428b4052c 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -185,7 +185,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname, switch(optname) { case SO_DEBUG: - if(val && !suser()) + if(val && !capable(CAP_NET_ADMIN)) { ret = -EACCES; } @@ -924,7 +924,7 @@ int sock_no_fcntl(struct socket *sock, unsigned int cmd, unsigned long arg) */ if (current->pgrp != -arg && current->pid != arg && - !suser()) return(-EPERM); + !capable(CAP_NET_ADMIN)) return(-EPERM); sk->proc = arg; return(0); case F_GETOWN: |