svn commit: r243859 - head/sbin/route
Gleb Smirnoff
glebius at FreeBSD.org
Tue Dec 4 10:24:51 UTC 2012
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");
}
More information about the svn-src-head
mailing list