Use privilege PRIV_NET_ADDIFADDR rather than suser() to authorize

adding a netatalk address to an interface.
This commit is contained in:
Robert Watson 2007-02-19 22:40:02 +00:00
parent 95b091d2f2
commit 19913888ad

View File

@ -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);