Repository navigation
Install yang modules during build #460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
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 775fc0b
Build in required modules on buildtime
mattiaswal 72a7198
Bump sysrepo, netopeer2, libyang and libnetconf
mattiaswal 9640e18
libnetconf: Add support for passwd accounts
mattiaswal 58da340
Refactor gen-key to generate SSH accepted keys.
mattiaswal bda36a9
FRR: Fix compatibility with newer libyang
mattiaswal a80b302
netopeer2: Add a custom PAM configuration file
mattiaswal 427b790
test: Refactor ipv4 address
mattiaswal 01df19e
confd: Always use model prefix for intentityrefs
mattiaswal 2b367b2
ospf-status: Return {} if no status can be retreived (ospfd is disabled)
mattiaswal 5edddf7
yanger: Change behavior to always genereate a valid YANG
mattiaswal d0e8e4c
infamy: route: ospf: Adopt to changes done in 2c88e1bdf5
mattiaswal ec9fe8b
confd: Update SHM path
mattiaswal 9bab642
libyang: Add upstream segfault patch
mattiaswal 535e5f4
test: ipv4_autoconf: Increace possible delay when waiting for link local
mattiaswal 1ec1a2a
Update Changelog regarding updated YANG models
mattiaswal c3a2f66
confd: simplify sysrepo datastore makedev permissions
troglobit 0348e00
confd: Add sysrepo and netopeer as a dependency.
mattiaswal b7a83c1
libsrx: Remove srx_require_module API
mattiaswal 2cf0c27
setup.sh: Document the origin of this script.
mattiaswal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Submodule buildroot
updated
8 files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. */ |
59 changes: 59 additions & 0 deletions
59
patches/libnetconf2/3.0.17/0001-Add-support-for-system-authentication-as-fallback.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
73
patches/libyang/2.2.8/UPSTREAM-Fix-netopeer2-segfault.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 */ |
70 changes: 70 additions & 0 deletions
70
patches/sysrepo/2.2.170/0001-sysrepo-plugind-add-support-for-running-in-foregroun.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.