summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVyacheslav Trushkin <me@dogonthesun.net>2011-12-20 20:52:31 +0400
committerDenis Ovsienko <infrastation@yandex.ru>2012-01-02 18:38:11 +0400
commit6fd16207fee6d4d09f29ed7ecf26303a7220e473 (patch)
treefbc4a0ad11f99c5b7547e1aea47dce536c14f64d
parent4e677f52db2276b92bcc201b4379a66a83d45caa (diff)
ospf6d: add verifying user's privileges
-rw-r--r--ospf6d/ospf6_main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c
index c4b9124e..d40bd97f 100644
--- a/ospf6d/ospf6_main.c
+++ b/ospf6d/ospf6_main.c
@@ -291,6 +291,13 @@ main (int argc, char *argv[], char *envp[])
}
}
+ if (geteuid () != 0)
+ {
+ errno = EPERM;
+ perror (progname);
+ exit (1);
+ }
+
/* thread master */
master = thread_master_create ();