diff options
| -rw-r--r-- | alpine/APKBUILD.in | 13 | ||||
| -rw-r--r-- | bgpd/bgp_updgrp.c | 2 | ||||
| -rw-r--r-- | bgpd/rfapi/bgp_rfapi_cfg.c | 6 | ||||
| -rw-r--r-- | vtysh/vtysh_main.c | 17 |
4 files changed, 29 insertions, 9 deletions
diff --git a/alpine/APKBUILD.in b/alpine/APKBUILD.in index c3e7e939e4..42896c21a5 100644 --- a/alpine/APKBUILD.in +++ b/alpine/APKBUILD.in @@ -20,6 +20,7 @@ makedepends="ncurses-dev net-snmp-dev gawk texinfo perl patch pax-utils pcre perl pkgconf python2 python2-dev readline readline-dev sqlite-libs squashfs-tools sudo tar texinfo xorriso xz-libs py-sphinx" +checkdepends="pytest py-setuptools" install="$pkgname.pre-install $pkgname.pre-deinstall $pkgname.post-deinstall" subpackages="$pkgname-dev $pkgname-doc $pkgname-dbg" source="$pkgname-$pkgver.tar.gz docker-start daemons daemons.conf" @@ -45,13 +46,19 @@ build() { --enable-multipath=64 \ --enable-vty-group=frrvty \ --enable-user=$_user \ - --enable-group=$_user || return 1 - make || return 1 + --enable-group=$_user + make +} + +check() { + cd "$builddir" + + make -j 1 check } package() { cd "$builddir" - make DESTDIR="$pkgdir" install || return 1 + make DESTDIR="$pkgdir" install install -Dm755 "$srcdir"/docker-start "$pkgdir"$_sbindir install -Dm644 "$srcdir"/daemons "$pkgdir"$_sysconfdir diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c index d2e89a6785..c607c4577d 100644 --- a/bgpd/bgp_updgrp.c +++ b/bgpd/bgp_updgrp.c @@ -812,7 +812,7 @@ static void update_subgroup_delete(struct update_subgroup *subgrp) THREAD_TIMER_OFF(subgrp->t_coalesce); sync_delete(subgrp); - if (BGP_DEBUG(update_groups, UPDATE_GROUPS)) + if (BGP_DEBUG(update_groups, UPDATE_GROUPS) && subgrp->update_group) zlog_debug("delete subgroup u%" PRIu64 ":s%" PRIu64, subgrp->update_group->id, subgrp->id); diff --git a/bgpd/rfapi/bgp_rfapi_cfg.c b/bgpd/rfapi/bgp_rfapi_cfg.c index 2f93328887..72255e54fb 100644 --- a/bgpd/rfapi/bgp_rfapi_cfg.c +++ b/bgpd/rfapi/bgp_rfapi_cfg.c @@ -662,7 +662,8 @@ static int rfapi_str2route_type(const char *l3str, const char *pstr, afi_t *afi, vnc_import_bgp_exterior_redist_enable((bgp), (afi)); \ break; \ default: \ - vnc_redistribute_set((bgp), (afi), (type)); \ + if ((type) < ZEBRA_ROUTE_MAX) \ + vnc_redistribute_set((bgp), (afi), (type)); \ break; \ } \ } while (0) @@ -677,7 +678,8 @@ static int rfapi_str2route_type(const char *l3str, const char *pstr, afi_t *afi, vnc_import_bgp_exterior_redist_disable((bgp), (afi)); \ break; \ default: \ - vnc_redistribute_unset((bgp), (afi), (type)); \ + if ((type) < ZEBRA_ROUTE_MAX) \ + vnc_redistribute_unset((bgp), (afi), (type)); \ break; \ } \ } while (0) diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c index ad7d072d3d..7d882620e8 100644 --- a/vtysh/vtysh_main.c +++ b/vtysh/vtysh_main.c @@ -471,7 +471,8 @@ int main(int argc, char **argv, char **env) } if (dryrun && cmd && cmd->line) { - vtysh_execute("enable"); + if (!user_mode) + vtysh_execute("enable"); while (cmd) { struct cmd_rec *cr; char *cmdnow = cmd->line, *next; @@ -527,6 +528,14 @@ int main(int argc, char **argv, char **env) suid_off(); if (writeconfig) { + if (user_mode) { + fprintf(stderr, + "writeconfig cannot be used when running as an unprivileged user.\n"); + if (no_error) + exit(0); + else + exit(1); + } vtysh_execute("enable"); return vtysh_write_config_integrated(); } @@ -573,7 +582,8 @@ int main(int argc, char **argv, char **env) /* If eval mode. */ if (cmd && cmd->line) { /* Enter into enable node. */ - vtysh_execute("enable"); + if (!user_mode) + vtysh_execute("enable"); while (cmd != NULL) { int ret; @@ -663,7 +673,8 @@ int main(int argc, char **argv, char **env) vty_hello(vty); /* Enter into enable node. */ - vtysh_execute("enable"); + if (!user_mode) + vtysh_execute("enable"); /* Preparation for longjmp() in sigtstp(). */ sigsetjmp(jmpbuf, 1); |
