diff options
author | ru <ru@FreeBSD.org> | 2001-08-31 12:31:09 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2001-08-31 12:31:09 +0000 |
commit | 3be01aaf661cb34c3b44d7a7d7ff9639b3f2fda8 (patch) | |
tree | cdab053999aa91e5d1a8cb485dbfb2159ac249f2 /sbin/route | |
parent | 4006cfa6ed3e7697bcadb070b91c135dd6ca56f7 (diff) | |
download | FreeBSD-src-3be01aaf661cb34c3b44d7a7d7ff9639b3f2fda8.zip FreeBSD-src-3be01aaf661cb34c3b44d7a7d7ff9639b3f2fda8.tar.gz |
Synch with NetBSD and OpenBSD.
Allow non-superuser to open, listen to, and send safe commands on the
routing socket. Superuser priviledge is required for all commands
but RTM_GET.
Lose `setuid root' bit of route(8).
Reviewed by: wollman, dd
Diffstat (limited to 'sbin/route')
-rw-r--r-- | sbin/route/Makefile | 1 | ||||
-rw-r--r-- | sbin/route/route.c | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/sbin/route/Makefile b/sbin/route/Makefile index ab3ab08..c4fa18b 100644 --- a/sbin/route/Makefile +++ b/sbin/route/Makefile @@ -7,7 +7,6 @@ SRCS= route.c keywords.h CFLAGS+=-I. -Wall -DNS CFLAGS+=-DINET6 CLEANFILES+=keywords.h -BINMODE=4555 keywords.h: keywords sed -e '/^#/d' -e '/^$$/d' ${.CURDIR}/keywords > _keywords.tmp diff --git a/sbin/route/route.c b/sbin/route/route.c index dd23bc1..bc14776 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -100,13 +100,14 @@ union sockunion { } so_dst, so_gate, so_mask, so_genmask, so_ifa, so_ifp; typedef union sockunion *sup; -int pid, rtm_addrs, uid; +int pid, rtm_addrs; int s; int forcehost, forcenet, doflush, nflag, af, qflag, tflag, keyword(); int iflag, verbose, aflen = sizeof (struct sockaddr_in); int locking, lockrest, debugonly; struct rt_metrics rt_metrics; u_long rtm_inits; +uid_t uid; int atalk_aton __P((const char *, struct at_addr *)); char *atalk_ntoa __P((struct at_addr)); const char *routename(), *netname(); @@ -176,7 +177,6 @@ main(argc, argv) s = socket(PF_ROUTE, SOCK_RAW, 0); if (s < 0) err(EX_OSERR, "socket"); - setuid(uid); if (*argv) switch (keyword(*argv)) { case K_GET: |