Commit graph

1613 commits

Author SHA1 Message Date
Olof hagsand
f7162297d3 github actions: libevent and clixon users 2021-06-16 13:51:01 +02:00
Olof hagsand
fdcb7eb9ab github actions: libevhtp 2021-06-16 13:11:18 +02:00
Olof hagsand
f66916ae57 github actions: native restconf 2021-06-16 13:09:13 +02:00
Olof hagsand
113f92ab41 Move clixon CI from travis to github actions 2021-06-16 13:06:21 +02:00
Olof hagsand
b40dafb691 * Event exit API changed to a single decrementing counter where 1 means exit.
* Removed: `clicon_exit_reset()`
  * Changed: `clicon_exit_set()` --> `clixon_exit_set(int nr)`
  * Changed: `clicon_exit_get()` --> `clixon_exit_get()`
* native restconf special case upgrade handling from http/1 -> http/2 and restconf restart: delay the restart using event exit counter
2021-06-16 11:58:13 +02:00
Olof hagsand
4f513385e9 - Restconf native http/1 to http/2 upgrade (non-tls) 2021-06-13 12:43:19 +02:00
Olof hagsand
b711faade9 grpc in shape 2021-06-11 14:42:41 +02:00
Olof hagsand
5ead099d0b * Added autotool check for getresuid (and related functions) necessary for lowering of priviliges for backend and restconf
* If getresuid is not available, CLICON_RESTCONF_PRIVILEGES must be set to 'none'
2021-06-11 14:42:41 +02:00
Olof hagsand
e24e2eb78b revert of https://github.com/clicon/clixon/pull/238 2021-06-11 14:05:19 +02:00
Olof Hagsand
92e340f462
Merge pull request #238 from mager-m/master
Fixed memory allocation for `struct dirent`
2021-06-11 11:10:34 +02:00
Olof hagsand
a122efceff * Fixed: [restconf patch method adds redundant namespaces #235](https://github.com/clicon/clixon/issues/235) 2021-06-10 13:05:03 +02:00
mager-m
af7e0458c6 Fixed memory allocation for struct dirent
While porting clixon to the RTOS Blackberry QNX there was memory corruption while reading the yang models from the disk.
Debugging led to the function `clicon_file_dirent` in `clixon_file.c` in which the `struct dirent` is copied into an array.
According to the UNIX `struct dirent` [documentation](https://man7.org/linux/man-pages/man0/dirent.h.0p.html):
>  The name of an array of char of an unspecified size should not be
>  used as an lvalue. Use of:
>
>           sizeof(d_name)
>
>  is incorrect; use:
>
>          strlen(d_name)
>
>      instead.

I adjusted the memory allocation to take the `strlen(dent->d_name)` into account.
2021-06-09 23:35:33 +02:00
Olof hagsand
7d59ec1a3a * Fixed: [JSON parsing error for a specific input. #236](https://github.com/clicon/clixon/issues/236)
* JSON empty list parse problems, eg `a:[]`
2021-06-09 11:44:28 +02:00
Olof hagsand
84f5762ab5 * Most tests work with HTTP/2 support using nghttp2
* except non-ssl http/1->/2 upgrade
* Restconf: ensure HEAD method works everywhere GET does.
2021-06-08 20:53:43 +02:00
Olof hagsand
b680e3c5ac - Restconf nghttp2 compiles 2021-06-03 22:47:54 +02:00
Olof hagsand
37da0aa45e fuzzing restconf changes, json mem error 2021-06-02 13:39:48 +02:00
Olof hagsand
0ad577fa81 - Started nghttp2 work
-  Added autoconf config options, temporary for nghttp2 development: `--disable-evhtp`and `--enable-nghttp2`.
- Added special case for api-path:s beginning with //
2021-05-31 19:11:19 +02:00
Olof hagsand
c405a08ff8 Restconf https fixes after nmap and fuzz:
- segv in PUT/POST of /
- Dont return bad request on error, just close socket
2021-05-28 16:17:52 +02:00
Olof hagsand
af88b974fd - Fuzz for restconf and cli updated 2021-05-27 20:39:49 +02:00
Olof hagsand
965cce5e5d * Added SM_RUNNING_STARTUP to translation table
* Fixed https://github.com/clicon/clixon/issues/224 yet again by addressing a mixed xml and yang namespace xpath case
2021-05-27 15:05:50 +02:00
Olof hagsand
e0c3f5467c * Added new startup-mode: running-startup: First try running db, if it is empty try startup db.
* See [Can startup mode to be extended to support running-startup mode? #234](https://github.com/clicon/clixon/issues/234)
* Improved error message on failed MUST condition
2021-05-27 13:18:01 +02:00
Olof hagsand
69af2884d0 * Fixed: [restconf patch method unable to chage value to empty string #229](https://github.com/clicon/clixon/issues/229) 2021-05-26 22:41:28 +02:00
Olof hagsand
ec4d26febf * Fixed again: [xpath function count did not work properly #224](https://github.com/clicon/clixon/issues/224)
* Must statements namespace context were given by yang node, but this is not correct, should be xml
2021-05-26 14:00:20 +02:00
Olof hagsand
164aa1cb4c * Restconf: added inline configuration using -R <xml> command line as an alternative to making advanced restconf configuration 2021-05-26 11:24:39 +02:00
Olof hagsand
1ef7a280d7 * Fixed: [when condition error under augment in restconf #227](https://github.com/clicon/clixon/issues/227)
* As part of this fix added custom constant XML_PARENT_CANDIDATE
2021-05-25 15:25:26 +02:00
Olof hagsand
5b39418e92 * [Need an option to disable restconf mandatory action of overwriting startup_db #230](https://github.com/clicon/clixon/issues/230)
* Disable RFC 8040 mandatory copy of running to startup after commit
* Rename CLICON_RESTCONF_INSTALL_DIR -> CLICON_RESTCONF_INSTALLDIR
2021-05-25 11:07:41 +02:00
Olof hagsand
60c9172d21 Fixed: [Using YANG union with decimal64 and string leads to regexp match fail #226](https://github.com/clicon/clixon/issues/226) 2021-05-24 21:05:06 +02:00
Olof Hagsand
d3b614e67d
Merge pull request #225 from nowaits/master
Fixed memleak when setting string for none string cg_var type
2021-05-24 14:53:18 +02:00
Olof hagsand
551dc707f1 slack invite, travis docker passwords 2021-05-24 13:27:03 +02:00
Olof hagsand
ae02d02d63 Several fixes to restconf internal and vagrants tests 2021-05-24 13:10:21 +02:00
Olof hagsand
603f70e51f Vagrant and test updates for restconf /www-data mods 2021-05-23 19:55:01 +02:00
Olof hagsand
637c68aed6 travis debug restconf internal 2021-05-23 18:22:54 +02:00
Olof hagsand
5e3ff1ce36 travis/docker issues 2021-05-23 17:57:44 +02:00
Olof hagsand
c20c672d83 * Changed config and install options for Restconf
* clixon_restconf daemon is installed in /usr/local/sbin (as clixon_backend), instead of /www-data
    * `configure --with-wwwdir=<dir>` remains but only applies to fcgi socket and log
    * New option `CLICON_RESTCONF_INSTALL_DIR` is set to where clixon_restconf is installed, with default `/usr/local/sbin/`
  * Restconf drop privileges user is defined by `CLICON_RESTCONF_USER`
    * `configure --with-wwwuser=<user>` is removed
  * clixon_restconf drop of privileges is defined by `CLICON_RESTCONF_PRIVILEGES` option
* New clixon-restconf@2020-05-20.yang revision
  * Added: restconf `log-destination`
2021-05-23 17:14:18 +02:00
Olof hagsand
c3e26b004c * Fixed: [xpath function count did not work properly #224](https://github.com/clicon/clixon/issues/224) 2021-05-20 15:16:29 +02:00
jxm
2e71cdbab7 Fixed memleak when setting string for none string cg_var type 2021-05-19 20:37:00 +08:00
Olof hagsand
9fb9024675 Fixed: native restconf 100 Continue caused hanging 2021-05-18 14:28:57 +02:00
Olof hagsand
37bcceac02 * Fixed: RESTCONF Native: Failed binding of socket in network namespace caused process zombie 2021-05-17 22:50:07 +02:00
Olof hagsand
376f2a8143 * Fixed problems with XPATH composite operations and functions in netconf get/get-config operations.
* See [XPATH issues #219](https://github.com/clicon/clixon/issues/219)
2021-05-17 10:07:09 +02:00
Olof hagsand
5baf8642ea * Fixed union in XPATH [XPATH issues #219](https://github.com/clicon/clixon/issues/219) 2021-05-15 22:28:10 +02:00
Olof hagsand
783b0a4857 * YANG when statement in conjunction with grouping/uses/augment
* Several cases were not implemented fully according to RFC 7950
    * Do not extend default values if when statements evaluate to false
    * Do not allow edit-config of nodes if when statements evaluate to false (Sec 8.3.2)
    * If a key leaf is defined in a grouping that is used in a list, the "uses" statement MUST NOT have a "when" statement. (See 7.21.5)
  * See [yang uses's substatement when has no effect #218](https://github.com/clicon/clixon/issues/2$
2021-05-13 14:26:02 +02:00
Olof Hagsand
5c7498ee40
Merge pull request #220 from shmuelnatan/master
change localtime to localtime_r which is a thread-safe function
2021-05-12 08:45:38 +02:00
Olof hagsand
40f4df1390 Add timeout 100ms before every kill restconf iteration 2021-05-11 15:55:33 +02:00
shmuels
e2b4e7097b Revert "Disable the CLI comment feature entirely."
This reverts commit 90e2bdf15d.
2021-05-10 19:02:48 +03:00
shmuels
b362d0d511 change localtime to localtime_r which is a thread-safe function 2021-05-10 18:53:21 +03:00
shmuels
90e2bdf15d Disable the CLI comment feature entirely. 2021-05-10 10:03:35 +03:00
Olof hagsand
7023fe589f patch for fixing http2 test 2021-05-09 22:12:33 +02:00
Olof hagsand
6ed2202638 - Added openssl application-layer protocol negotiation
- Added restconf tests for http/1.0 and http/2
2021-05-09 17:55:13 +02:00
Olof hagsand
ad08200931 - Added Restconf-style xml/json message bodies everywhere
- Added api_return_err0() and changed many calls to that instead of api_return_err
- Added netconf_operation_not_supported_xml()
2021-05-08 20:20:01 +02:00
Olof hagsand
c50f9f8056 Added test for restconf tls too weak ca using md5 2021-05-07 14:05:40 +02:00