summaryrefslogtreecommitdiff
path: root/ospfclient
diff options
context:
space:
mode:
authorpaul <paul>2003-06-04 13:59:38 +0000
committerpaul <paul>2003-06-04 13:59:38 +0000
commitedd7c245d3a77012abf801da00d5664ebaa5f749 (patch)
treed4fada229d7980fb751f28c9a979aa88de1a0af0 /ospfclient
parenta159ed935b580ed99111a185734ddd9c973e7691 (diff)
2003-06-04 Paul Jakma <paul@dishone.st>
* Merge of zebra privileges
Diffstat (limited to 'ospfclient')
-rw-r--r--ospfclient/Makefile.am2
-rw-r--r--ospfclient/ospfclient.c15
2 files changed, 16 insertions, 1 deletions
diff --git a/ospfclient/Makefile.am b/ospfclient/Makefile.am
index 95a74eec..fb041af9 100644
--- a/ospfclient/Makefile.am
+++ b/ospfclient/Makefile.am
@@ -16,6 +16,6 @@ ospfapiheader_HEADERS = \
ospfclient_SOURCES = \
ospfclient.c $(libospfapiclient_a_SOURCES)
-ospfclient_LDADD = ../ospfd/libospf.a ../lib/libzebra.a
+ospfclient_LDADD = ../ospfd/libospf.a ../lib/libzebra.a @LIBCAP@
diff --git a/ospfclient/ospfclient.c b/ospfclient/ospfclient.c
index ec1aabcb..28010872 100644
--- a/ospfclient/ospfclient.c
+++ b/ospfclient/ospfclient.c
@@ -11,6 +11,8 @@
#include <zebra.h>
#include "prefix.h" /* needed by ospf_asbr.h */
+#include "privs.h"
+
#include "ospfd/ospfd.h"
#include "ospfd/ospf_asbr.h"
#include "ospfd/ospf_lsa.h"
@@ -18,6 +20,18 @@
#include "ospfd/ospf_api.h"
#include "ospf_apiclient.h"
+/* privileges struct.
+ * set cap_num_* and uid/gid to nothing to use NULL privs
+ * as ospfapiclient links in libospf.a which uses privs.
+ */
+struct zebra_privs_t ospfd_privs =
+{
+ .user = NULL,
+ .group = NULL,
+ .cap_num_p = 0,
+ .cap_num_i = 0
+};
+
/* The following includes are specific to this application. For
example it uses threads from libzebra, however your application is
free to use any thread library (like pthreads). */
@@ -274,6 +288,7 @@ main (int argc, char *argv[])
}
/* Initialization */
+ zprivs_init (&ospfd_privs);
master = thread_master_create ();
/* Open connection to OSPF daemon */