Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
adaaaa1
Remove ietf-netconf-acm@2018-02-14.yang
mattiaswal May 13, 2024
775fc0b
Build in required modules on buildtime
mattiaswal May 6, 2024
72a7198
Bump sysrepo, netopeer2, libyang and libnetconf
mattiaswal May 13, 2024
9640e18
libnetconf: Add support for passwd accounts
mattiaswal May 17, 2024
58da340
Refactor gen-key to generate SSH accepted keys.
mattiaswal May 17, 2024
bda36a9
FRR: Fix compatibility with newer libyang
mattiaswal May 17, 2024
a80b302
netopeer2: Add a custom PAM configuration file
mattiaswal May 17, 2024
427b790
test: Refactor ipv4 address
mattiaswal May 17, 2024
01df19e
confd: Always use model prefix for intentityrefs
mattiaswal May 20, 2024
2b367b2
ospf-status: Return {} if no status can be retreived (ospfd is disabled)
mattiaswal May 20, 2024
5edddf7
yanger: Change behavior to always genereate a valid YANG
mattiaswal May 20, 2024
d0e8e4c
infamy: route: ospf: Adopt to changes done in 2c88e1bdf5
mattiaswal May 20, 2024
ec9fe8b
confd: Update SHM path
mattiaswal May 20, 2024
9bab642
libyang: Add upstream segfault patch
mattiaswal May 21, 2024
535e5f4
test: ipv4_autoconf: Increace possible delay when waiting for link local
mattiaswal May 21, 2024
1ec1a2a
Update Changelog regarding updated YANG models
mattiaswal May 22, 2024
c3a2f66
confd: simplify sysrepo datastore makedev permissions
troglobit May 24, 2024
0348e00
confd: Add sysrepo and netopeer as a dependency.
mattiaswal May 24, 2024
b7a83c1
libsrx: Remove srx_require_module API
mattiaswal May 24, 2024
2cf0c27
setup.sh: Document the origin of this script.
mattiaswal May 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions board/common/rootfs/etc/pam.d/netopeer2.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#%PAM-1.0
auth requisite pam_nologin.so
auth [success=1 default=ignore] pam_unix.so nullok
auth requisite pam_deny.so
auth required pam_permit.so

account requisite pam_nologin.so
account [success=1 default=ignore] pam_unix.so
account requisite pam_deny.so
account required pam_permit.so

password [success=1 default=ignore] pam_unix.so
password requisite pam_deny.so
password required pam_permit.so

session required pam_loginuid.so
session include common-session
session optional pam_keyinit.so force revoke
session optional pam_lastlog.so showfailed
session optional pam_motd.so
7 changes: 7 additions & 0 deletions doc/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to the project are documented in this file.

[v24.05.0][UNRELEASED]
----------------------
> **Note:** After upgrade a factory reset is needed

### Changes
- Default web landing page refactored into a Buildroot package to make
Expand All @@ -22,6 +23,12 @@ All notable changes to the project are documented in this file.
- Update documentation for use of VETH pairs in containers
- Issue #454: create bridges in `factory-config` with IGMP/MLD snooping
enabled by default
- The following YANG models have been updated to newer draft versions:
`ietf-crypto-types`, `ietf-keystore`, `ietf-netconf-server`, `ietf-ssh-common`,
`ietf-ssh-server`, `ietf-tcp-client`, `ietf-tcp-common`, `ietf-tcp-server`,
`ietf-tcp-server`, `ietf-tcp-server`, `ietf-tcp-server`.
In these there are a lot of breaking changes, most likely
you will need to redo your configuration from `factory-config`.
Comment thread
mattiaswal marked this conversation as resolved.
Resolved

### Fixes
- Add missing LICENSE hash for factory reset tool
Expand Down
20 changes: 18 additions & 2 deletions package/confd/confd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ CONFD_SITE = $(BR2_EXTERNAL_INFIX_PATH)/src/confd
CONFD_LICENSE = BSD-3-Clause
CONFD_LICENSE_FILES = LICENSE
CONFD_REDISTRIBUTE = NO
CONFD_DEPENDENCIES = augeas jansson libite sysrepo libsrx libglib2
CONFD_DEPENDENCIES = host-sysrepo sysrepo netopeer2 augeas jansson libite sysrepo libsrx libglib2
CONFD_AUTORECONF = YES

CONFD_SYSREPO_SHM_PREFIX = sr_buildroot$(subst /,_,$(CONFIG_DIR))_confd

define CONFD_CONF_ENV
CFLAGS="$(INFIX_CFLAGS)"
endef
Expand All @@ -30,6 +33,19 @@ define CONFD_INSTALL_EXTRA
mkdir -p $(TARGET_DIR)/etc/avahi/services
cp $(CONFD_PKGDIR)/avahi.service $(TARGET_DIR)/etc/avahi/services/netconf.service
endef
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_EXTRA
define CONFD_INSTALL_YANG_MODULES
USE_CONTAINERS=$(BR2_PACKAGE_PODMAN) SYSREPO_SHM_PREFIX=$(CONFD_SYSREPO_SHM_PREFIX) SYSREPOCTL_EXECUTABLE="$(HOST_DIR)/bin/sysrepoctl" SYSREPOCFG_EXECUTABLE="$(HOST_DIR)/bin/sysrepocfg" SEARCH_PATH="$(TARGET_DIR)/usr/share/yang/modules/confd/" $(@D)/scripts/setup.sh
endef
define CONFD_PERMISSIONS
/etc/sysrepo/data/ r 660 root wheel - - - - -
/etc/sysrepo/data d 770 root wheel - - - - -
endef

define CONFD_CLEANUP
rm -f /dev/shm/$(CONFD_SYSREPO_SHM_PREFIX)*
endef
CONFD_PRE_INSTALL_TARGET_HOOKS += CONFD_CLEANUP
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_EXTRA
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_YANG_MODULES
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_CLEANUP
$(eval $(autotools-package))
22 changes: 22 additions & 0 deletions patches/frr/8.5.4/0001-libyang-compat.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/lib/yang.c b/lib/yang.c
index ef1cf898a..c780b8e8c 100644
--- a/lib/yang.c
+++ b/lib/yang.c
@@ -647,7 +647,7 @@ struct yang_data *yang_data_list_find(const struct list *list,
}

/* Make libyang log its errors using FRR logging infrastructure. */
-static void ly_log_cb(LY_LOG_LEVEL level, const char *msg, const char *path)
+static void ly_log_cb(LY_LOG_LEVEL level, const char *msg, const char *path, uint64_t line)
{
int priority = LOG_ERR;

@@ -742,7 +742,7 @@ struct ly_ctx *yang_ctx_new_setup(bool embedded_modules, bool explicit_compile)
void yang_init(bool embedded_modules, bool defer_compile)
{
/* Initialize libyang global parameters that affect all containers. */
- ly_set_log_clb(ly_log_cb, 1);
+ ly_set_log_clb(ly_log_cb);
ly_log_options(LY_LOLOG | LY_LOSTORE);

/* Initialize libyang container for native models. */
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
From 2b3e1c379bf9b9404452b7aa1a66a6ce6d1301e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= <lazzer@gmail.com>
Date: Fri, 17 May 2024 13:33:53 +0200
Subject: [PATCH] Add support for system authentication as fallback

First check if the user is configurured in ietf-netconf-server YANG,
if found in YANG go with the user found. Else, if using shadow or pam,
just continue, try to auth anyway. PAM will block the login later if
incorrect.
---
src/session_server_ssh.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/session_server_ssh.c b/src/session_server_ssh.c
index c8386bc..86d5bb1 100644
--- a/src/session_server_ssh.c
+++ b/src/session_server_ssh.c
@@ -1415,6 +1415,7 @@ nc_session_ssh_msg(struct nc_session *session, struct nc_server_ssh_opts *opts,
* process known messages
*/
if (type == SSH_REQUEST_AUTH) {
+ int username_allocated = 0;
if (session->flags & NC_SESSION_SSH_AUTHENTICATED) {
ERR(session, "User \"%s\" authenticated, but requested another authentication.", session->username);
ssh_message_reply_default(msg);
@@ -1439,6 +1440,15 @@ nc_session_ssh_msg(struct nc_session *session, struct nc_server_ssh_opts *opts,
}
}

+#if defined(HAVE_LIBPAM) || defined(HAVE_SHADOW)
+ if (!auth_client) {
+ username_allocated = 1;
+ auth_client = malloc(sizeof(*auth_client)); /* Get freed when closing session. */
+ memset(auth_client, 0, sizeof(*auth_client));
+ auth_client->username = strdup(username);
+ auth_client->kb_int_enabled = 1;
+ }
+#else
if (!auth_client) {
if (opts->referenced_endpt_name) {
/* client not known by the endpt, but it references another one so try it */
@@ -1457,9 +1467,12 @@ nc_session_ssh_msg(struct nc_session *session, struct nc_server_ssh_opts *opts,
ssh_message_reply_default(msg);
return 0;
}
-
+#endif
if (!session->username) {
- session->username = strdup(username);
+ if (username_allocated)
+ session->username = auth_client->username;
+ else
+ session->username = strdup(username);

/* configure and count accepted auth methods */
if (auth_client->store == NC_STORE_LOCAL) {
--
2.34.1

73 changes: 73 additions & 0 deletions patches/libyang/2.2.8/UPSTREAM-Fix-netopeer2-segfault.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
From 1544e0adb44a18d95e1bb23d2881a73a89fa5631 Mon Sep 17 00:00:00 2001
From: Michal Vasko <mvasko@cesnet.cz>
Date: Mon, 22 Apr 2024 14:12:24 +0200
Subject: [PATCH] plugins BUGFIX safe retrieval of canonical value

Fixes cesnet/netopeer2#1562
---
src/plugins_types/binary.c | 6 +++---
src/plugins_types/instanceid.c | 2 +-
src/plugins_types/string.c | 6 +++---
3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/plugins_types/binary.c b/src/plugins_types/binary.c
index c2655119d..c70b4a008 100644
--- a/src/plugins_types/binary.c
+++ b/src/plugins_types/binary.c
@@ -338,7 +338,7 @@ lyplg_type_store_binary(const struct ly_ctx *ctx, const struct lysc_type *type,
* @brief Implementation of ::lyplg_type_validate_clb for the binary type.
*/
static LY_ERR
-lyplg_type_validate_binary(const struct ly_ctx *UNUSED(ctx), const struct lysc_type *type, const struct lyd_node *UNUSED(ctx_node),
+lyplg_type_validate_binary(const struct ly_ctx *ctx, const struct lysc_type *type, const struct lyd_node *UNUSED(ctx_node),
const struct lyd_node *UNUSED(tree), struct lyd_value *storage, struct ly_err_item **err)
{
struct lysc_type_bin *type_bin = (struct lysc_type_bin *)type;
@@ -349,8 +349,8 @@ lyplg_type_validate_binary(const struct ly_ctx *UNUSED(ctx), const struct lysc_t
LY_CHECK_ARG_RET(NULL, type, storage, err, LY_EINVAL);

val = LYPLG_TYPE_VAL_IS_DYN(val) ? (struct lyd_value_binary *)(storage->dyn_mem) : (struct lyd_value_binary *)(storage->fixed_mem);
- value = storage->_canonical;
- value_len = strlen(storage->_canonical);
+ value = lyd_value_get_canonical(ctx, storage);
+ value_len = strlen(value);
*err = NULL;

/* length restriction of the binary value */
diff --git a/src/plugins_types/instanceid.c b/src/plugins_types/instanceid.c
index 84e92b698..00ad45a98 100644
--- a/src/plugins_types/instanceid.c
+++ b/src/plugins_types/instanceid.c
@@ -244,7 +244,7 @@ lyplg_type_validate_instanceid(const struct ly_ctx *ctx, const struct lysc_type

/* find the target in data */
if ((ret = ly_path_eval(storage->target, tree, NULL, NULL))) {
- value = lyplg_type_print_instanceid(ctx, storage, LY_VALUE_CANON, NULL, NULL, NULL);
+ value = lyd_value_get_canonical(ctx, storage);
path = lyd_path(ctx_node, LYD_PATH_STD, NULL, 0);
return ly_err_new(err, ret, LYVE_DATA, path, strdup("instance-required"), LY_ERRMSG_NOINST, value);
}
diff --git a/src/plugins_types/string.c b/src/plugins_types/string.c
index e4c1cb986..2ad003551 100644
--- a/src/plugins_types/string.c
+++ b/src/plugins_types/string.c
@@ -112,7 +112,7 @@ lyplg_type_store_string(const struct ly_ctx *ctx, const struct lysc_type *type,
* @brief Implementation of ::lyplg_type_validate_clb for the string type.
*/
static LY_ERR
-lyplg_type_validate_string(const struct ly_ctx *UNUSED(ctx), const struct lysc_type *type, const struct lyd_node *UNUSED(ctx_node),
+lyplg_type_validate_string(const struct ly_ctx *ctx, const struct lysc_type *type, const struct lyd_node *UNUSED(ctx_node),
const struct lyd_node *UNUSED(tree), struct lyd_value *storage, struct ly_err_item **err)
{
LY_ERR ret;
@@ -121,8 +121,8 @@ lyplg_type_validate_string(const struct ly_ctx *UNUSED(ctx), const struct lysc_t
size_t value_len;

LY_CHECK_ARG_RET(NULL, type, storage, err, LY_EINVAL);
- value = storage->_canonical;
- value_len = strlen(storage->_canonical);
+ value = lyd_value_get_canonical(ctx, storage);
+ value_len = strlen(value);
*err = NULL;

/* length restriction of the string */
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
From 2b284c1addeecb767bcd7dc280b27411c81cbb74 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Tue, 28 Mar 2023 10:37:53 +0200
Subject: [PATCH 1/4] sysrepo-plugind: add support for running in foreground
with syslog

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/executables/sysrepo-plugind.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/executables/sysrepo-plugind.c b/src/executables/sysrepo-plugind.c
index a6a817cc..5baebec3 100644
--- a/src/executables/sysrepo-plugind.c
+++ b/src/executables/sysrepo-plugind.c
@@ -98,6 +98,7 @@ help_print(void)
" Change verbosity to a level (none, error, warning, info, debug) or\n"
" number (0, 1, 2, 3, 4).\n"
" -d, --debug Debug mode - is not daemonized and logs to stderr instead of syslog.\n"
+ " -n, --foreground Run in foreground and log to syslog.\n"
" -P, --plugin-install <path>\n"
" Install a sysrepo-plugind plugin. The plugin is simply copied\n"
" to the designated plugin directory.\n"
@@ -201,6 +202,8 @@ daemon_init(int debug, sr_log_level_t log_level)

if (debug) {
handle_signals();
+ if (debug < 0)
+ goto done;
sr_log_stderr(log_level);
return;
}
@@ -241,6 +244,7 @@ daemon_init(int debug, sr_log_level_t log_level)
close(fd);
}

+done:
/* set verbosity */
sr_log_syslog("sysrepo-plugind", log_level);
}
@@ -466,6 +470,7 @@ main(int argc, char **argv)
{"version", no_argument, NULL, 'V'},
{"verbosity", required_argument, NULL, 'v'},
{"debug", no_argument, NULL, 'd'},
+ {"foreground", no_argument, NULL, 'n'},
{"plugin-install", required_argument, NULL, 'P'},
{"pid-file", required_argument, NULL, 'p'},
{"fatal-plugin-fail", no_argument, NULL, 'f'},
@@ -474,7 +479,7 @@ main(int argc, char **argv)

/* process options */
opterr = 0;
- while ((opt = getopt_long(argc, argv, "hVv:dP:p:f", options, NULL)) != -1) {
+ while ((opt = getopt_long(argc, argv, "hVv:dnP:p:f", options, NULL)) != -1) {
switch (opt) {
case 'h':
version_print();
@@ -506,6 +511,9 @@ main(int argc, char **argv)
case 'd':
debug = 1;
break;
+ case 'n':
+ debug = -1;
+ break;
case 'P':
/* plugin-install */
if (get_plugins_dir(&plugins_dir)) {
--
2.34.1

Loading