]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
22 months agoTweaks to the new radius_request_verify function
Arran Cudbard-Bell [Wed, 18 Oct 2023 01:37:15 +0000 (19:37 -0600)] 
Tweaks to the new radius_request_verify function

Rename to radius_secret_verify, as that's what it's doing.  The request has already been verified, we're trying different secrets against the request.

22 months agoUse the same codepath to trigger an exit as the signal handlers
Arran Cudbard-Bell [Wed, 18 Oct 2023 01:17:22 +0000 (19:17 -0600)] 
Use the same codepath to trigger an exit as the signal handlers

This allows other I/O callbacks to complete, so when the server exits, pending I/O events for proto_detail_file should've fired.  This mnay help with the crash on exit

22 months agoInclude missing header
Arran Cudbard-Bell [Tue, 17 Oct 2023 23:37:56 +0000 (17:37 -0600)] 
Include missing header

22 months agoModules should NEVER signal an event loop to exit
Arran Cudbard-Bell [Tue, 17 Oct 2023 23:36:39 +0000 (17:36 -0600)] 
Modules should NEVER signal an event loop to exit

22 months agoAdd %radius_request_verify() xlat
Nick Porter [Mon, 16 Oct 2023 08:39:59 +0000 (09:39 +0100)] 
Add %radius_request_verify() xlat

For verifying dynamic clients against a know shared secret

22 months agoallow relative attributes after DEFINEs
Alan T. DeKok [Tue, 17 Oct 2023 12:15:18 +0000 (08:15 -0400)] 
allow relative attributes after DEFINEs

22 months agomake the tests depend on the RADIUS dictionary
Alan T. DeKok [Tue, 17 Oct 2023 12:13:32 +0000 (08:13 -0400)] 
make the tests depend on the RADIUS dictionary

22 months agoBetter error message
Nick Porter [Tue, 17 Oct 2023 10:31:44 +0000 (11:31 +0100)] 
Better error message

22 months agouse sbuff API to quiet Coverity. CID #1547825
Alan T. DeKok [Mon, 16 Oct 2023 22:30:31 +0000 (18:30 -0400)] 
use sbuff API to quiet Coverity.  CID #1547825

Coverity is too dumb to notice that the buffer is initialized.
However, if we use the sbuff API, then it thinks everything is
fine.

22 months agomove to %file.exists()
Alan T. DeKok [Mon, 16 Oct 2023 22:14:24 +0000 (18:14 -0400)] 
move to %file.exists()

fix typo in deletion of old log file

just use "wc -l FILE", there's no need to "cat" everything

22 months agoremove "hoist vpt->xlat into xlat" in tokenize expression
Alan T. DeKok [Mon, 16 Oct 2023 22:10:58 +0000 (18:10 -0400)] 
remove "hoist vpt->xlat into xlat" in tokenize expression

the hoisting would put the expansion into an XLAT_GROUP, which
meant that any output value-boxes were wrapped in a value-box
group.  Which was distinctly unexpected.

22 months agoadded count argument to %file.tail(). and use it in tests
Alan T. DeKok [Mon, 16 Oct 2023 16:49:49 +0000 (12:49 -0400)] 
added count argument to %file.tail(). and use it in tests

22 months agouse %file.tail()
Alan T. DeKok [Mon, 16 Oct 2023 15:17:06 +0000 (11:17 -0400)] 
use %file.tail()

we haven't implemented "-n2" yet

22 months agoadd %file.tail(), along with tests and bug fixes
Alan T. DeKok [Mon, 16 Oct 2023 15:12:18 +0000 (11:12 -0400)] 
add %file.tail(), along with tests and bug fixes

22 months agomove to using internal file functions
Alan T. DeKok [Mon, 16 Oct 2023 13:13:24 +0000 (09:13 -0400)] 
move to using internal file functions

22 months agomove more functions to their own files
Alan T. DeKok [Mon, 16 Oct 2023 13:04:08 +0000 (09:04 -0400)] 
move more functions to their own files

22 months agomove protocol things to their own file
Alan T. DeKok [Mon, 16 Oct 2023 12:38:39 +0000 (08:38 -0400)] 
move protocol things to their own file

22 months agoadd and document log.warn() and log.err()
Alan T. DeKok [Mon, 16 Oct 2023 12:34:10 +0000 (08:34 -0400)] 
add and document log.warn() and log.err()

22 months agosplit up builtin functions, as there are many of them
Alan T. DeKok [Mon, 16 Oct 2023 12:28:09 +0000 (08:28 -0400)] 
split up builtin functions, as there are many of them

22 months agoadd file handling functions
Alan T. DeKok [Mon, 16 Oct 2023 12:20:49 +0000 (08:20 -0400)] 
add file handling functions

22 months agoadd a number of file-based functions
Alan T. DeKok [Sun, 15 Oct 2023 22:16:53 +0000 (18:16 -0400)] 
add a number of file-based functions

22 months agoRevert "we don't need to do "cat X | foo" when we can do "foo X""
Alan T. DeKok [Sun, 15 Oct 2023 19:07:29 +0000 (15:07 -0400)] 
Revert "we don't need to do "cat X | foo" when we can do "foo X""

This reverts commit 7771539fb4397a7831b07fe0330536e6a55a7356.

revert until we have time to track it down a bit more

22 months agowe don't need to do "cat X | foo" when we can do "foo X"
Alan T. DeKok [Sun, 15 Oct 2023 18:48:43 +0000 (14:48 -0400)] 
we don't need to do "cat X | foo" when we can do "foo X"

22 months agoremove accidental character
Alan T. DeKok [Sun, 15 Oct 2023 18:08:22 +0000 (14:08 -0400)] 
remove accidental character

22 months agovoid malloc / free
Alan T. DeKok [Sun, 15 Oct 2023 18:03:02 +0000 (14:03 -0400)] 
void malloc / free

just use local buffer, which is big enough for IPv6 prefixes,
floats, etc.

22 months agouse correct API
Alan T. DeKok [Sun, 15 Oct 2023 17:44:56 +0000 (13:44 -0400)] 
use correct API

fr_value_box_aprint() does not print quotation characters around
strings, even if escaping rules are passed to it.

Instead, we need to call fr_value_box_aprint_quoted(), which
will do the right thing.

22 months agopassing a NULL escape rules doesn't mean "print integer value"
Alan T. DeKok [Sun, 15 Oct 2023 13:49:46 +0000 (09:49 -0400)] 
passing a NULL escape rules doesn't mean "print integer value"

we instead have to copy the box, and nuke the enum name from
the box.

While we're at it, refuse to print structural types, too

22 months agostart of cleaning up escaping rules
Alan T. DeKok [Sun, 15 Oct 2023 13:35:37 +0000 (09:35 -0400)] 
start of cleaning up escaping rules

note that fr_value_box_print() does NOT respect tainting

fix a few callers to just re-implement print_quoted()

22 months agoremove %integer() from the tests
Alan T. DeKok [Sun, 15 Oct 2023 12:54:34 +0000 (08:54 -0400)] 
remove %integer() from the tests

22 months agono need to pass T_BARE_WORD to print_quoted. Just call print
Alan T. DeKok [Sun, 15 Oct 2023 13:25:59 +0000 (09:25 -0400)] 
no need to pass T_BARE_WORD to print_quoted.  Just call print

22 months agoremove unnecessary header
Alan T. DeKok [Sun, 15 Oct 2023 12:23:45 +0000 (08:23 -0400)] 
remove unnecessary header

22 months agovalidate oddities in casting
Alan T. DeKok [Thu, 12 Oct 2023 20:16:29 +0000 (16:16 -0400)] 
validate oddities in casting

(string) &foo[*] returnis a list of value-boxes, each cast
to a string

(string) (&foo[*]) return one string, which is all of the
value-boxes concatenated together

and update documentation

22 months agoUpdate inline docs for builtin xlats
Nick Porter [Fri, 13 Oct 2023 14:55:04 +0000 (15:55 +0100)] 
Update inline docs for builtin xlats

22 months agoDon't delete .work file if there are outstanding requests
Nick Porter [Fri, 13 Oct 2023 11:16:37 +0000 (12:16 +0100)] 
Don't delete .work file if there are outstanding requests

22 months agojust use %l or %c directly
Alan T. DeKok [Thu, 12 Oct 2023 20:04:03 +0000 (16:04 -0400)] 
just use %l or %c directly

there's no need to convert them to dates, and then cast them to
integers.  Those expansions are already integers

22 months agotypo
Alan T. DeKok [Thu, 12 Oct 2023 18:35:42 +0000 (14:35 -0400)] 
typo

22 months agostop on empty buffer, too.
Alan T. DeKok [Thu, 12 Oct 2023 17:57:09 +0000 (13:57 -0400)] 
stop on empty buffer, too.

The fr_pair_list_afrom_str() function should really be converted
to sbuffs, but that isn't immediately trivial.

It expect to see NUL-terminated C strings, and will misbehave
if given bad data.  Happily, all of the stgring value-boxes in
the server are zero-terminated, so this isn't much of an issue.

The same goes for input from unit_test_attribute.

22 months agoadd assertion for paranoia
Alan T. DeKok [Thu, 12 Oct 2023 16:53:35 +0000 (12:53 -0400)] 
add assertion for paranoia

22 months agodocs corrections
Nick Porter [Thu, 12 Oct 2023 15:36:21 +0000 (16:36 +0100)] 
docs corrections

22 months agoadd end check to loop limit
Alan T. DeKok [Thu, 12 Oct 2023 15:29:14 +0000 (11:29 -0400)] 
add end check to loop limit

and remove end check inside of loop.

The fr_struct_from_network() function will also enforce "end"

22 months agodocument "retransmit=no"
Alan T. DeKok [Thu, 12 Oct 2023 14:11:13 +0000 (10:11 -0400)] 
document "retransmit=no"

22 months agoretry.count is incremented by fr_retry_next()
Nick Porter [Thu, 12 Oct 2023 14:18:06 +0000 (15:18 +0100)] 
retry.count is incremented by fr_retry_next()

22 months agoif we're not retransmitting, mark done even on failure
Alan T. DeKok [Thu, 12 Oct 2023 14:08:56 +0000 (10:08 -0400)] 
if we're not retransmitting, mark done even on failure

22 months agonote limitations
Alan T. DeKok [Wed, 11 Oct 2023 20:01:17 +0000 (16:01 -0400)] 
note limitations

22 months agoDebug output correction
Nick Porter [Wed, 11 Oct 2023 21:27:36 +0000 (22:27 +0100)] 
Debug output correction

22 months agolist overrides are not allowed
Alan T. DeKok [Wed, 11 Oct 2023 19:55:47 +0000 (15:55 -0400)] 
list overrides are not allowed

The edit.c code calls fr_pair_list_afrom_str(), which does NOT
handle list over-rides.

Plus, we are assigning to a list as

&list += "pairs = value"

so having a list override does not make sense.

22 months agobetter error messages, so that we know what's going on
Alan T. DeKok [Wed, 11 Oct 2023 19:53:44 +0000 (15:53 -0400)] 
better error messages, so that we know what's going on

22 months agojust use the right comparison
Alan T. DeKok [Wed, 11 Oct 2023 14:37:50 +0000 (10:37 -0400)] 
just use the right comparison

22 months agoempty lists are equal when compared via ==
Alan T. DeKok [Wed, 11 Oct 2023 14:06:20 +0000 (10:06 -0400)] 
empty lists are equal when compared via ==

22 months agoadd %test.fail() which always returns XLAT_ACTION_FAIL
Alan T. DeKok [Wed, 11 Oct 2023 14:04:39 +0000 (10:04 -0400)] 
add %test.fail() which always returns XLAT_ACTION_FAIL

22 months agomake !(a == b) the same as (a != b)
Alan T. DeKok [Wed, 11 Oct 2023 12:26:28 +0000 (08:26 -0400)] 
make !(a == b) the same as (a != b)

22 months agoclarify error
Alan T. DeKok [Wed, 11 Oct 2023 12:18:26 +0000 (08:18 -0400)] 
clarify error

22 months agoupdate antora config
Matthew Newton [Tue, 10 Oct 2023 16:16:35 +0000 (17:16 +0100)] 
update antora config

22 months agodon't always try and be clever with the package version
Matthew Newton [Tue, 10 Oct 2023 14:01:25 +0000 (15:01 +0100)] 
don't always try and be clever with the package version

22 months agoadd dist version checks from v3
Matthew Newton [Tue, 10 Oct 2023 14:00:00 +0000 (15:00 +0100)] 
add dist version checks from v3

22 months agoupdate version.sh to cope with a prerelease
Matthew Newton [Tue, 10 Oct 2023 13:39:24 +0000 (14:39 +0100)] 
update version.sh to cope with a prerelease

22 months agofix version.sh output when we're on a tag
Matthew Newton [Tue, 10 Oct 2023 11:20:16 +0000 (12:20 +0100)] 
fix version.sh output when we're on a tag

22 months agouse commas in function args and other cleanups
Alan T. DeKok [Tue, 10 Oct 2023 00:53:19 +0000 (20:53 -0400)] 
use commas in function args and other cleanups

22 months agoallow &foo := {} to mean "delete leaf attributes"
Alan T. DeKok [Tue, 10 Oct 2023 00:45:53 +0000 (20:45 -0400)] 
allow &foo := {} to mean "delete leaf attributes"

because if the RHS is a dynamic expansion which returns no values,
that's what it means there

22 months agouse the correct array offsets.
Alan T. DeKok [Mon, 9 Oct 2023 19:40:23 +0000 (15:40 -0400)] 
use the correct array offsets.

Perhaps these changes should stop

22 months agoquiet static analyzer
Alan T. DeKok [Mon, 9 Oct 2023 19:25:20 +0000 (15:25 -0400)] 
quiet static analyzer

if we didn't find any match, return false

22 months agoread the debug output a bit more and fix the tests
Alan T. DeKok [Mon, 9 Oct 2023 19:23:32 +0000 (15:23 -0400)] 
read the debug output a bit more and fix the tests

22 months agomove this back to before &&/|| changes
Alan T. DeKok [Mon, 9 Oct 2023 17:59:29 +0000 (13:59 -0400)] 
move this back to before &&/|| changes

22 months agotry to quiet clang scan
Alan T. DeKok [Mon, 9 Oct 2023 17:41:58 +0000 (13:41 -0400)] 
try to quiet clang scan

22 months agoseparate out && and || code, and clean up tests
Alan T. DeKok [Mon, 9 Oct 2023 17:22:26 +0000 (13:22 -0400)] 
separate out && and || code, and clean up tests

22 months agomove %(foo:) to new syntax
Alan T. DeKok [Mon, 9 Oct 2023 16:32:24 +0000 (12:32 -0400)] 
move %(foo:) to new syntax

22 months agomove to new syntax
Alan T. DeKok [Mon, 9 Oct 2023 16:11:21 +0000 (12:11 -0400)] 
move to new syntax

perl -p -i -e 's/%\(([a-zA-Z0-0._-]+):([a-zA-Z0-9.]+)\)/%$1\($2\)/g'   $(git grep -lE '%\([a-z]+:' src/tests/keywords/)

perl -p -i -e 's/%\(([a-zA-Z0-0._-]+):%{([^%{}]+)}\)/%$1\(%{$2}\)/g'   $(git grep -lE '%\([a-z]+:' src/tests/keywords/)

22 months agoconver to new function syntax
Alan T. DeKok [Mon, 9 Oct 2023 16:04:49 +0000 (12:04 -0400)] 
conver to new function syntax

22 months agomore remove alternation :-
Alan T. DeKok [Mon, 9 Oct 2023 15:49:01 +0000 (11:49 -0400)] 
more remove alternation :-

22 months agocatch corner cases of && and ||
Alan T. DeKok [Mon, 9 Oct 2023 15:14:32 +0000 (11:14 -0400)] 
catch corner cases of && and ||

where there's no input, so the output shouldn't exist, either

22 months agoremove alternation
Alan T. DeKok [Mon, 9 Oct 2023 13:22:52 +0000 (09:22 -0400)] 
remove alternation

22 months agoAlign xlat function debug with new function call format
Nick Porter [Mon, 9 Oct 2023 15:04:10 +0000 (16:04 +0100)] 
Align xlat function debug with new function call format

22 months agoUpdate LDAP tests
Nick Porter [Mon, 9 Oct 2023 14:28:53 +0000 (15:28 +0100)] 
Update LDAP tests

22 months agoRemove unnecessary ""
Nick Porter [Mon, 9 Oct 2023 14:00:53 +0000 (15:00 +0100)] 
Remove unnecessary ""

22 months agoRevert "auto-convert LDAP"
Alan T. DeKok [Mon, 9 Oct 2023 13:18:40 +0000 (09:18 -0400)] 
Revert "auto-convert LDAP"

This reverts commit b4af84428990140af855f5ca7a6ecbc7790cc4bf.

Nope.  LDAP tests fail.  Reverting until we do the conversion
manually.

22 months agoauto-convert functions with fixed string arguments
Alan T. DeKok [Mon, 9 Oct 2023 13:09:33 +0000 (09:09 -0400)] 
auto-convert functions with fixed string arguments

perl -p -i -e "s/%{([a-zA-Z0-9._-]+):([^&%{}=']+)}/%\$1('\$2')/g"  $(git grep -lE '%\{[a-z0-9.-]+:' src/tests/keywords/ src/tests/modules)

22 months agoauto-convert LDAP
Alan T. DeKok [Mon, 9 Oct 2023 13:06:08 +0000 (09:06 -0400)] 
auto-convert LDAP

perl -p -i -e 's/"%{ldap:(.*?)}"/%ldap("$1")/' $(git grep -lE '%\{[a-z]+:' src/tests/modules/)

22 months agoauto-convert SQL
Alan T. DeKok [Mon, 9 Oct 2023 13:04:03 +0000 (09:04 -0400)] 
auto-convert SQL

perl -p -i -e 's/"%{sql:(.*?)}"/%sql("$1")/' $(git grep -lE '%\{[a-z]+:' src/tests/modules/)

22 months agomore auto-conversion
Alan T. DeKok [Mon, 9 Oct 2023 13:00:36 +0000 (09:00 -0400)] 
more auto-conversion

perl -p -i -e "s/%{([a-zA-Z0-9._-]+):([a-zA-Z0-9.]+)}/%\$1('\$2')/g"  $(git grep -lE '%\{[a-z0-9.-]+:' src/tests/keywords/ src/tests/modules)

22 months agoauto-convert to new syntax
Alan T. DeKok [Mon, 9 Oct 2023 12:52:10 +0000 (08:52 -0400)] 
auto-convert to new syntax

perl -p -i -e 's/%{([a-zA-Z0-9._-]+):%{([a-zA-Z0-9._-]+)}}/%$1(%{$2})/g'  $(git grep -lE '%\{[a-z]+:' src/tests/keywords/)

22 months agoCoverity #1547098
Alan T. DeKok [Mon, 9 Oct 2023 12:37:00 +0000 (08:37 -0400)] 
Coverity #1547098

22 months agoadd missing case
Alan T. DeKok [Sun, 8 Oct 2023 17:18:08 +0000 (13:18 -0400)] 
add missing case

22 months agoadd log.debug() and log.info()
Alan T. DeKok [Sun, 8 Oct 2023 16:37:48 +0000 (12:37 -0400)] 
add log.debug() and log.info()

so that we can log to the normal request log in unlang

22 months agoadd "request" destination for linelog
Alan T. DeKok [Sun, 8 Oct 2023 16:37:26 +0000 (12:37 -0400)] 
add "request" destination for linelog

so that it can log to the normal request log

22 months agoremove old text
Alan T. DeKok [Sun, 8 Oct 2023 13:32:00 +0000 (09:32 -0400)] 
remove old text

22 months agostupid local compiler misses things
Alan T. DeKok [Sun, 8 Oct 2023 13:25:19 +0000 (09:25 -0400)] 
stupid local compiler misses things

22 months agoremove %expr()
Alan T. DeKok [Sun, 8 Oct 2023 13:15:03 +0000 (09:15 -0400)] 
remove %expr()

22 months agomore typos
Alan T. DeKok [Sun, 8 Oct 2023 13:13:08 +0000 (09:13 -0400)] 
more typos

22 months agoshow which condition failed to parse
Alan T. DeKok [Sun, 8 Oct 2023 13:11:40 +0000 (09:11 -0400)] 
show which condition failed to parse

22 months agotypo
Alan T. DeKok [Sun, 8 Oct 2023 12:57:16 +0000 (08:57 -0400)] 
typo

22 months agoupdate redis tests to not use %expr
Alan T. DeKok [Sun, 8 Oct 2023 12:37:39 +0000 (08:37 -0400)] 
update redis tests to not use %expr

22 months agoquiet static analyzer
Alan T. DeKok [Sun, 8 Oct 2023 12:37:07 +0000 (08:37 -0400)] 
quiet static analyzer

22 months agomore "get rid of expr"
Alan T. DeKok [Sun, 8 Oct 2023 12:03:26 +0000 (08:03 -0400)] 
more "get rid of expr"

22 months agoget rid of backticks in tests
Alan T. DeKok [Sun, 8 Oct 2023 12:03:57 +0000 (08:03 -0400)] 
get rid of backticks in tests

22 months agodon't pull casts into in-place expressions
Alan T. DeKok [Sun, 8 Oct 2023 12:00:32 +0000 (08:00 -0400)] 
don't pull casts into in-place expressions

because that would change how the text inside of the expression
is parsed, and we don't want that

22 months agodon't allow unresolved functions at runtime
Alan T. DeKok [Sun, 8 Oct 2023 00:47:59 +0000 (20:47 -0400)] 
don't allow unresolved functions at runtime

because otherwise xlat_resolve() will call xlat_bootstrap_func(),
which modifies the xlat_inst_tree at runtime, from a child thread

22 months agojust move everything to xlat_bootstrap()
Alan T. DeKok [Sun, 8 Oct 2023 00:32:42 +0000 (20:32 -0400)] 
just move everything to xlat_bootstrap()

22 months agoquiet static analyzer
Alan T. DeKok [Sat, 7 Oct 2023 21:58:11 +0000 (17:58 -0400)] 
quiet static analyzer

22 months agoadd xlat wrapper function for bootstrap / instantiate ephemeral
Alan T. DeKok [Sat, 7 Oct 2023 21:29:21 +0000 (17:29 -0400)] 
add xlat wrapper function for bootstrap / instantiate ephemeral

* xlat_bootstrap() - when reading the configuration files
  pretty much only called by xlat_redundant()

* xlat_instantiate_ephemeral() - when we have a #request_t and
  are parsing things at run-time

* xlat_finalize() - when we have a #tmpl_rules_t, and we're not
  sure if we're run-time or config load time.

The issue is that the various xlat tokenize funtions call each
other in different combinations.  The only way to consistently
know if we're run-time or config time is via the #tmpl_rules_t.

This change (also via previous commits) allows us to get rid of
the various public tokenize_ephemeral() functions, which were
confusing the issue.

22 months agoensure runtime_el is set
Alan T. DeKok [Sat, 7 Oct 2023 18:18:34 +0000 (14:18 -0400)] 
ensure runtime_el is set

and instantiate ephemeral xlats in tmpl_tokenize