]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
4 years agoadd tests for assignment operations
Alan T. DeKok [Sat, 20 Nov 2021 14:46:00 +0000 (09:46 -0500)] 
add tests for assignment operations

4 years agoadd binary op array
Alan T. DeKok [Sat, 20 Nov 2021 14:18:14 +0000 (09:18 -0500)] 
add binary op array

4 years agoadd function to manage assignment operations
Alan T. DeKok [Sat, 20 Nov 2021 14:13:15 +0000 (09:13 -0500)] 
add function to manage assignment operations

4 years agoadd MUL and DIV
Alan T. DeKok [Sat, 20 Nov 2021 14:12:58 +0000 (09:12 -0500)] 
add MUL and DIV

and rename errors due to floating point issues

4 years agoadd and use fr_value_box_cast_to_float()
Alan T. DeKok [Fri, 19 Nov 2021 21:43:46 +0000 (16:43 -0500)] 
add and use fr_value_box_cast_to_float()

4 years agoset output on success, not on error
Alan T. DeKok [Fri, 19 Nov 2021 21:28:49 +0000 (16:28 -0500)] 
set output on success, not on error

4 years agorename function
Alan T. DeKok [Fri, 19 Nov 2021 21:12:05 +0000 (16:12 -0500)] 
rename function

we will later have unary / self-modifying functions.  So it's
best to have consistent names from the start

4 years agocreate and use T_ADD, T_SUB, T_MUL, and T_DIV
Alan T. DeKok [Fri, 19 Nov 2021 21:00:29 +0000 (16:00 -0500)] 
create and use T_ADD, T_SUB, T_MUL, and T_DIV

note that we don't (yet) add them to fr_tokens_table[]

That's because attribute names have "-" in them.  Adding "-" as
a token means that we no longer parse attribute names in the
same way.

The solution is likely to update the various pair parsers to
avoid the 1999-era gettoken() APIs, and instead use more modern
equivalents.

For now, we just define and use add/sub/mul/div for the various
calc tests.

4 years agomove T_OP_PREPEND
Alan T. DeKok [Fri, 19 Nov 2021 20:33:09 +0000 (15:33 -0500)] 
move T_OP_PREPEND

so that it's with the other assignment operators

4 years agoupdate use of T_TOKEN_LAST
Alan T. DeKok [Fri, 19 Nov 2021 20:20:52 +0000 (15:20 -0500)] 
update use of T_TOKEN_LAST

it's not part of the enum, it's the number of elements in the enum

4 years agouse token-dependent initializers.
Alan T. DeKok [Fri, 19 Nov 2021 20:16:21 +0000 (15:16 -0500)] 
use token-dependent initializers.

don't depend on implicit ordering

4 years agoT_OP_ADD / T_OP_SUB -> T_OP_ADD_EQ / T_OP_SUB_EQ
Alan T. DeKok [Fri, 19 Nov 2021 19:49:40 +0000 (14:49 -0500)] 
T_OP_ADD / T_OP_SUB -> T_OP_ADD_EQ / T_OP_SUB_EQ

because they have an equals sign, too.  This change is in preparation
for allowing many more tokens

4 years agoRevert "add debugging to see if we can find out where it's crashing"
Alan T. DeKok [Fri, 19 Nov 2021 19:42:39 +0000 (14:42 -0500)] 
Revert "add debugging to see if we can find out where it's crashing"

This reverts commit 3baea0df017f1b3ccd47472071517bab2e1fef05.

suspicions about the source of the issue were correct.

4 years agodoesn't hurt to free this
Alan T. DeKok [Fri, 19 Nov 2021 15:50:31 +0000 (10:50 -0500)] 
doesn't hurt to free this

4 years agoreturn the VP only if the allocate_update was successful
Alan T. DeKok [Fri, 19 Nov 2021 15:38:26 +0000 (10:38 -0500)] 
return the VP only if the allocate_update was successful

4 years agomore used / unused
Alan T. DeKok [Fri, 19 Nov 2021 15:05:32 +0000 (10:05 -0500)] 
more used / unused

when we cast to a fixed-size leaf type, we never allocate
memory.

4 years agoGNU Makefile can't handle directories (#4314)
Jorge Pereira [Fri, 19 Nov 2021 14:32:57 +0000 (11:32 -0300)] 
GNU Makefile can't handle directories (#4314)

4 years agorearrange to have integer tests first
Alan T. DeKok [Fri, 19 Nov 2021 14:30:12 +0000 (09:30 -0500)] 
rearrange to have integer tests first

4 years agoremove duplicate flags merge.
Alan T. DeKok [Fri, 19 Nov 2021 14:16:30 +0000 (09:16 -0500)] 
remove duplicate flags merge.

it's already done at the bottom of the loop

4 years agoprepare for pure xlats
Alan T. DeKok [Fri, 19 Nov 2021 14:11:04 +0000 (09:11 -0500)] 
prepare for pure xlats

4 years agomight as well make this larger
Alan T. DeKok [Thu, 18 Nov 2021 21:59:28 +0000 (16:59 -0500)] 
might as well make this larger

4 years agoadd debugging to see if we can find out where it's crashing
Alan T. DeKok [Thu, 18 Nov 2021 21:55:54 +0000 (16:55 -0500)] 
add debugging to see if we can find out where it's crashing

once we find it, this commit will be reverted

4 years agoshut up clang scan
Alan T. DeKok [Thu, 18 Nov 2021 20:35:17 +0000 (15:35 -0500)] 
shut up clang scan

4 years agocatch more corner cases
Alan T. DeKok [Thu, 18 Nov 2021 19:40:42 +0000 (14:40 -0500)] 
catch more corner cases

about the only time we can't handle overflow is when we do things
like

   uint64 foo - int64 INT64_MIN -> uint64

arguably the RHS should be converted to uint64.  Perhaps we'll
do that as a later step.

4 years agomore checks and add calc_integer_size
Alan T. DeKok [Thu, 18 Nov 2021 19:24:22 +0000 (14:24 -0500)] 
more checks and add calc_integer_size

4 years agomore tests and cleanups
Alan T. DeKok [Thu, 18 Nov 2021 18:37:36 +0000 (13:37 -0500)] 
more tests and cleanups

4 years agoadd integer to integer math
Alan T. DeKok [Thu, 18 Nov 2021 17:59:08 +0000 (12:59 -0500)] 
add integer to integer math

with upcasting of intermediate results to the largest integer
type which can hold the value.  And then finally cast to the
final type when we have the result.

4 years agonow that the base errors are better, rely on them
Alan T. DeKok [Thu, 18 Nov 2021 01:26:59 +0000 (20:26 -0500)] 
now that the base errors are better, rely on them

instead of doubling up on errors

4 years agoRevert "shut up clang on OSX"
Alan T. DeKok [Wed, 17 Nov 2021 22:10:09 +0000 (17:10 -0500)] 
Revert "shut up clang on OSX"

This reverts commit c9e90a0435e271e397edbbdb8971a905cff0f108.

nope.  causes all kinds of other errors

4 years agoshut up clang on OSX
Alan T. DeKok [Wed, 17 Nov 2021 21:37:40 +0000 (16:37 -0500)] 
shut up clang on OSX

4 years agoreturn correct error
Alan T. DeKok [Wed, 17 Nov 2021 19:48:46 +0000 (14:48 -0500)] 
return correct error

4 years agogive humanly readable error message
Alan T. DeKok [Wed, 17 Nov 2021 19:45:07 +0000 (14:45 -0500)] 
give humanly readable error message

4 years agouse sbuffs and check sbuff usage
Alan T. DeKok [Wed, 17 Nov 2021 19:31:57 +0000 (14:31 -0500)] 
use sbuffs and check sbuff usage

4 years agoadvance the input buffer, so we know what was parsed
Alan T. DeKok [Wed, 17 Nov 2021 19:44:16 +0000 (14:44 -0500)] 
advance the input buffer, so we know what was parsed

4 years agoremove unused assignment
Alan T. DeKok [Wed, 17 Nov 2021 19:09:01 +0000 (14:09 -0500)] 
remove unused assignment

4 years agoreorder types
Alan T. DeKok [Wed, 17 Nov 2021 18:25:16 +0000 (13:25 -0500)] 
reorder types

the ordered table in value.c didn't match the fr_type_t enum.

We now have all integer types together.  All unsigned types
together.  And all signed types together.

4 years agoparse only as much as necessary for IP addresses and prefixes
Alan T. DeKok [Wed, 17 Nov 2021 18:15:06 +0000 (13:15 -0500)] 
parse only as much as necessary for IP addresses and prefixes

4 years agoadd rules for ip addresses, hostnames, and prefixes
Alan T. DeKok [Wed, 17 Nov 2021 18:05:38 +0000 (13:05 -0500)] 
add rules for ip addresses, hostnames, and prefixes

4 years agowe don't need host name lookups
Alan T. DeKok [Wed, 17 Nov 2021 17:26:20 +0000 (12:26 -0500)] 
we don't need host name lookups

4 years agoinet_pton() on OSX doesn't accept "127.0" as 127.0.0.0
Alan T. DeKok [Wed, 17 Nov 2021 17:24:58 +0000 (12:24 -0500)] 
inet_pton() on OSX doesn't accept "127.0" as 127.0.0.0

despite what the documentation says.

But getaddrinfo() does accept it.  So when we turn off hostname
lookups, IP address parsing fails.

Work around it by just doing the work ourselves.

4 years agostart of calculation and comparison API
Alan T. DeKok [Tue, 16 Nov 2021 21:06:04 +0000 (16:06 -0500)] 
start of calculation and comparison API

4 years agofix typo: left not right
Alan T. DeKok [Tue, 16 Nov 2021 17:03:41 +0000 (12:03 -0500)] 
fix typo: left not right

4 years agouse correct name
Alan T. DeKok [Tue, 16 Nov 2021 17:03:17 +0000 (12:03 -0500)] 
use correct name

4 years agomove "parse type + value" into common function
Alan T. DeKok [Tue, 16 Nov 2021 16:26:55 +0000 (11:26 -0500)] 
move "parse type + value" into common function

in preparation for adding new functionality

4 years agoensure tokens table are the correct size
Alan T. DeKok [Tue, 16 Nov 2021 01:15:50 +0000 (20:15 -0500)] 
ensure tokens table are the correct size

and use better initializers, so that we can reorder the tokens
without having to manually reorder multiple arrays

4 years agoadd more data types to "cast to bool"
Alan T. DeKok [Tue, 16 Nov 2021 00:44:39 +0000 (19:44 -0500)] 
add more data types to "cast to bool"

4 years agoT_HASH is the end of equality operators
Alan T. DeKok [Tue, 16 Nov 2021 00:40:23 +0000 (19:40 -0500)] 
T_HASH is the end of equality operators

this change means we can add new operators without changing this
definition

4 years agoadd function to insert list after another one
Alan T. DeKok [Sun, 14 Nov 2021 19:58:23 +0000 (14:58 -0500)] 
add function to insert list after another one

4 years agobetter error messages for inline attribute editing
Alan T. DeKok [Sun, 14 Nov 2021 13:58:40 +0000 (08:58 -0500)] 
better error messages for inline attribute editing

4 years agoadd fr_edit_list_free_children()
Alan T. DeKok [Sun, 14 Nov 2021 03:07:15 +0000 (22:07 -0500)] 
add fr_edit_list_free_children()

which will clear the children of a structural type

4 years ago"edit value then delete" gets moved to the tail of the edit list
Alan T. DeKok [Sat, 13 Nov 2021 18:38:19 +0000 (13:38 -0500)] 
"edit value then delete" gets moved to the tail of the edit list

4 years agoadd insert/delete tests
Alan T. DeKok [Sat, 13 Nov 2021 18:31:26 +0000 (13:31 -0500)] 
add insert/delete tests

4 years agoadd "edit value then delete" tests
Alan T. DeKok [Sat, 13 Nov 2021 18:19:28 +0000 (13:19 -0500)] 
add "edit value then delete" tests

4 years agore-init the deleted pairs list on abort
Alan T. DeKok [Sat, 13 Nov 2021 18:30:14 +0000 (13:30 -0500)] 
re-init the deleted pairs list on abort

because the pairs will be moved to their correct place by
edit_undo()

4 years agodon't re-insert edit structure on "value then delete"
Alan T. DeKok [Sat, 13 Nov 2021 18:13:02 +0000 (13:13 -0500)] 
don't re-insert edit structure on "value then delete"

4 years agoadd replace_value() and tweak API
Alan T. DeKok [Sat, 13 Nov 2021 17:53:53 +0000 (12:53 -0500)] 
add replace_value() and tweak API

4 years agoadd hint for edit list size
Alan T. DeKok [Sat, 13 Nov 2021 13:50:34 +0000 (08:50 -0500)] 
add hint for edit list size

so that all of the edits can (generally) live in a contiguous
region of memory, and then be freed all at once.

4 years agoif we free on abort, we might as well make commit into free
Alan T. DeKok [Sat, 13 Nov 2021 13:44:57 +0000 (08:44 -0500)] 
if we free on abort, we might as well make commit into free

4 years agono need to call talloc_free() after aborting the edits
Alan T. DeKok [Fri, 12 Nov 2021 21:50:32 +0000 (16:50 -0500)] 
no need to call talloc_free() after aborting the edits

4 years agoScheduled fuzzing: Merge and push pack the corpus (#4313)
Terry Burton [Fri, 12 Nov 2021 23:19:34 +0000 (23:19 +0000)] 
Scheduled fuzzing: Merge and push pack the corpus (#4313)

4 years agoremove dead store
Alan T. DeKok [Fri, 12 Nov 2021 21:43:47 +0000 (16:43 -0500)] 
remove dead store

4 years agowe can't edit values of structural pairs
Alan T. DeKok [Fri, 12 Nov 2021 21:32:06 +0000 (16:32 -0500)] 
we can't edit values of structural pairs

4 years agoinsert_after tests
Alan T. DeKok [Fri, 12 Nov 2021 21:21:56 +0000 (16:21 -0500)] 
insert_after tests

4 years agominor notes
Alan T. DeKok [Fri, 12 Nov 2021 21:21:45 +0000 (16:21 -0500)] 
minor notes

4 years agodon't free VP, pair_delete() does that
Alan T. DeKok [Fri, 12 Nov 2021 21:19:28 +0000 (16:19 -0500)] 
don't free VP, pair_delete() does that

4 years agorearrange / rename API, and add fr_edit_list_replace()
Alan T. DeKok [Fri, 12 Nov 2021 20:56:40 +0000 (15:56 -0500)] 
rearrange / rename API, and add fr_edit_list_replace()

4 years agoremove INSERT_BEFORE, and update API
Alan T. DeKok [Fri, 12 Nov 2021 16:34:23 +0000 (11:34 -0500)] 
remove INSERT_BEFORE, and update API

4 years agowe only need INSERT as insert after
Alan T. DeKok [Fri, 12 Nov 2021 16:26:58 +0000 (11:26 -0500)] 
we only need INSERT as insert after

4 years agotry to shut up clang scan
Alan T. DeKok [Fri, 12 Nov 2021 16:25:50 +0000 (11:25 -0500)] 
try to shut up clang scan

4 years agoadd edit lists and tests
Alan T. DeKok [Thu, 11 Nov 2021 22:13:05 +0000 (17:13 -0500)] 
add edit lists and tests

so that we can edit lists "in place", and then undo the edits
if anything goes wrong.

4 years agofunctions return fr_pair_t*, not void*
Alan T. DeKok [Thu, 11 Nov 2021 21:57:26 +0000 (16:57 -0500)] 
functions return fr_pair_t*, not void*

4 years agocheck correct variable, and allow "pos" to be NULL
Alan T. DeKok [Thu, 11 Nov 2021 21:52:25 +0000 (16:52 -0500)] 
check correct variable, and allow "pos" to be NULL

which lets us insert things at the start of the list.

4 years agoTidy up ephemeral module_ctx_t struct creation
Arran Cudbard-Bell [Fri, 12 Nov 2021 02:06:02 +0000 (20:06 -0600)] 
Tidy up ephemeral module_ctx_t struct creation

4 years agoCorrect fix for rlm_sql_cassandra
Arran Cudbard-Bell [Thu, 11 Nov 2021 22:23:09 +0000 (16:23 -0600)] 
Correct fix for rlm_sql_cassandra

4 years agoUnbound needs the inst name for xlats
Arran Cudbard-Bell [Thu, 11 Nov 2021 22:13:44 +0000 (16:13 -0600)] 
Unbound needs the inst name for xlats

4 years agoSync up module and instance data name
Arran Cudbard-Bell [Thu, 11 Nov 2021 22:12:02 +0000 (16:12 -0600)] 
Sync up module and instance data name

4 years agoFix arguments to cassandra
Arran Cudbard-Bell [Thu, 11 Nov 2021 22:10:26 +0000 (16:10 -0600)] 
Fix arguments to cassandra

4 years agoUse correct mctx fields in rlm_rest
Arran Cudbard-Bell [Thu, 11 Nov 2021 22:01:08 +0000 (16:01 -0600)] 
Use correct mctx fields in rlm_rest

4 years agoMark command_encode_dns_labels as nonnull
Arran Cudbard-Bell [Thu, 11 Nov 2021 21:05:18 +0000 (15:05 -0600)] 
Mark command_encode_dns_labels as nonnull

4 years agoUse structures to pass arguments to instantiation and detach functions
Arran Cudbard-Bell [Thu, 11 Nov 2021 21:00:46 +0000 (15:00 -0600)] 
Use structures to pass arguments to instantiation and detach functions

4 years agoKeep a pointer to the module instance in the thread instance
Arran Cudbard-Bell [Wed, 10 Nov 2021 21:36:06 +0000 (15:36 -0600)] 
Keep a pointer to the module instance in the thread instance

4 years agoRemove mctx->instance
Arran Cudbard-Bell [Wed, 10 Nov 2021 21:17:25 +0000 (15:17 -0600)] 
Remove mctx->instance

It's annoying having the same data twice.  There's also tons of places this data is cached

4 years agouse appropriate error functions
Alan T. DeKok [Wed, 10 Nov 2021 18:50:23 +0000 (13:50 -0500)] 
use appropriate error functions

which mean we don't need LOG_PREFIX here

4 years agoPass the private version of dl_inst down in the mctx
Arran Cudbard-Bell [Wed, 10 Nov 2021 17:41:26 +0000 (11:41 -0600)] 
Pass the private version of dl_inst down in the mctx

4 years agoMake TEST_CHECK_*() macros display stringified _got (#4310)
James Jones [Wed, 10 Nov 2021 01:44:18 +0000 (19:44 -0600)] 
Make TEST_CHECK_*() macros display stringified _got (#4310)

4 years agoConditionalize the definition of ALLOC_REQ() (#4309)
James Jones [Wed, 10 Nov 2021 00:12:01 +0000 (18:12 -0600)] 
Conditionalize the definition of ALLOC_REQ() (#4309)

4 years agoshut up compiler
Alan T. DeKok [Tue, 9 Nov 2021 23:46:28 +0000 (18:46 -0500)] 
shut up compiler

4 years agobe a bit more forgiving around registering xlats
Alan T. DeKok [Tue, 9 Nov 2021 20:35:55 +0000 (15:35 -0500)] 
be a bit more forgiving around registering xlats

for module instances like "foo { ... }" versus "foo bar { ... }".
if the xlat is already registered, don't do anything.  If it isn't
registered, then register it

4 years agono need to cache CONF_SECTION
Alan T. DeKok [Tue, 9 Nov 2021 20:18:00 +0000 (15:18 -0500)] 
no need to cache CONF_SECTION

4 years agono need to print the name
Alan T. DeKok [Tue, 9 Nov 2021 20:14:59 +0000 (15:14 -0500)] 
no need to print the name

the module isn't going away until after it's data has been freed.

4 years agoadd 'const' here, too
Alan T. DeKok [Tue, 9 Nov 2021 19:11:58 +0000 (14:11 -0500)] 
add 'const' here, too

4 years agoadd 'const'
Alan T. DeKok [Tue, 9 Nov 2021 19:11:00 +0000 (14:11 -0500)] 
add 'const'

4 years agoremove rlm_ldap_t from fr_ldap_thread_t
Alan T. DeKok [Tue, 9 Nov 2021 18:02:30 +0000 (13:02 -0500)] 
remove rlm_ldap_t from fr_ldap_thread_t

the only use of thread->inst uses thread->inst->config, which is
already cached in thread->config

4 years agoremove unnecessary pointer indirection, and make config 'const'
Alan T. DeKok [Tue, 9 Nov 2021 17:52:49 +0000 (12:52 -0500)] 
remove unnecessary pointer indirection, and make config 'const'

4 years agono need to call it mod_instantiate()
Alan T. DeKok [Tue, 9 Nov 2021 14:49:24 +0000 (09:49 -0500)] 
no need to call it mod_instantiate()

everything else uses instantiate()

4 years agoremove unused prototype
Alan T. DeKok [Tue, 9 Nov 2021 14:45:50 +0000 (09:45 -0500)] 
remove unused prototype

4 years agoRemove redundant comparisons (#4307)
James Jones [Tue, 9 Nov 2021 17:25:55 +0000 (11:25 -0600)] 
Remove redundant comparisons (#4307)

4 years agomake sure we catch 0 iterations in the $PBKDF2$... format, too
Matthew Newton [Tue, 9 Nov 2021 17:06:51 +0000 (17:06 +0000)] 
make sure we catch 0 iterations in the $PBKDF2$... format, too

4 years agoWorking trunk tests (#4306)
James Jones [Tue, 9 Nov 2021 14:32:50 +0000 (08:32 -0600)] 
Working trunk tests (#4306)

* Enable working trunk tests

All time function usage is updated to use the new API.

* Change to make test_connection_start_on_enqueue() work

The code added causes the event to handle the backlogged request
to run, the absence of which throws off all the following checks.

4 years agodon't bother using "rlm_" prefixes everywhere. They're not needed
Alan T. DeKok [Mon, 8 Nov 2021 19:56:30 +0000 (14:56 -0500)] 
don't bother using "rlm_" prefixes everywhere.  They're not needed

use "foo - bar" for names, as that's being used elsewhere, too

and the output looks cleaner.