summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPaul Jakma <paul@jakma.org>2015-10-28 14:25:06 +0000
committerPaul Jakma <paul@quagga.net>2015-10-28 14:25:06 +0000
commit283596fd6d49a5b2861a6923db9a88628ef0eca4 (patch)
tree1b461a1fea8840efaafd1250f729831be91fea9f /lib
parentbe62b17c736ea06181f2788e3011066830555610 (diff)
parentfc1c114aab24fe47bc6a1976c1c602d507fa4e69 (diff)
downloadquagga-283596fd6d49a5b2861a6923db9a88628ef0eca4.tar.bz2
quagga-283596fd6d49a5b2861a6923db9a88628ef0eca4.tar.xz
Merge 'patch-tracking/4/proposed/netdef-solaris' into accepted
Diffstat (limited to 'lib')
-rw-r--r--lib/getopt.c4
-rw-r--r--lib/getopt1.c4
-rw-r--r--lib/privs.c35
-rw-r--r--lib/stream.c2
-rw-r--r--lib/workqueue.c2
-rw-r--r--lib/zebra.h1
6 files changed, 37 insertions, 11 deletions
diff --git a/lib/getopt.c b/lib/getopt.c
index 064909d3..7a58a8a8 100644
--- a/lib/getopt.c
+++ b/lib/getopt.c
@@ -30,10 +30,6 @@
# define _NO_PROTO
#endif
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
#include <zebra.h>
#if !defined __STDC__ || !__STDC__
diff --git a/lib/getopt1.c b/lib/getopt1.c
index fa766747..bd3099e7 100644
--- a/lib/getopt1.c
+++ b/lib/getopt1.c
@@ -20,10 +20,6 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include <zebra.h>
#include "getopt.h"
diff --git a/lib/privs.c b/lib/privs.c
index ff0be2fe..0ca8783d 100644
--- a/lib/privs.c
+++ b/lib/privs.c
@@ -622,6 +622,41 @@ zprivs_state_null (void)
return zprivs_null_state;
}
+#ifndef HAVE_GETGROUPLIST
+/* Solaris 11 has no getgrouplist() */
+static int
+getgrouplist(const char *user, gid_t group, gid_t *groups, int *ngroups)
+{
+ struct group *grp;
+ size_t usridx;
+ int pos = 0, ret;
+
+ if (pos < *ngroups)
+ groups[pos] = group;
+ pos++;
+
+ setgrent();
+ while ((grp = getgrent()))
+ {
+ if (grp->gr_gid == group)
+ continue;
+ for (usridx = 0; grp->gr_mem[usridx] != NULL; usridx++)
+ if (!strcmp (grp->gr_mem[usridx], user))
+ {
+ if (pos < *ngroups)
+ groups[pos] = grp->gr_gid;
+ pos++;
+ break;
+ }
+ }
+ endgrent();
+
+ ret = (pos <= *ngroups) ? pos : -1;
+ *ngroups = pos;
+ return ret;
+}
+#endif /* HAVE_GETGROUPLIST */
+
void
zprivs_init(struct zebra_privs_t *zprivs)
{
diff --git a/lib/stream.c b/lib/stream.c
index 9c26fea8..ca1a40f1 100644
--- a/lib/stream.c
+++ b/lib/stream.c
@@ -20,8 +20,8 @@
* 02111-1307, USA.
*/
-#include <stddef.h>
#include <zebra.h>
+#include <stddef.h>
#include "stream.h"
#include "memory.h"
diff --git a/lib/workqueue.c b/lib/workqueue.c
index 9fc89314..b1a5d5bf 100644
--- a/lib/workqueue.c
+++ b/lib/workqueue.c
@@ -21,7 +21,7 @@
* 02111-1307, USA.
*/
-#include <lib/zebra.h>
+#include <zebra.h>
#include "thread.h"
#include "memory.h"
#include "workqueue.h"
diff --git a/lib/zebra.h b/lib/zebra.h
index 1ee5107e..fe34be78 100644
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -27,7 +27,6 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#ifdef SUNOS_5
#define _XPG4_2
-#define __EXTENSIONS__
typedef unsigned int u_int32_t;
typedef unsigned short u_int16_t;
typedef unsigned char u_int8_t;