]>
git.ipfire.org Git - thirdparty/freeradius-server.git/log
Alan T. DeKok [Tue, 7 Jun 2022 22:35:27 +0000 (18:35 -0400)]
add tmpl_value_list_insert_tail() which does casting, too.
instead of similar code scattered everywhere.
Alan T. DeKok [Tue, 7 Jun 2022 22:33:57 +0000 (18:33 -0400)]
allow if (!fail) to work correctly.
Alan T. DeKok [Tue, 7 Jun 2022 21:33:56 +0000 (17:33 -0400)]
allocate from the correct parent
Alan T. DeKok [Tue, 7 Jun 2022 20:52:58 +0000 (16:52 -0400)]
-NULL and ~NULL is an error. !NULL is true.
Alan T. DeKok [Tue, 7 Jun 2022 20:48:11 +0000 (16:48 -0400)]
slight tweak to debugging message
Alan T. DeKok [Tue, 7 Jun 2022 16:23:49 +0000 (12:23 -0400)]
typo
Alan T. DeKok [Tue, 14 Jun 2022 22:00:52 +0000 (17:00 -0500)]
Allow %{date:+%A} to mean "Monday"
which mirrors the "date +%A" command on Unix.
Also update the documentation and add examples.
Alan T. DeKok [Tue, 14 Jun 2022 21:54:05 +0000 (16:54 -0500)]
allow %{date:} as a synonym for %{date:now}
James Jones [Thu, 16 Jun 2022 18:39:55 +0000 (13:39 -0500)]
Reassure coverity about the value passed to print_config() (CID #
1504310 ) (#4563)
We can see that print_config() is only called in one spot, from
parse_long_op(), which passes as value the addresss of an auto array
that is guaranteed to contain a possibly empty NUL-terminated string,
suitable for the printc* macros. This being a separatly-compiled
program, we take the portable approach of asserting value is non-
NULL, which we know is true and should convince coverity.
James Jones [Thu, 16 Jun 2022 18:39:32 +0000 (13:39 -0500)]
More annotation of Coverity false positives. (#4568)
This deals with the following CIDs:
1504662 ,
1469149
James Jones [Thu, 16 Jun 2022 18:38:31 +0000 (13:38 -0500)]
Make room for NUL in the extreme case in xlat_config_escape(). (#4569)
The VLA escaped[] can handle the probably unlikely worst case of
every character from the value box requiring MIME encoding...
except that a NUL is appended, so one might as well accommodate
it in that worst case.
Arran Cudbard-Bell [Thu, 16 Jun 2022 18:16:21 +0000 (13:16 -0500)]
Fix typo
Arran Cudbard-Bell [Thu, 16 Jun 2022 14:36:54 +0000 (09:36 -0500)]
Slightly more efficient way of determining trailing zeros for size printing
Arran Cudbard-Bell [Thu, 16 Jun 2022 14:10:11 +0000 (09:10 -0500)]
Minor style issue
Arran Cudbard-Bell [Thu, 16 Jun 2022 13:54:45 +0000 (08:54 -0500)]
Fix fuzzer crash
James Jones [Thu, 16 Jun 2022 13:59:58 +0000 (08:59 -0500)]
Add case that exercises fr_size_to_str() bug and correct the bug. (#4567)
Unfortunately it really needs to know the number of trailing
zeroes in the decimal form as well as binary, which will slow
things to an extent.
Max Khon [Wed, 15 Jun 2022 20:39:26 +0000 (23:39 +0300)]
DHCPv4: Fix sending Lease-Unknown and Lease-Unassigned responses (#4566)
Max Khon [Wed, 15 Jun 2022 20:24:04 +0000 (23:24 +0300)]
Fix rpm build (#4565)
Arran Cudbard-Bell [Wed, 15 Jun 2022 17:20:43 +0000 (12:20 -0500)]
Quiet GCC
Max Khon [Wed, 15 Jun 2022 16:21:38 +0000 (19:21 +0300)]
Fix DHCP Release processing (#4564)
Arran Cudbard-Bell [Wed, 15 Jun 2022 16:14:38 +0000 (11:14 -0500)]
Add separate size printing/parsing functions
Arran Cudbard-Bell [Tue, 14 Jun 2022 18:30:58 +0000 (13:30 -0500)]
Add fr_perror_to_str to help with wasm debugging
Arran Cudbard-Bell [Tue, 14 Jun 2022 18:30:35 +0000 (13:30 -0500)]
Add flag to disable dictionary permissions checks
Arran Cudbard-Bell [Mon, 13 Jun 2022 14:59:09 +0000 (09:59 -0500)]
Initialise the group field for all structural types
Arran Cudbard-Bell [Wed, 8 Jun 2022 16:09:54 +0000 (12:09 -0400)]
Add size printing/parsing
James Jones [Tue, 14 Jun 2022 14:16:58 +0000 (09:16 -0500)]
Check for NULL return from fr_rb_find(). (#4558)
James Jones [Tue, 14 Jun 2022 02:33:13 +0000 (21:33 -0500)]
Still more voiding of calls we know will work. (#4552)
This deals with the following CIDs:
1503974 ,
1504043 ,
1504182 ,
1504183 ,
1504184
Jorge Pereira [Tue, 14 Jun 2022 02:31:25 +0000 (23:31 -0300)]
Missing changes related to
e17c8b6879 (#4560)
James Jones [Mon, 13 Jun 2022 23:16:32 +0000 (18:16 -0500)]
Use MEM() on unchecked fr_value_box_alloc_null() calls (CID #
1504028 ) (#4559)
Max Khon [Sun, 12 Jun 2022 14:09:53 +0000 (17:09 +0300)]
DHCPv4: add back Lease-Query support (#4555)
Arran Cudbard-Bell [Fri, 10 Jun 2022 23:59:44 +0000 (18:59 -0500)]
Just use the standard fr_ipaddr_cmp function
Arran Cudbard-Bell [Fri, 10 Jun 2022 23:59:02 +0000 (18:59 -0500)]
Initialise ipaddr types correctly in fr_value_box_init
Arran Cudbard-Bell [Fri, 10 Jun 2022 23:58:29 +0000 (18:58 -0500)]
Fix garbage test that leads to bad pairs in the test pair list
Arran Cudbard-Bell [Fri, 10 Jun 2022 23:58:02 +0000 (18:58 -0500)]
Make fr_ipaddr_cmp more efficient by only comparing used bytes
Arran Cudbard-Bell [Thu, 9 Jun 2022 04:09:12 +0000 (23:09 -0500)]
More magic WASM flags
Alan T. DeKok [Sat, 11 Jun 2022 22:11:39 +0000 (18:11 -0400)]
on dup, increment both
Alan T. DeKok [Sat, 11 Jun 2022 22:11:27 +0000 (18:11 -0400)]
more "order array"
Alan T. DeKok [Sat, 11 Jun 2022 19:35:54 +0000 (15:35 -0400)]
Always verify fr_sbuff_term_t order when using WITH_VERIFY_PTR
and remove calls to qsort. Since the input arrays must be sorted,
we can simple do an O(n+m) walk over the input arrays
Alan T. DeKok [Sat, 11 Jun 2022 19:00:16 +0000 (15:00 -0400)]
order terminals
Alan T. DeKok [Fri, 10 Jun 2022 13:50:38 +0000 (09:50 -0400)]
compare fields, and don't use memcmp()
Alan T. DeKok [Fri, 10 Jun 2022 13:49:16 +0000 (09:49 -0400)]
make it clearer what we're doing
hex numbers look more like IP addresses than decimal numbers
James Jones [Fri, 10 Jun 2022 01:32:20 +0000 (20:32 -0500)]
Make Coverity happy with encode_nas_filter_rule() (CID #
1503928 ) (#4554)
encode_nas_filter_rule() is never passed a cursor for which
fr_dcursor_current() returns NULL, so the check at the top
of the loop can be eliminated. Coverity should see the assertions
and not complain about the FR_DBUFF_IN_BYTES_RETURN().O
Alan T. DeKok [Thu, 9 Jun 2022 18:48:41 +0000 (14:48 -0400)]
fix clang scan issues
no need to do quicksort on the input, we can just check that it's
already ordered. TBH, if both inputs are already ordered, we can
just walk down both lists doing comparisons in order.
Use clearer variable names.
Simplify the loops so that there are fewer edge cases
Alan T. DeKok [Thu, 9 Jun 2022 14:22:01 +0000 (10:22 -0400)]
add padding to make v4 the same size as v6.
So that when we initialize structures, omitted fields are set to
zero. If we don't have a padding field, then because v4 addresses
are smaller than v6 addresses, the remaining bytes after the v4
addresses are undefined.
Arran Cudbard-Bell [Tue, 7 Jun 2022 16:46:01 +0000 (12:46 -0400)]
Add optional code to catch out of order terminal inputs
Arran Cudbard-Bell [Tue, 7 Jun 2022 16:45:37 +0000 (12:45 -0400)]
Test and fix for correct merging of duplicated terminal sequences
Alan T. DeKok [Tue, 7 Jun 2022 15:50:20 +0000 (11:50 -0400)]
move "" to be first, as expected.
Alan T. DeKok [Tue, 7 Jun 2022 13:20:21 +0000 (09:20 -0400)]
disable develer debugging, and fix compiler warning
Nick Porter [Tue, 7 Jun 2022 12:51:30 +0000 (13:51 +0100)]
remove UNUSED
Nick Porter [Tue, 7 Jun 2022 12:47:21 +0000 (13:47 +0100)]
Network and worker contexts already freed by the threads
Commit
3791b97d60c19e05b218969641164e9384fce7b3 added freeing to the
worker and network threads
Alan T. DeKok [Mon, 6 Jun 2022 20:32:16 +0000 (16:32 -0400)]
let's use the enum
Alan T. DeKok [Mon, 6 Jun 2022 19:39:17 +0000 (15:39 -0400)]
add ipv6 prefix calculations
Alan T. DeKok [Mon, 6 Jun 2022 19:01:24 +0000 (15:01 -0400)]
Remove rlm_expr, and replace with %{expr:...} as a built-in
and update the docs and tests to match.
Alan T. DeKok [Mon, 6 Jun 2022 17:04:37 +0000 (13:04 -0400)]
update fr_calc_unary_op(), add xlat ~, -, !, cleanups, and tests
Alan T. DeKok [Mon, 6 Jun 2022 16:27:30 +0000 (12:27 -0400)]
add support for unary "-" and "~"
Alan T. DeKok [Mon, 6 Jun 2022 16:25:00 +0000 (12:25 -0400)]
add "~" operator
Alan T. DeKok [Sun, 5 Jun 2022 13:54:15 +0000 (09:54 -0400)]
omit optional arguments entirely, instead of passing the wrong type
if an optional argument is missing (i.e. source list is empty),
then we can pass it to the function ONLY if the function accepts
type VOID for that argument.
Otherwise, we have to omit that argument, and all subsequent ones.
Otherwise, we'll pass the wrong data type to a function which
expects to be able to dereference the type-specific field of that
value box, and who knows what will happen.
As a result, any function which takes an optional argument has to
check for non-existence, not for NULL type.
We will reserve NULL types for "error", not for normal usage.
Alan T. DeKok [Fri, 3 Jun 2022 22:29:49 +0000 (18:29 -0400)]
simply omit optional arguments, rather than making them FR_TYPE_NULL
We want FR_TYPE_NULL to mean something else, and we don't want to
use it as a normal result.
Alan T. DeKok [Fri, 3 Jun 2022 19:59:52 +0000 (15:59 -0400)]
add xlat_is_truthy(), to replace COND_TYPE_TRUE and COND_TYPE_FALSE
Alan T. DeKok [Fri, 3 Jun 2022 12:18:54 +0000 (08:18 -0400)]
add fr_value_box_is_truthy() function
as "cast to bool" will parse "yes / no" for strings into true / false
booleans.
Instead for conditions, we want zero-length strings to be false,
and non-zero length strings to be true.
Alan T. DeKok [Fri, 3 Jun 2022 12:04:11 +0000 (08:04 -0400)]
debug_condition is no longer used
Nick Porter [Mon, 6 Jun 2022 18:51:34 +0000 (19:51 +0100)]
LDAP library changes in preparation for LDAP sync (#4549)
* Typo
* Retrieve namingContexts from LDAP directories when establishing their type
* Correct file name
* Define fr_ldap_attrs_check() - check if an LDAP attribute is in a list
* Define structures and enums for parsed LDAP filters
* Move common LDAP config items to a library header
* Move validation of LDAP server conf items to library
* Add OIDs for bit-wise LDAP match rules
* Define functions for parsing LDAP filters
* Add filter.c to ldap library sources
* Define functions for evaluating LDAP filters
Nick Porter [Mon, 6 Jun 2022 16:39:51 +0000 (17:39 +0100)]
Amend building of test certs to avoid `openssl ca` race condition (#4548)
* Amend building of test certs to avoid `openssl ca` race condition
* Ensure vrfy targets have all their dependencies
James Jones [Mon, 6 Jun 2022 14:26:45 +0000 (09:26 -0500)]
Cast to void calla that never fail or where we care only about side effects. (#4547)
This branch deals with the following Coverity defect reports:
1504001 ,
1503991 ,
1504025 (#2 of 2),
1503276 ,
1504185 ,
1504279 ,
1504281
Nick Porter [Mon, 6 Jun 2022 13:04:42 +0000 (14:04 +0100)]
Ensure arrays are zero alloced
Arran Cudbard-Bell [Mon, 6 Jun 2022 02:40:54 +0000 (22:40 -0400)]
Set the right output buffer
Arran Cudbard-Bell [Mon, 6 Jun 2022 00:25:22 +0000 (20:25 -0400)]
Add macro for populating CONF_PARSER with functions
Arran Cudbard-Bell [Mon, 6 Jun 2022 00:24:03 +0000 (20:24 -0400)]
Need atexit in sbuff code
Arran Cudbard-Bell [Mon, 6 Jun 2022 00:22:49 +0000 (20:22 -0400)]
Split out time and time delta printing functions
Arran Cudbard-Bell [Sun, 5 Jun 2022 20:06:48 +0000 (16:06 -0400)]
Unused in debug builds
Arran Cudbard-Bell [Sun, 5 Jun 2022 20:06:00 +0000 (16:06 -0400)]
Use accessors for parsed status
Arran Cudbard-Bell [Sun, 5 Jun 2022 17:22:53 +0000 (13:22 -0400)]
Print file check errors in the context of the pair that specified the file
Arran Cudbard-Bell [Sun, 5 Jun 2022 17:13:01 +0000 (13:13 -0400)]
Whitespace
Arran Cudbard-Bell [Sun, 5 Jun 2022 17:11:50 +0000 (13:11 -0400)]
Refactor parsing code to shut up clang scan
Arran Cudbard-Bell [Sun, 5 Jun 2022 09:34:16 +0000 (05:34 -0400)]
Check all the bits...
Arran Cudbard-Bell [Sun, 5 Jun 2022 09:07:13 +0000 (05:07 -0400)]
const
Arran Cudbard-Bell [Sun, 5 Jun 2022 09:01:37 +0000 (05:01 -0400)]
Break out parse functions more
Arran Cudbard-Bell [Sun, 5 Jun 2022 09:00:51 +0000 (05:00 -0400)]
Helps to use the correct type
Arran Cudbard-Bell [Sun, 5 Jun 2022 06:20:07 +0000 (02:20 -0400)]
Use cf_pair_debug everywhere
Arran Cudbard-Bell [Sun, 5 Jun 2022 06:00:35 +0000 (02:00 -0400)]
Add support for dynamically allocating default values
This allows us to pull defaults from 3rd party libraries, and have them correctly represented in the config tree.
Arran Cudbard-Bell [Sun, 5 Jun 2022 05:58:13 +0000 (01:58 -0400)]
Expand multi type support to all value types
Arran Cudbard-Bell [Sun, 5 Jun 2022 01:51:51 +0000 (21:51 -0400)]
Use valuebox code to parse config items
Removes a significant amount of code and adds support for a large number of additional configuration types
Arran Cudbard-Bell [Sun, 5 Jun 2022 01:40:48 +0000 (21:40 -0400)]
Actually define tacacs max attributes
Arran Cudbard-Bell [Sun, 5 Jun 2022 01:28:38 +0000 (21:28 -0400)]
Formatting
Arran Cudbard-Bell [Sat, 4 Jun 2022 19:40:23 +0000 (15:40 -0400)]
Update autoconf srcs in libraries
Nick Porter [Fri, 3 Jun 2022 16:42:30 +0000 (17:42 +0100)]
Move libldap init to global_lib framework (#4546)
* Define libldap global config options and init / free callbacks
* Move libldap global options to global {} section
* Switch rlm_ldap to use autoinit of ldap library
* Clear old instance tracking from libldap
* Ensure global.d directory is handled correctly by packages
* Allow per module test global library settings
* Move global ldap library settings to correct location for tests
* Include global.d in list of raddb files to install
* WS
* Newline
Co-authored-by: Arran Cudbard-Bell <a.cudbardb@freeradius.org>
Alan T. DeKok [Fri, 3 Jun 2022 01:33:13 +0000 (21:33 -0400)]
last few compiler fixes
Alan T. DeKok [Fri, 3 Jun 2022 00:09:35 +0000 (20:09 -0400)]
typos
Alan T. DeKok [Thu, 2 Jun 2022 20:35:55 +0000 (16:35 -0400)]
forbid !* and =* in conditions.
They're only accepted for backwards compatibility, and there is
newer syntax which does the same thing, and is better.
Alan T. DeKok [Thu, 2 Jun 2022 20:35:04 +0000 (16:35 -0400)]
initialize variable.
maybe this helps with CI crashes?
Alan T. DeKok [Thu, 2 Jun 2022 20:13:13 +0000 (16:13 -0400)]
use bracket rules for terminals
so that we don't confuse the flag parser when parsing
if (foo =~ /bar/i)
and the final ')' is NOT a flag.
Alan T. DeKok [Thu, 2 Jun 2022 19:17:11 +0000 (15:17 -0400)]
resolve strings at parse time, where they're static strings
which don't contain exec, xlat, etc.
Alan T. DeKok [Thu, 2 Jun 2022 17:09:01 +0000 (13:09 -0400)]
special handlers for module return codes
which evalute to "true" if they match.
Alan T. DeKok [Thu, 2 Jun 2022 13:23:17 +0000 (09:23 -0400)]
don't expand structural types when used in "truthy" context
&reply || ...
should NOT get a list of value-boxes out of the reply. Instead,
it should just check for the "truthiness" of &reply.
We still need to add a special case for when a list is used by
itself, as in
if (&reply) { ...
but that can be handled with a few lines of code in the condition
evaluation code.
Alan T. DeKok [Thu, 2 Jun 2022 13:03:22 +0000 (09:03 -0400)]
update truthiness for value-box groups
empty groups are false. non-empty groups are true.
Any other structural types cannot exist in a value-box group.
Alan T. DeKok [Wed, 1 Jun 2022 20:00:06 +0000 (16:00 -0400)]
make exec work, and add tests for it.
Right now we have a hard-coded timeout of 1 second, and no
pairs passed as environment variables.
There isn't really a way to configure global ior per-use settings
for these parameters.
Alan T. DeKok [Wed, 1 Jun 2022 19:59:33 +0000 (15:59 -0400)]
don't treat exec as xlat
Alan T. DeKok [Wed, 1 Jun 2022 14:23:58 +0000 (10:23 -0400)]
fixes and tests for run-time regular expressions
Alan T. DeKok [Wed, 1 Jun 2022 14:23:39 +0000 (10:23 -0400)]
add packet && src/dst IP to xlat tests
Alan T. DeKok [Wed, 1 Jun 2022 14:05:06 +0000 (10:05 -0400)]
add "const"