Use privilege PRIV_NET_ADDIFADDR rather than suser() to authorize
adding a netatalk address to an interface.
This commit is contained in:
parent
d298e8c0c2
commit
f191f06add
@ -31,6 +31,7 @@
|
||||
#include <sys/sockio.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/priv.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#include <net/route.h>
|
||||
@ -121,7 +122,7 @@ at_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
|
||||
*
|
||||
* XXXRW: Layering?
|
||||
*/
|
||||
if (suser(td))
|
||||
if (priv_check(td, PRIV_NET_ADDIFADDR))
|
||||
return (EPERM);
|
||||
|
||||
sat = satosat(&ifr->ifr_addr);
|
||||
|
Loading…
Reference in New Issue
Block a user