mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-24 11:29:10 +00:00
Use privilege PRIV_NET_ADDIFADDR rather than suser() to authorize
adding a netatalk address to an interface.
This commit is contained in:
parent
95b091d2f2
commit
19913888ad
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166833
@ -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