]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
4 years agoAllow relative attributes in SQL. nested_coding
Alan T. DeKok [Sat, 10 Apr 2021 13:24:34 +0000 (09:24 -0400)] 
Allow relative attributes in SQL.

And add test cases for it.

4 years agomake sql_foo tests depend on rlm_sql.la, too
Alan T. DeKok [Sat, 10 Apr 2021 13:14:00 +0000 (09:14 -0400)] 
make sql_foo tests depend on rlm_sql.la, too

4 years agoremove unused prototypes
Alan T. DeKok [Sat, 10 Apr 2021 11:55:47 +0000 (07:55 -0400)] 
remove unused prototypes

4 years agomake sql_pair_list_afrom_str() private
Alan T. DeKok [Sat, 10 Apr 2021 11:53:38 +0000 (07:53 -0400)] 
make sql_pair_list_afrom_str() private

in preparation for updating it's API to use relative attributes

4 years agoallow for relative attribute names in files on disk
Alan T. DeKok [Fri, 9 Apr 2021 21:10:19 +0000 (17:10 -0400)] 
allow for relative attribute names in files on disk

foo = { },
.bar = baz,  # will go into foo

foo = { bar = baz }
.arg = 1 # will go into foo
yes = 43 # no leading '.', will not go into "foo"

This won't work for multiple layers of nesting.  i.e. you can't
do "..bar" to back 2 levels.

4 years agoinstall process_*.so, too
Alan T. DeKok [Fri, 9 Apr 2021 16:33:09 +0000 (12:33 -0400)] 
install process_*.so, too

4 years agocall internal function instead of public one
Alan T. DeKok [Fri, 9 Apr 2021 15:31:31 +0000 (11:31 -0400)] 
call internal function instead of public one

in preparation for adding support for relative attributes

4 years agoif we're recursing into a group, parent is the group attribute
Alan T. DeKok [Fri, 9 Apr 2021 14:54:55 +0000 (10:54 -0400)] 
if we're recursing into a group, parent is the group attribute

4 years agoallow empty groups
Alan T. DeKok [Fri, 9 Apr 2021 14:51:33 +0000 (10:51 -0400)] 
allow empty groups

4 years agotemporarily mangle it all onto one line
Alan T. DeKok [Fri, 9 Apr 2021 14:40:44 +0000 (10:40 -0400)] 
temporarily mangle it all onto one line

unit_test_module hasn't been updated for the nested decoder
changes.  So if you give it a flat list, it will create a flat
list.

For now, just put it all onto one line.  This gives us time
to fix fr_pair_list_afrom_file() to read "relative" attributes

4 years agoupdate count
Alan T. DeKok [Fri, 9 Apr 2021 14:14:10 +0000 (10:14 -0400)] 
update count

4 years agorespect the "concat" flag when decoding TLVs
Alan T. DeKok [Fri, 9 Apr 2021 13:51:32 +0000 (09:51 -0400)] 
respect the "concat" flag when decoding TLVs

and add digest tests for the same.

4 years agono need for "tmp" in the name. It's just "append"
Alan T. DeKok [Fri, 9 Apr 2021 13:41:21 +0000 (09:41 -0400)] 
no need for "tmp" in the name.  It's just "append"

4 years agounique errors for unique circumstances
Alan T. DeKok [Fri, 9 Apr 2021 12:56:47 +0000 (08:56 -0400)] 
unique errors for unique circumstances

4 years agoadd fr_pair_list_from_dcursor() macro
Alan T. DeKok [Fri, 9 Apr 2021 12:51:47 +0000 (08:51 -0400)] 
add fr_pair_list_from_dcursor() macro

which converts a dcursor back to an fr_pair_list_t

4 years agofix up "debug hex" printing
Alan T. DeKok [Fri, 9 Apr 2021 12:50:35 +0000 (08:50 -0400)] 
fix up "debug hex" printing

so that it actually printes out the vendor numbers,
and also shows that some attributes are truncated

4 years agoallow "concat" for TLV types in RADIUS.
Alan T. DeKok [Fri, 9 Apr 2021 12:21:16 +0000 (08:21 -0400)] 
allow "concat" for TLV types in RADIUS.

and ensure that setting the flag doesn't change the behavior
for attributes of type "octets"

4 years agoflags are exclusive
Alan T. DeKok [Fri, 9 Apr 2021 12:20:42 +0000 (08:20 -0400)] 
flags are exclusive

4 years agoreset request->module to NULL
Alan T. DeKok [Fri, 9 Apr 2021 11:38:14 +0000 (07:38 -0400)] 
reset request->module to NULL

when unlang calls the process function, it thinks that it's
calling a module, so it sets request->module = name of process
function.

This means that all debug messages (such as "received packet")
are printed out, prefixed with the process name.  This makes
debug messages harder to read.

Since the first thing the process function does is call an unlang
section, we can safely set request->module=NULL, which omits the
"radius - " prefix from the packet we're printing

4 years agomove debug printing for "receive" to process function
Alan T. DeKok [Fri, 9 Apr 2021 11:34:40 +0000 (07:34 -0400)] 
move debug printing for "receive" to process function

4 years agoprint out partial names if we have a parent
Alan T. DeKok [Fri, 9 Apr 2021 11:25:35 +0000 (07:25 -0400)] 
print out partial names if we have a parent

this is so that the code handles flat and nested names.
Once all of the decoders are converted to using nested names,
AND the unlang interpreter forbids the creation of flat names,
these functions should be updated to just print vp->da->name

4 years agoSet the destructor on the gctx we just allocated
Arran Cudbard-Bell [Thu, 8 Apr 2021 16:10:58 +0000 (17:10 +0100)] 
Set the destructor on the gctx we just allocated

4 years agoclean up in an attempt to shut up the compiler
Alan T. DeKok [Fri, 9 Apr 2021 11:03:47 +0000 (07:03 -0400)] 
clean up in an attempt to shut up the compiler

4 years agoadd tests for encode / decode of digest attributes
Alan T. DeKok [Thu, 8 Apr 2021 22:00:56 +0000 (18:00 -0400)] 
add tests for encode / decode of digest attributes

4 years agomove code to shut up clang
Alan T. DeKok [Thu, 8 Apr 2021 21:21:23 +0000 (17:21 -0400)] 
move code to shut up clang

4 years agoallow for PAIR_ENCODE_SKIPPED
Alan T. DeKok [Thu, 8 Apr 2021 21:02:27 +0000 (17:02 -0400)] 
allow for PAIR_ENCODE_SKIPPED

because people might put the wrong thing into a child group/tlv
OR they might put something which shouldn't be encoded here.

4 years agoallow encoding of nested Vendor-Specific / Vendor types
Alan T. DeKok [Thu, 8 Apr 2021 20:51:46 +0000 (16:51 -0400)] 
allow encoding of nested Vendor-Specific / Vendor types

There are still things to be done:

* we really want to have a flag which encodes one VSA at a time
* right now it encodes multiple VSAs into one Vendor-Specific,
  and then fails if there's an overflow.
* instead we want to catch the case of an overflow, encode a
  new Vendor-Specific / vendor header, and then continue
* we don't need any of this for VSAs in the extended space,
  because RFC 6929 Section 4 defines that each extended VSA
  starts off with one byte of vendor-type.  So we don't need
  any loops there.

4 years agogo to next here, too
Alan T. DeKok [Thu, 8 Apr 2021 20:17:30 +0000 (16:17 -0400)] 
go to next here, too

4 years agoskip the thing we just encoded
Alan T. DeKok [Thu, 8 Apr 2021 20:08:53 +0000 (16:08 -0400)] 
skip the thing we just encoded

4 years agowhoops
Alan T. DeKok [Thu, 8 Apr 2021 19:39:09 +0000 (15:39 -0400)] 
whoops

4 years agore-run the digest tests if we rebuild radiusd or rlm_digest
Alan T. DeKok [Thu, 8 Apr 2021 19:24:50 +0000 (15:24 -0400)] 
re-run the digest tests if we rebuild radiusd or rlm_digest

4 years agomake it work with nested VPs
Alan T. DeKok [Thu, 8 Apr 2021 19:19:02 +0000 (15:19 -0400)] 
make it work with nested VPs

4 years agoallow non-leaf types to have groups of sub-things
Alan T. DeKok [Thu, 8 Apr 2021 19:08:48 +0000 (15:08 -0400)] 
allow non-leaf types to have groups of sub-things

TBH, this should really be only for specific types which are
supported

4 years agorework to allow for Vendor = { ... }
Alan T. DeKok [Thu, 8 Apr 2021 16:30:45 +0000 (12:30 -0400)] 
rework to allow for Vendor = { ... }

not done yet, but at least we're one more layer in.

4 years agoencode leaf types with the fast path
Alan T. DeKok [Thu, 8 Apr 2021 16:22:46 +0000 (12:22 -0400)] 
encode leaf types with the fast path

4 years agomove "encode one vsa" to its own routine
Alan T. DeKok [Thu, 8 Apr 2021 14:56:26 +0000 (10:56 -0400)] 
move "encode one vsa" to its own routine

4 years agouse current VP after encoding TLVs, not next one
Alan T. DeKok [Thu, 8 Apr 2021 14:45:58 +0000 (10:45 -0400)] 
use current VP after encoding TLVs, not next one

4 years agoattributes with 'encrypt=2' can only appear in certain packets
Alan T. DeKok [Thu, 8 Apr 2021 12:45:09 +0000 (08:45 -0400)] 
attributes with 'encrypt=2' can only appear in certain packets

4 years agoEEXIST is fine in a system with multiple processes.
Alan T. DeKok [Thu, 8 Apr 2021 12:44:10 +0000 (08:44 -0400)] 
EEXIST is fine in a system with multiple processes.

race conditions on `make -j 8` for example

4 years agodon't split text too much
Alan T. DeKok [Thu, 8 Apr 2021 12:42:12 +0000 (08:42 -0400)] 
don't split text too much

if the static text is split across multiple lines, that makes
it much harder to grep the source code for error messages.

4 years agodecode RADIUS TLVs as nested pairs.
Alan T. DeKok [Wed, 7 Apr 2021 19:13:23 +0000 (15:13 -0400)] 
decode RADIUS TLVs as nested pairs.

This means that the detail writer will no longer print

foo.bar = 1

but instead will print

foo = { bar = 1}

Happily, the detail reader will still read the new format.

For future reference, we should replace the detail writer/reader
loop with an internal "serialize/unserialize" loop, for things
such as fail-over when SQL is down.

The existing detail writer can then be updated to print "flattened"
attribute names.  And, it will only be used by third-party tools.

4 years agoremove unused parameter from fr_pair_fprint()
Alan T. DeKok [Wed, 7 Apr 2021 19:08:52 +0000 (15:08 -0400)] 
remove unused parameter from fr_pair_fprint()

4 years agoremove unnecessary comment
Alan T. DeKok [Wed, 7 Apr 2021 19:04:37 +0000 (15:04 -0400)] 
remove unnecessary comment

there's already an assert for FR_TYPE_NON_LEAF

4 years agoallow the RADIUS encoder to encode nested TLVs
Alan T. DeKok [Wed, 7 Apr 2021 15:09:39 +0000 (11:09 -0400)] 
allow the RADIUS encoder to encode nested TLVs

and add test case for the same.

4 years agoscale unix time from a number, based on a hint
Alan T. DeKok [Wed, 7 Apr 2021 15:08:21 +0000 (11:08 -0400)] 
scale unix time from a number, based on a hint

4 years agodon't use hard-coded numbers
Alan T. DeKok [Wed, 7 Apr 2021 14:53:01 +0000 (10:53 -0400)] 
don't use hard-coded numbers

the "to_msec" function used USEC as a paramter, which is confusing.
It should be (NSEC / MSEC).  That's the same value, but the
explicit conversion makes it clearer what's going on

4 years agoNeed to free the internal dictionary on reset
Arran Cudbard-Bell [Wed, 7 Apr 2021 21:22:24 +0000 (22:22 +0100)] 
Need to free the internal dictionary on reset

4 years agoSee if explicitly freeing the gctx helps
Arran Cudbard-Bell [Wed, 7 Apr 2021 15:11:26 +0000 (16:11 +0100)] 
See if explicitly freeing the gctx helps

4 years agoGuard fr_openssl_free
Arran Cudbard-Bell [Wed, 7 Apr 2021 15:04:10 +0000 (16:04 +0100)] 
Guard fr_openssl_free

4 years agoWe now need at least json-c 0.13 or higher
Arran Cudbard-Bell [Wed, 7 Apr 2021 14:49:31 +0000 (15:49 +0100)] 
We now need at least json-c 0.13 or higher

4 years agoRework dictionary reference counting system
Arran Cudbard-Bell [Tue, 6 Apr 2021 23:59:42 +0000 (00:59 +0100)] 
Rework dictionary reference counting system

This lets us know which files are still holding onto dictionary references

4 years agoReduce noise in JSON code by marking up constant keys as constant
Arran Cudbard-Bell [Tue, 6 Apr 2021 21:02:51 +0000 (22:02 +0100)] 
Reduce noise in JSON code by marking up constant keys as constant

We also get a performance boost as they're not strdupd

4 years agoinitialize "box"
Alan T. DeKok [Tue, 6 Apr 2021 18:08:14 +0000 (14:08 -0400)] 
initialize "box"

4 years agodon't use OS-specific error messages in the tests
Alan T. DeKok [Tue, 6 Apr 2021 17:51:11 +0000 (13:51 -0400)] 
don't use OS-specific error messages in the tests

4 years agojust call fr_value_box_cmp(), and not cond_eval()
Alan T. DeKok [Tue, 6 Apr 2021 17:14:51 +0000 (13:14 -0400)] 
just call fr_value_box_cmp(), and not cond_eval()

which simplifies the code, and sets us up for 3-way trees/tries

4 years agodisallow constant data for "switch"
Alan T. DeKok [Tue, 6 Apr 2021 17:14:27 +0000 (13:14 -0400)] 
disallow constant data for "switch"

4 years agoThere is no "%v" expansion
Arran Cudbard-Bell [Tue, 6 Apr 2021 17:20:36 +0000 (18:20 +0100)] 
There is no "%v" expansion

4 years agoShould be const...
Arran Cudbard-Bell [Tue, 6 Apr 2021 16:21:10 +0000 (17:21 +0100)] 
Should be const...

4 years agoExplicitly freeing the dictionary really isn't required... something else must be...
Arran Cudbard-Bell [Tue, 6 Apr 2021 16:20:59 +0000 (17:20 +0100)] 
Explicitly freeing the dictionary really isn't required... something else must be happening

4 years agoDon't pass PRESENTATION format string data into json-c
Arran Cudbard-Bell [Tue, 6 Apr 2021 15:42:38 +0000 (16:42 +0100)] 
Don't pass PRESENTATION format string data into json-c

Else we'll get all kinds of horrible double escaping

4 years agoVerify json_object_put always frees the object
Arran Cudbard-Bell [Tue, 6 Apr 2021 15:26:37 +0000 (16:26 +0100)] 
Verify json_object_put always frees the object

4 years agoMore dictionary fixes
Arran Cudbard-Bell [Tue, 6 Apr 2021 15:08:50 +0000 (16:08 +0100)] 
More dictionary fixes

4 years agoarguments to "case" MUST be static data
Alan T. DeKok [Tue, 6 Apr 2021 14:44:35 +0000 (10:44 -0400)] 
arguments to "case" MUST be static data

in preparation for moving to rbtrees / hashes / patricia tries
for "case" statement values

4 years agoEnsure the TLS dictionary is freed on exit
Arran Cudbard-Bell [Tue, 6 Apr 2021 14:06:50 +0000 (15:06 +0100)] 
Ensure the TLS dictionary is freed on exit

4 years agoAdd individual toggles for asan/lsan/tsan/ubsan in spec file
Arran Cudbard-Bell [Tue, 6 Apr 2021 13:06:34 +0000 (14:06 +0100)] 
Add individual toggles for asan/lsan/tsan/ubsan in spec file

4 years agoAlways need to stop time tracking
Arran Cudbard-Bell [Tue, 6 Apr 2021 11:57:07 +0000 (12:57 +0100)] 
Always need to stop time tracking

4 years ago...and the ctx structure too
Arran Cudbard-Bell [Tue, 6 Apr 2021 11:49:15 +0000 (12:49 +0100)] 
...and the ctx structure too

4 years agoRename tmpl_cursor_init and tmpl_cursor_clear to tmpl_pair_cursor_init and tmpl_curso...
Arran Cudbard-Bell [Tue, 6 Apr 2021 11:48:08 +0000 (12:48 +0100)] 
Rename tmpl_cursor_init and tmpl_cursor_clear to tmpl_pair_cursor_init and tmpl_cursor_pair_clear

4 years agoDeal with channels being closed on server exit
Arran Cudbard-Bell [Tue, 6 Apr 2021 11:27:15 +0000 (12:27 +0100)] 
Deal with channels being closed on server exit

4 years agocombo-ip and combo-ip-prefix have a special format in RADIUS
Alan T. DeKok [Tue, 6 Apr 2021 11:16:02 +0000 (07:16 -0400)] 
combo-ip and combo-ip-prefix have a special format in RADIUS

4 years agomark up MSK as being 32 octets in length
Alan T. DeKok [Tue, 6 Apr 2021 11:07:58 +0000 (07:07 -0400)] 
mark up MSK as being 32 octets in length

4 years agocombo IPv6 is 16 octets, not 17
Alan T. DeKok [Tue, 6 Apr 2021 10:54:01 +0000 (06:54 -0400)] 
combo IPv6 is 16 octets, not 17

combo-ip is only used for WiMAX, and it doesn't have a scope byte.

4 years agoadd rule for: make test.unit.condition
Alan T. DeKok [Mon, 5 Apr 2021 16:08:42 +0000 (12:08 -0400)] 
add rule for: make test.unit.condition

4 years agoShouldn't have been comitted
Arran Cudbard-Bell [Tue, 6 Apr 2021 10:48:18 +0000 (11:48 +0100)] 
Shouldn't have been comitted

4 years agoMore efficient way of cleaning up frames
Arran Cudbard-Bell [Tue, 6 Apr 2021 10:46:03 +0000 (11:46 +0100)] 
More efficient way of cleaning up frames

4 years agoEnsure stack frame state is freed in a deterministic way
Arran Cudbard-Bell [Tue, 6 Apr 2021 10:26:52 +0000 (11:26 +0100)] 
Ensure stack frame state is freed in a deterministic way

4 years agoFix asserts
Arran Cudbard-Bell [Tue, 6 Apr 2021 10:07:07 +0000 (11:07 +0100)] 
Fix asserts

4 years agoReset indent to 0 on stopped requests
Arran Cudbard-Bell [Tue, 6 Apr 2021 00:54:02 +0000 (01:54 +0100)] 
Reset indent to 0 on stopped requests

4 years agoInterpret signal marks the request as done
Arran Cudbard-Bell [Tue, 6 Apr 2021 00:38:29 +0000 (01:38 +0100)] 
Interpret signal marks the request as done

4 years agoExited child should still definitely be in the parent state
Arran Cudbard-Bell [Tue, 6 Apr 2021 00:26:21 +0000 (01:26 +0100)] 
Exited child should still definitely be in the parent state

4 years agoBetter assert
Arran Cudbard-Bell [Tue, 6 Apr 2021 00:08:02 +0000 (01:08 +0100)] 
Better assert

4 years agoCorrectly categorise messages
Arran Cudbard-Bell [Mon, 5 Apr 2021 23:33:23 +0000 (00:33 +0100)] 
Correctly categorise messages

4 years agoMuch too chatty
Arran Cudbard-Bell [Mon, 5 Apr 2021 23:31:07 +0000 (00:31 +0100)] 
Much too chatty

4 years agoUse the correct return code
Arran Cudbard-Bell [Mon, 5 Apr 2021 23:07:31 +0000 (00:07 +0100)] 
Use the correct return code

4 years agoNot all requests have clients
Arran Cudbard-Bell [Mon, 5 Apr 2021 23:01:51 +0000 (00:01 +0100)] 
Not all requests have clients

4 years agoReally can't free detached requests here...
Arran Cudbard-Bell [Mon, 5 Apr 2021 23:01:38 +0000 (00:01 +0100)] 
Really can't free detached requests here...

4 years agoEnsure we don't trash request->packet->code
Arran Cudbard-Bell [Mon, 5 Apr 2021 22:10:31 +0000 (23:10 +0100)] 
Ensure we don't trash request->packet->code

4 years agoActually need a worker pointer...
Arran Cudbard-Bell [Mon, 5 Apr 2021 21:51:48 +0000 (22:51 +0100)] 
Actually need a worker pointer...

4 years agoRemove detached requests from the time_order_heap
Arran Cudbard-Bell [Mon, 5 Apr 2021 21:48:48 +0000 (22:48 +0100)] 
Remove detached requests from the time_order_heap

4 years agoUnpick some cross dependencies with detach functions
Arran Cudbard-Bell [Mon, 5 Apr 2021 21:37:12 +0000 (22:37 +0100)] 
Unpick some cross dependencies with detach functions

4 years agoRemove assert... these requests really do need to be internal
Arran Cudbard-Bell [Mon, 5 Apr 2021 21:08:52 +0000 (22:08 +0100)] 
Remove assert... these requests really do need to be internal

4 years agoTypo
Arran Cudbard-Bell [Mon, 5 Apr 2021 20:54:35 +0000 (21:54 +0100)] 
Typo

4 years agoAdd explicit request types (external, internal, detached)
Arran Cudbard-Bell [Mon, 5 Apr 2021 20:49:52 +0000 (21:49 +0100)] 
Add explicit request types (external, internal, detached)

Add stop and detach interpreter callbacks to fix state issues

4 years agoNothing uses request_state anymore
Arran Cudbard-Bell [Mon, 5 Apr 2021 16:05:07 +0000 (17:05 +0100)] 
Nothing uses request_state anymore

4 years agoDoes DHCPv6 now too
Arran Cudbard-Bell [Mon, 5 Apr 2021 14:11:33 +0000 (15:11 +0100)] 
Does DHCPv6 now too

4 years agoQuiet clang scan
Arran Cudbard-Bell [Mon, 5 Apr 2021 13:31:45 +0000 (14:31 +0100)] 
Quiet clang scan

4 years agoTreat combo IP address attributes as normal types
Arran Cudbard-Bell [Mon, 5 Apr 2021 11:15:01 +0000 (12:15 +0100)] 
Treat combo IP address attributes as normal types

4 years agoAdd type check macros
Arran Cudbard-Bell [Sun, 4 Apr 2021 21:48:10 +0000 (22:48 +0100)] 
Add type check macros

4 years agoRework xlat code to produce FR_TYPE_NULL boxes
Arran Cudbard-Bell [Sun, 4 Apr 2021 19:20:24 +0000 (20:20 +0100)] 
Rework xlat code to produce FR_TYPE_NULL boxes

4 years agoclean up public APIs
Alan T. DeKok [Sat, 3 Apr 2021 12:17:01 +0000 (08:17 -0400)] 
clean up public APIs

move "node" functions internal to rbtree.c.

The public APIs are now:

rbtree_insert
rbtree_find
rbtree_delete

which fixes ~20 years of a bad API