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 17:28:01 +0400
commit13351032d1d1632dbaf540cf33b7bebbc748c415 (patch)
treeafbef258221ec2d954b6bcf3f9cf1b70c73be054
parent85136e904861775bdf6fbbbd4f0080f06e749bcb (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 235a6858..8444d90f 100644
--- a/ospf6d/ospf6_main.c
+++ b/ospf6d/ospf6_main.c
@@ -262,6 +262,13 @@ main (int argc, char *argv[], char *envp[])
}
}
+ if (geteuid () != 0)
+ {
+ errno = EPERM;
+ perror (progname);
+ exit (1);
+ }
+
/* thread master */
master = thread_master_create ();