git: 7e66e3b58f23 - main - net/quagga: minor fixes

From: Eugene Grosbein <eugen_at_FreeBSD.org>
Date: Mon, 06 May 2024 12:36:06 UTC
The branch main has been updated by eugen:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7e66e3b58f23a30957b0b002809bc91965736a4d

commit 7e66e3b58f23a30957b0b002809bc91965736a4d
Author:     Eugene Grosbein <eugen@FreeBSD.org>
AuthorDate: 2024-05-06 12:31:53 +0000
Commit:     Eugene Grosbein <eugen@FreeBSD.org>
CommitDate: 2024-05-06 12:36:01 +0000

    net/quagga: minor fixes
    
    - generalize CONFLICTS;
    - fix subtle bug in my patch-vtysh.c;
    - fix call to getgrouplist() function,
    this part based on submission by Alexander Mitrokhin.
    
    Bump PORTREVISION.
---
 net/quagga/Makefile                |  4 ++--
 net/quagga/files/patch-lib_privs.c | 13 +++++++++++++
 net/quagga/files/patch-vtysh.c     |  2 +-
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/net/quagga/Makefile b/net/quagga/Makefile
index 9417f6677533..ad20890eef83 100644
--- a/net/quagga/Makefile
+++ b/net/quagga/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	quagga
 PORTVERSION=	1.2.4
-PORTREVISION=	12
+PORTREVISION=	13
 CATEGORIES=	net
 MASTER_SITES=	https://github.com/Quagga/quagga/releases/download/${DISTNAME}/ \
 		http://www.grosbein.net/freebsd/distfiles/ \
@@ -116,7 +116,7 @@ post-install:
 .include <bsd.port.options.mk>
 
 .if ${PORT_OPTIONS:MLEGACY}
-CONFLICTS=		frr7 openbgpd pimd
+CONFLICTS=		frr* openbgpd pimd
 USE_LDCONFIG=		yes
 .else
 PKGNAMESUFFIX=		-compat
diff --git a/net/quagga/files/patch-lib_privs.c b/net/quagga/files/patch-lib_privs.c
new file mode 100644
index 000000000000..159920b4cb6a
--- /dev/null
+++ b/net/quagga/files/patch-lib_privs.c
@@ -0,0 +1,13 @@
+--- lib/privs.c.orig	2018-02-20 04:24:55.000000000 +0700
++++ lib/privs.c	2024-05-06 19:00:18.907694000 +0700
+@@ -717,8 +717,8 @@ zprivs_init(struct zebra_privs_t *zprivs)
+ 
+   if (zprivs->user)
+     {
+-      ngroups = sizeof(groups);
+-      if ( (ngroups = getgrouplist (zprivs->user, zprivs_state.zgid, groups, &ngroups )) < 0 )
++      ngroups = nitems(groups);
++      if (getgrouplist (zprivs->user, zprivs_state.zgid, groups, &ngroups) < 0 )
+         {
+           /* cant use log.h here as it depends on vty */
+           fprintf (stderr, "privs_init: could not getgrouplist for user %s\n",
diff --git a/net/quagga/files/patch-vtysh.c b/net/quagga/files/patch-vtysh.c
index e5779a1de11d..2e0b1b6cd4cb 100644
--- a/net/quagga/files/patch-vtysh.c
+++ b/net/quagga/files/patch-vtysh.c
@@ -19,7 +19,7 @@
 +    return;
 +
 +  s = strrchr(vtysh_pager_name, '/');
-+  s = (s == NULL ? vtysh_pager_name : s++);
++  s = (s == NULL ? vtysh_pager_name : s + 1);
 +  if (strcmp(s, "more") != 0 && strcmp(s, "less") != 0)
 +    return;
 +