Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Dec 2012 10:24:51 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r243859 - head/sbin/route
Message-ID:  <201212041024.qB4AOpOg048257@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Tue Dec  4 10:24:50 2012
New Revision: 243859
URL: http://svnweb.freebsd.org/changeset/base/243859

Log:
  No need to be root when running with -t or -d.

Modified:
  head/sbin/route/route.c

Modified: head/sbin/route/route.c
==============================================================================
--- head/sbin/route/route.c	Tue Dec  4 09:53:09 2012	(r243858)
+++ head/sbin/route/route.c	Tue Dec  4 10:24:50 2012	(r243859)
@@ -365,7 +365,7 @@ flushroutes(int argc, char *argv[])
 	struct fibl *fl;
 	int error;
 
-	if (uid != 0 && !debugonly) {
+	if (uid != 0 && !debugonly && !tflag) {
 		errx(EX_NOPERM, "must be root to alter routing table");
 	}
 	shutdown(s, SHUT_RD); /* Don't want to read back our messages */
@@ -727,7 +727,7 @@ newroute(int argc, char **argv)
 	const char *dest, *gateway, *errmsg;
 	int key, error, flags, nrflags, fibnum;
 
-	if (uid != 0) {
+	if (uid != 0 && !debugonly && !tflag) {
 		errx(EX_NOPERM, "must be root to alter routing table");
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212041024.qB4AOpOg048257>