]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
8 months agonotes on "don't use exec, it's slow"
Alan T. DeKok [Sun, 4 May 2025 00:23:20 +0000 (20:23 -0400)] 
notes on "don't use exec, it's slow"

8 months agonotes on v4
Alan T. DeKok [Sat, 3 May 2025 13:54:26 +0000 (09:54 -0400)] 
notes on v4

8 months agoadd %regex.search()
Alan T. DeKok [Sat, 3 May 2025 12:15:37 +0000 (08:15 -0400)] 
add %regex.search()

8 months agoSet start = 0 in SQLite test
Nick Porter [Fri, 2 May 2025 19:28:48 +0000 (20:28 +0100)] 
Set start = 0 in SQLite test

To verify correct behaviour when initial query launches connection

8 months agoSQLite queries which start in backlog will yield - so resume
Nick Porter [Fri, 2 May 2025 17:00:41 +0000 (18:00 +0100)] 
SQLite queries which start in backlog will yield - so resume

Setting `start = 0` in the database pool, causes the first query to go
into a backlog while the connection opens.

Without resuming the request, connections keep spawning and the request
never completes.

8 months agouse the new timer functions
Alan T. DeKok [Fri, 2 May 2025 16:56:54 +0000 (12:56 -0400)] 
use the new timer functions

which makes the retry code significantly simpler

8 months agofinalize the timer functionality
Alan T. DeKok [Fri, 2 May 2025 11:23:14 +0000 (07:23 -0400)] 
finalize the timer functionality

8 months agodon't assert i!prev
Alan T. DeKok [Fri, 2 May 2025 15:25:25 +0000 (11:25 -0400)] 
don't assert i!prev

the next bit of code actually checks for prev

8 months agoremove duplicate code
Alan T. DeKok [Fri, 2 May 2025 14:31:49 +0000 (10:31 -0400)] 
remove duplicate code

8 months agoPython and Lua do support nested attributes now
Nick Porter [Fri, 2 May 2025 13:55:08 +0000 (14:55 +0100)] 
Python and Lua do support nested attributes now

8 months agoadd shared timer lists, which only insert a uctx
Alan T. DeKok [Thu, 1 May 2025 20:39:27 +0000 (16:39 -0400)] 
add shared timer lists, which only insert a uctx

some timer lists contain a large amount of entries, but also
all share the same callback.  Instead of allocating tons of
memory for each fr_timer_event_t, we just allocate a special list,
where every event shares one fr_timer_event_t in the parent.

8 months agoupdate copyright
Alan T. DeKok [Fri, 2 May 2025 10:18:18 +0000 (06:18 -0400)] 
update copyright

8 months agouse fr_cmp_t, instead of fr_lst_cmp_t, as they are the same
Alan T. DeKok [Thu, 1 May 2025 20:24:37 +0000 (16:24 -0400)] 
use fr_cmp_t, instead of fr_lst_cmp_t, as they are the same

8 months agodocs: Add rlm_lua module howto
Nick Porter [Fri, 2 May 2025 09:47:49 +0000 (10:47 +0100)] 
docs: Add rlm_lua module howto

8 months agoUpdate example.lua
Nick Porter [Fri, 2 May 2025 09:45:00 +0000 (10:45 +0100)] 
Update example.lua

8 months agoUpdate docs from latest raddb
Nick Porter [Fri, 2 May 2025 09:42:03 +0000 (10:42 +0100)] 
Update docs from latest raddb

8 months agoAdd test of attribute deletion from rlm_lua
Nick Porter [Fri, 2 May 2025 09:32:55 +0000 (10:32 +0100)] 
Add test of attribute deletion from rlm_lua

8 months agoAdd tests of invalid attribute setting from rlm_lua
Nick Porter [Thu, 1 May 2025 16:47:45 +0000 (17:47 +0100)] 
Add tests of invalid attribute setting from rlm_lua

8 months agoAdd tests of attribute access / setting in rlm_lua
Nick Porter [Thu, 1 May 2025 16:19:20 +0000 (17:19 +0100)] 
Add tests of attribute access / setting in rlm_lua

8 months agoAdd function descriptions
Nick Porter [Thu, 1 May 2025 13:03:21 +0000 (14:03 +0100)] 
Add function descriptions

8 months agoUpdate _lua_list_iterator_init to use fr_lua_pair_t userdata
Nick Porter [Thu, 1 May 2025 12:56:08 +0000 (13:56 +0100)] 
Update _lua_list_iterator_init to use fr_lua_pair_t userdata

So the iterator can work over any list.

8 months agoTidy up _lua_pair_iterator
Nick Porter [Thu, 1 May 2025 12:48:53 +0000 (13:48 +0100)] 
Tidy up _lua_pair_iterator

and make it return the first attribute instance correctly.

8 months agoFix _lua_pair_iterator_init() to use fr_lua_pair_t as userdata
Nick Porter [Thu, 1 May 2025 12:47:35 +0000 (13:47 +0100)] 
Fix _lua_pair_iterator_init() to use fr_lua_pair_t as userdata

8 months agoAdd _lua_pair_setter
Nick Porter [Thu, 1 May 2025 12:40:00 +0000 (13:40 +0100)] 
Add _lua_pair_setter

Used as the __newindex metafunction for all pair tables.

This allows sanity checking so that setting is only valid when doing so
on a specific instnace of a leaf pair.

When amending an existing pair, only its value is changed so that
pointers to the pair remain consistent.

8 months agoAdd fr_lua_parent_build
Nick Porter [Thu, 1 May 2025 12:33:58 +0000 (13:33 +0100)] 
Add fr_lua_parent_build

To build out parent attributes when setting a leaf whose parents don't
exist

8 months agoChange fr_lua_unmarshal to just populate a box
Nick Porter [Thu, 1 May 2025 12:29:30 +0000 (13:29 +0100)] 
Change fr_lua_unmarshal to just populate a box

To avoid allocating a new pair and replacing it in the list when
updating existing pairs.

8 months agoUse a common accessor for pair and pair instance
Nick Porter [Thu, 1 May 2025 12:05:01 +0000 (13:05 +0100)] 
Use a common accessor for pair and pair instance

Which simplifies allowing for `fr.request['foo']['bar'][1]` rather than
`fr.request['foo'][1]['bar'][1]`

The type of the requested index can be used to determine what is
happening.

8 months agoUse _lua_pair_init to add all the lists to the fr table
Nick Porter [Thu, 1 May 2025 11:24:14 +0000 (12:24 +0100)] 
Use _lua_pair_init to add all the lists to the fr table

8 months agoOnly call _lua_fr_request_register if there is a request
Nick Porter [Thu, 1 May 2025 11:21:30 +0000 (12:21 +0100)] 
Only call _lua_fr_request_register if there is a request

8 months agoDefine _lua_pair_init()
Nick Porter [Thu, 1 May 2025 11:19:32 +0000 (12:19 +0100)] 
Define _lua_pair_init()

To create a lua table representing a pair

8 months agoDefine a fr_lua_pair_t
Nick Porter [Thu, 1 May 2025 11:10:59 +0000 (12:10 +0100)] 
Define a fr_lua_pair_t

To use as userdata for accessing / setting pairs using lua

8 months agoReturn a table of child attribute names for structural attributes
Nick Porter [Thu, 1 May 2025 11:00:04 +0000 (12:00 +0100)] 
Return a table of child attribute names for structural attributes

8 months agoRemove unused dcursor
Nick Porter [Thu, 1 May 2025 10:53:59 +0000 (11:53 +0100)] 
Remove unused dcursor

The iterator init allocates the cursor which is actually used.

8 months agoComment out packet types which don't have a recv section
Nick Porter [Thu, 1 May 2025 07:50:36 +0000 (08:50 +0100)] 
Comment out packet types which don't have a recv section

8 months agoPacify GCC
Nick Porter [Thu, 1 May 2025 17:17:34 +0000 (18:17 +0100)] 
Pacify GCC

8 months agoMake behaviour consistent so that we _always_ pop top frames
Arran Cudbard-Bell [Thu, 1 May 2025 20:43:32 +0000 (16:43 -0400)] 
Make behaviour consistent so that we _always_ pop top frames

Previously we weren't and this was causing repeat and signal callbacks to be skipped.  It was also meaning request_done wasn't being called.

8 months agoFix typo in stack dump
Arran Cudbard-Bell [Thu, 1 May 2025 20:42:32 +0000 (16:42 -0400)] 
Fix typo in stack dump

8 months agoPrint out continue points in stack debugs
Arran Cudbard-Bell [Thu, 1 May 2025 18:53:55 +0000 (14:53 -0400)] 
Print out continue points in stack debugs

8 months agodocs: make docsite build fix. Updated sqlippool links (introduction >> troubleshootin...
nolade [Thu, 1 May 2025 16:17:55 +0000 (12:17 -0400)] 
docs: make docsite build fix. Updated sqlippool links (introduction >> troubleshooting >> datastores)

8 months agodocs: make docsite build fix. Update subrequest.adoc with try/catch links.
nolade [Thu, 1 May 2025 18:27:09 +0000 (14:27 -0400)] 
docs: make docsite build fix. Update subrequest.adoc with try/catch links.

8 months agodocs: make docsite build fix. Updated cache files (table needed end-delimter)
nolade [Thu, 1 May 2025 19:25:16 +0000 (15:25 -0400)] 
docs: make docsite build fix. Updated cache files (table needed end-delimter)

8 months agorename and tweak
Alan T. DeKok [Thu, 1 May 2025 18:41:02 +0000 (14:41 -0400)] 
rename and tweak

8 months agodocs: Add raduat tool info to Antora repo
nolade [Tue, 29 Apr 2025 21:19:29 +0000 (17:19 -0400)] 
docs: Add raduat tool info to Antora repo

docs: import raduat information from wiki, salt repo, and raduat script

8 months agoJust add a "continue" point flag. It's less code.
Arran Cudbard-Bell [Thu, 1 May 2025 18:36:31 +0000 (14:36 -0400)] 
Just add a "continue" point flag.  It's less code.

8 months agouse less memory. Don't allocate struct and then over-write it ci-debug
Alan T. DeKok [Thu, 1 May 2025 16:05:30 +0000 (12:05 -0400)] 
use less memory.  Don't allocate struct and then over-write it

8 months agoadd / update list disarm / arm, which is only for sub-lists
Alan T. DeKok [Thu, 1 May 2025 14:55:33 +0000 (10:55 -0400)] 
add / update list disarm / arm, which is only for sub-lists

when a list is disarmed, its events aren't run.  Events can still
be added to it.  But because its event has been removed from the
parent timer, no events will ever run.

when a list is re-armed, it runs all events which have been
pending during the disarm period.  The caller is likely to clean
up events before re-arming the list

8 months agoadd support for 'continue'
Alan T. DeKok [Thu, 1 May 2025 11:55:44 +0000 (07:55 -0400)] 
add support for 'continue'

along with documentation and tests

8 months agoallow "break" inside of "case"
Alan T. DeKok [Thu, 1 May 2025 11:19:44 +0000 (07:19 -0400)] 
allow "break" inside of "case"

and "switch" is then marked as the break point.

Also update the "break" checks to use the flags instead of
unlang types

8 months agoretry limits return timeout, not fail
Alan T. DeKok [Thu, 1 May 2025 11:03:48 +0000 (07:03 -0400)] 
retry limits return timeout, not fail

8 months agotweak and refer to rcode table
Alan T. DeKok [Thu, 1 May 2025 11:01:22 +0000 (07:01 -0400)] 
tweak and refer to rcode table

8 months agodocument timeout rcode
Alan T. DeKok [Thu, 1 May 2025 11:01:17 +0000 (07:01 -0400)] 
document timeout rcode

8 months agouflags don't unwind anything anymore
Arran Cudbard-Bell [Wed, 30 Apr 2025 20:24:30 +0000 (16:24 -0400)] 
uflags don't unwind anything anymore

8 months agoEnsure old is initialised in all code paths
Arran Cudbard-Bell [Wed, 30 Apr 2025 19:42:37 +0000 (15:42 -0400)] 
Ensure old is initialised in all code paths

8 months agoShutup GCC
Arran Cudbard-Bell [Wed, 30 Apr 2025 19:28:32 +0000 (15:28 -0400)] 
Shutup GCC

8 months agoMake redundant work with "timeout"
Arran Cudbard-Bell [Wed, 30 Apr 2025 19:18:03 +0000 (15:18 -0400)] 
Make redundant work with "timeout"

8 months agoInitialise break/return depth to a frame deeper than the current one in the stack...
Arran Cudbard-Bell [Wed, 30 Apr 2025 18:37:42 +0000 (14:37 -0400)] 
Initialise break/return depth to a frame deeper than the current one in the stack if we're not actually breaking or returning

8 months agoCheck we have a stack as is done elsewhere
Arran Cudbard-Bell [Wed, 30 Apr 2025 18:37:13 +0000 (14:37 -0400)] 
Check we have a stack as is done elsewhere

8 months agoUpdate docs for timeout/catch
Arran Cudbard-Bell [Wed, 30 Apr 2025 18:28:19 +0000 (14:28 -0400)] 
Update docs for timeout/catch

Mostly removing evidence of its previous existence

8 months agoLack of siblings to catch sections should not trigger an assert
Arran Cudbard-Bell [Wed, 30 Apr 2025 18:16:03 +0000 (14:16 -0400)] 
Lack of siblings to catch sections should not trigger an assert

Lack of catch section should not trigger a warning

8 months agoRemove timeout { ... } catch { ... } and add support for timeout rcodes
Arran Cudbard-Bell [Wed, 30 Apr 2025 18:15:26 +0000 (14:15 -0400)] 
Remove timeout { ... } catch { ... }  and add support for timeout rcodes

timeout { ... }  now sets a timeout rcode that can be caught like any other code.

8 months agoRegression tests for try/catch
Arran Cudbard-Bell [Wed, 30 Apr 2025 18:13:58 +0000 (14:13 -0400)] 
Regression tests for try/catch

8 months agoMove success out of the catch section, this ensure execution continues
Arran Cudbard-Bell [Wed, 30 Apr 2025 18:13:24 +0000 (14:13 -0400)] 
Move success out of the catch section, this ensure execution continues

8 months agoLog what we're catching
Arran Cudbard-Bell [Wed, 30 Apr 2025 18:13:00 +0000 (14:13 -0400)] 
Log what we're catching

8 months agoIf we pass a NULL next to frame_set_next, just return calculate result, and NULLify...
Arran Cudbard-Bell [Wed, 30 Apr 2025 18:12:11 +0000 (14:12 -0400)] 
If we pass a NULL next to frame_set_next, just return calculate result, and NULLify the frame->next pointer

8 months agoAdd a timeout rcode
Arran Cudbard-Bell [Wed, 30 Apr 2025 18:11:42 +0000 (14:11 -0400)] 
Add a timeout rcode

This causes process modules to not respond to requests

8 months agoRemove interpreter stop callback
Arran Cudbard-Bell [Wed, 30 Apr 2025 04:13:01 +0000 (00:13 -0400)] 
Remove interpreter stop callback

Simplify use of request master state

8 months agoframe_pop can pop the top frame too
Arran Cudbard-Bell [Wed, 30 Apr 2025 04:11:54 +0000 (00:11 -0400)] 
frame_pop can pop the top frame too

8 months agoWe don't need to set the result when we're cancelling the request
Arran Cudbard-Bell [Tue, 29 Apr 2025 23:51:36 +0000 (19:51 -0400)] 
We don't need to set the result when we're cancelling the request

8 months agoMove to synchronous stack unwinding on cancellation
Arran Cudbard-Bell [Tue, 29 Apr 2025 23:15:59 +0000 (19:15 -0400)] 
Move to synchronous stack unwinding on cancellation

Don't set break and return points in stack frames, represent them as intrinsic properties of operations.

Add "op" flags for brackets, set rcode, return point and break point.

8 months agoCheck alloc
Arran Cudbard-Bell [Tue, 29 Apr 2025 23:10:48 +0000 (19:10 -0400)] 
Check alloc

8 months agoWS
Arran Cudbard-Bell [Tue, 29 Apr 2025 23:10:03 +0000 (19:10 -0400)] 
WS

WS

WS

WS

8 months agoMove unwind frame flags into an enum
Arran Cudbard-Bell [Tue, 29 Apr 2025 23:08:14 +0000 (19:08 -0400)] 
Move unwind frame flags into an enum

8 months agos/UNWIND_FLAG/UNWIND_FRAME_FLAG/g
Arran Cudbard-Bell [Tue, 29 Apr 2025 23:04:12 +0000 (19:04 -0400)] 
s/UNWIND_FLAG/UNWIND_FRAME_FLAG/g

8 months agos/unlang_frame_signal/unlang_stack_signal/g
Arran Cudbard-Bell [Tue, 29 Apr 2025 23:01:03 +0000 (19:01 -0400)] 
s/unlang_frame_signal/unlang_stack_signal/g

8 months agoDon't need to set fields to false for unlang ops
Arran Cudbard-Bell [Tue, 29 Apr 2025 22:56:07 +0000 (18:56 -0400)] 
Don't need to set fields to false for unlang ops

8 months agoshut up compiler
Alan T. DeKok [Wed, 30 Apr 2025 19:29:55 +0000 (15:29 -0400)] 
shut up compiler

it's too dumb to see that to_cast is initialized on all paths

8 months agorename "proto = detail" to "handler = detail"
Alan T. DeKok [Wed, 30 Apr 2025 19:05:41 +0000 (15:05 -0400)] 
rename "proto = detail" to "handler = detail"

"proto" is still accepted for compatibility.

However, it was too generic / conflicting, and was therefore
confusing.

Similarly, there were comments saying "listen load" would use
name2 to open the "load" module.  But name2 is now used for
something else, and the code was deleted a long time ago.

8 months agocomplain when no 'send foo' section is found for reply 'foo'
Alan T. DeKok [Wed, 30 Apr 2025 18:21:42 +0000 (14:21 -0400)] 
complain when no 'send foo' section is found for reply 'foo'

However, this is not a fatal error.  Arguably, it should be a
compile-time error and not a run-time error.  But it's hard to
automatically correlate 'recv foo' with 'send reply-to-foo' as
there can be many different kinds of replies.

Having it a run-time error also means that the admin gets warned
on every packet, which means that they are slightly more likely
to read it and then do something about it.

8 months agoevery 'type = foo' also requires a 'recv foo'
Alan T. DeKok [Wed, 30 Apr 2025 18:04:30 +0000 (14:04 -0400)] 
every 'type = foo' also requires a 'recv foo'

otherwise the server won't be able to process packets!

8 months agoall listeners must have a 'transport' section
Alan T. DeKok [Wed, 30 Apr 2025 17:36:01 +0000 (13:36 -0400)] 
all listeners must have a 'transport' section

8 months agoevery listener MUST have an "open" call
Alan T. DeKok [Wed, 30 Apr 2025 17:30:08 +0000 (13:30 -0400)] 
every listener MUST have an "open" call

as a development requirement

8 months agorefuse to start when no 'listen' sections are configured.
Alan T. DeKok [Wed, 30 Apr 2025 17:12:11 +0000 (13:12 -0400)] 
refuse to start when no 'listen' sections are configured.

It helps to fail with a descriptive error, rather than silently
doing the wrong thing.

8 months agoIgnore packaging system upgrade produced config files
Nick Porter [Wed, 30 Apr 2025 13:47:28 +0000 (14:47 +0100)] 
Ignore packaging system upgrade produced config files

Both deb and rpm packaging systems will detect changed config files and
create extra files, which if we load them will create conflicts.

8 months agoAdd notes on rlm_python changes to upgrade doc
Nick Porter [Wed, 30 Apr 2025 11:19:50 +0000 (12:19 +0100)] 
Add notes on rlm_python changes to upgrade doc

8 months agodocs: Reorganized sqlippool section and 1st pass edit on content.
nolade [Fri, 25 Apr 2025 20:59:37 +0000 (16:59 -0400)] 
docs: Reorganized sqlippool section and 1st pass edit on content.

Reorganize SQL-IP-POOL section and xref/link updates

8 months agoreplace %{1} with %regex.match(1)
Alan T. DeKok [Tue, 29 Apr 2025 14:46:24 +0000 (10:46 -0400)] 
replace %{1} with %regex.match(1)

like some other languages.

The unfortunate outcome is that this makes a lot of things much
more complex visually.  But it's a bit more consistent with the
rest of the xlat functions.  And, for the v4 way of "less magic
and fewer special cases".

For now, %{1} etc. is still functional

and enable %regex.match() in non-PCRE builds

8 months ago%regex() -> %regex.match()
Alan T. DeKok [Tue, 29 Apr 2025 14:29:18 +0000 (10:29 -0400)] 
%regex() -> %regex.match()

8 months agodoc: import customer docs Recover SQL IP Pools (HIVE 3406)
nolade [Mon, 28 Apr 2025 21:15:28 +0000 (17:15 -0400)] 
doc: import customer docs Recover SQL IP Pools (HIVE 3406)

8 months agoadd test for local variables in subrequest
Alan T. DeKok [Tue, 29 Apr 2025 13:43:18 +0000 (09:43 -0400)] 
add test for local variables in subrequest

8 months agoAllow local variables in subrequests
Nick Porter [Tue, 29 Apr 2025 07:32:26 +0000 (08:32 +0100)] 
Allow local variables in subrequests

8 months agoit helps to update this, too
Alan T. DeKok [Mon, 28 Apr 2025 16:23:04 +0000 (12:23 -0400)] 
it helps to update this, too

8 months agoallow replication to TCP sockets
Alan T. DeKok [Mon, 28 Apr 2025 15:51:27 +0000 (11:51 -0400)] 
allow replication to TCP sockets

where we need a trunk, and a new set of callback functions

8 months agopacket verification is handled in the BIO callbacks
Alan T. DeKok [Mon, 28 Apr 2025 15:46:50 +0000 (11:46 -0400)] 
packet verification is handled in the BIO callbacks

by the rlm_radius_verify() function.

ideally, we should also move any tracking checks and decode
routines to that function, too

8 months agodon't convert the input key to a string
Alan T. DeKok [Mon, 28 Apr 2025 12:05:48 +0000 (08:05 -0400)] 
don't convert the input key to a string

we're hashing it for load-balance purposes.  So we can just hash
the raw data.

and since tmpl_expand() now produces errors, we don't need to

8 months agojust use fr_value_box_cast() in tmpl_to_type
Alan T. DeKok [Mon, 28 Apr 2025 11:57:15 +0000 (07:57 -0400)] 
just use fr_value_box_cast() in tmpl_to_type

as it means there are fewer corner cases in the code.

and add RDEBUG messages, so that the caller gets told when things
go wrong.

note that this function is only called from a few places:

tmpl_dcursor, which needs uint8_t

ldap maps, sql maps, attr_filter, and load-balance, which all
need strings.

8 months agoresolve tmpls before returning them to LDAP
Alan T. DeKok [Mon, 28 Apr 2025 19:51:35 +0000 (15:51 -0400)] 
resolve tmpls before returning them to LDAP

8 months agounconnected replication sockets can only be UDP
Alan T. DeKok [Mon, 28 Apr 2025 19:27:47 +0000 (15:27 -0400)] 
unconnected replication sockets can only be UDP

8 months agoAdd test to proxy detached subrequest
Nick Porter [Mon, 28 Apr 2025 14:23:00 +0000 (15:23 +0100)] 
Add test to proxy detached subrequest

and missing files from rlm_radius originate test

8 months agoSubrequests are talloc'd not reserved from the slab
Nick Porter [Mon, 28 Apr 2025 14:07:53 +0000 (15:07 +0100)] 
Subrequests are talloc'd not reserved from the slab

8 months agoAdd redis xlat tests
Nick Porter [Mon, 28 Apr 2025 12:12:56 +0000 (13:12 +0100)] 
Add redis xlat tests

Checking for:

 - basic SET / GET
 - return of NULL can fall back to an alternate value
 - return of multiple values with HMGET