]>
git.ipfire.org Git - thirdparty/freeradius-server.git/log
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.
Alan T. DeKok [Sat, 10 Apr 2021 13:14:00 +0000 (09:14 -0400)]
make sql_foo tests depend on rlm_sql.la, too
Alan T. DeKok [Sat, 10 Apr 2021 11:55:47 +0000 (07:55 -0400)]
remove unused prototypes
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
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.
Alan T. DeKok [Fri, 9 Apr 2021 16:33:09 +0000 (12:33 -0400)]
install process_*.so, too
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
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
Alan T. DeKok [Fri, 9 Apr 2021 14:51:33 +0000 (10:51 -0400)]
allow empty groups
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
Alan T. DeKok [Fri, 9 Apr 2021 14:14:10 +0000 (10:14 -0400)]
update count
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.
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"
Alan T. DeKok [Fri, 9 Apr 2021 12:56:47 +0000 (08:56 -0400)]
unique errors for unique circumstances
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
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
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"
Alan T. DeKok [Fri, 9 Apr 2021 12:20:42 +0000 (08:20 -0400)]
flags are exclusive
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
Alan T. DeKok [Fri, 9 Apr 2021 11:34:40 +0000 (07:34 -0400)]
move debug printing for "receive" to process function
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
Arran Cudbard-Bell [Thu, 8 Apr 2021 16:10:58 +0000 (17:10 +0100)]
Set the destructor on the gctx we just allocated
Alan T. DeKok [Fri, 9 Apr 2021 11:03:47 +0000 (07:03 -0400)]
clean up in an attempt to shut up the compiler
Alan T. DeKok [Thu, 8 Apr 2021 22:00:56 +0000 (18:00 -0400)]
add tests for encode / decode of digest attributes
Alan T. DeKok [Thu, 8 Apr 2021 21:21:23 +0000 (17:21 -0400)]
move code to shut up clang
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.
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.
Alan T. DeKok [Thu, 8 Apr 2021 20:17:30 +0000 (16:17 -0400)]
go to next here, too
Alan T. DeKok [Thu, 8 Apr 2021 20:08:53 +0000 (16:08 -0400)]
skip the thing we just encoded
Alan T. DeKok [Thu, 8 Apr 2021 19:39:09 +0000 (15:39 -0400)]
whoops
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
Alan T. DeKok [Thu, 8 Apr 2021 19:19:02 +0000 (15:19 -0400)]
make it work with nested VPs
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
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.
Alan T. DeKok [Thu, 8 Apr 2021 16:22:46 +0000 (12:22 -0400)]
encode leaf types with the fast path
Alan T. DeKok [Thu, 8 Apr 2021 14:56:26 +0000 (10:56 -0400)]
move "encode one vsa" to its own routine
Alan T. DeKok [Thu, 8 Apr 2021 14:45:58 +0000 (10:45 -0400)]
use current VP after encoding TLVs, not next one
Alan T. DeKok [Thu, 8 Apr 2021 12:45:09 +0000 (08:45 -0400)]
attributes with 'encrypt=2' can only appear in certain packets
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
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.
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.
Alan T. DeKok [Wed, 7 Apr 2021 19:08:52 +0000 (15:08 -0400)]
remove unused parameter from fr_pair_fprint()
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
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.
Alan T. DeKok [Wed, 7 Apr 2021 15:08:21 +0000 (11:08 -0400)]
scale unix time from a number, based on a hint
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
Arran Cudbard-Bell [Wed, 7 Apr 2021 21:22:24 +0000 (22:22 +0100)]
Need to free the internal dictionary on reset
Arran Cudbard-Bell [Wed, 7 Apr 2021 15:11:26 +0000 (16:11 +0100)]
See if explicitly freeing the gctx helps
Arran Cudbard-Bell [Wed, 7 Apr 2021 15:04:10 +0000 (16:04 +0100)]
Guard fr_openssl_free
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
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
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
Alan T. DeKok [Tue, 6 Apr 2021 18:08:14 +0000 (14:08 -0400)]
initialize "box"
Alan T. DeKok [Tue, 6 Apr 2021 17:51:11 +0000 (13:51 -0400)]
don't use OS-specific error messages in the tests
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
Alan T. DeKok [Tue, 6 Apr 2021 17:14:27 +0000 (13:14 -0400)]
disallow constant data for "switch"
Arran Cudbard-Bell [Tue, 6 Apr 2021 17:20:36 +0000 (18:20 +0100)]
There is no "%v" expansion
Arran Cudbard-Bell [Tue, 6 Apr 2021 16:21:10 +0000 (17:21 +0100)]
Should be const...
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
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
Arran Cudbard-Bell [Tue, 6 Apr 2021 15:26:37 +0000 (16:26 +0100)]
Verify json_object_put always frees the object
Arran Cudbard-Bell [Tue, 6 Apr 2021 15:08:50 +0000 (16:08 +0100)]
More dictionary fixes
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
Arran Cudbard-Bell [Tue, 6 Apr 2021 14:06:50 +0000 (15:06 +0100)]
Ensure the TLS dictionary is freed on exit
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
Arran Cudbard-Bell [Tue, 6 Apr 2021 11:57:07 +0000 (12:57 +0100)]
Always need to stop time tracking
Arran Cudbard-Bell [Tue, 6 Apr 2021 11:49:15 +0000 (12:49 +0100)]
...and the ctx structure too
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
Arran Cudbard-Bell [Tue, 6 Apr 2021 11:27:15 +0000 (12:27 +0100)]
Deal with channels being closed on server exit
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
Alan T. DeKok [Tue, 6 Apr 2021 11:07:58 +0000 (07:07 -0400)]
mark up MSK as being 32 octets in length
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.
Alan T. DeKok [Mon, 5 Apr 2021 16:08:42 +0000 (12:08 -0400)]
add rule for: make test.unit.condition
Arran Cudbard-Bell [Tue, 6 Apr 2021 10:48:18 +0000 (11:48 +0100)]
Shouldn't have been comitted
Arran Cudbard-Bell [Tue, 6 Apr 2021 10:46:03 +0000 (11:46 +0100)]
More efficient way of cleaning up frames
Arran Cudbard-Bell [Tue, 6 Apr 2021 10:26:52 +0000 (11:26 +0100)]
Ensure stack frame state is freed in a deterministic way
Arran Cudbard-Bell [Tue, 6 Apr 2021 10:07:07 +0000 (11:07 +0100)]
Fix asserts
Arran Cudbard-Bell [Tue, 6 Apr 2021 00:54:02 +0000 (01:54 +0100)]
Reset indent to 0 on stopped requests
Arran Cudbard-Bell [Tue, 6 Apr 2021 00:38:29 +0000 (01:38 +0100)]
Interpret signal marks the request as done
Arran Cudbard-Bell [Tue, 6 Apr 2021 00:26:21 +0000 (01:26 +0100)]
Exited child should still definitely be in the parent state
Arran Cudbard-Bell [Tue, 6 Apr 2021 00:08:02 +0000 (01:08 +0100)]
Better assert
Arran Cudbard-Bell [Mon, 5 Apr 2021 23:33:23 +0000 (00:33 +0100)]
Correctly categorise messages
Arran Cudbard-Bell [Mon, 5 Apr 2021 23:31:07 +0000 (00:31 +0100)]
Much too chatty
Arran Cudbard-Bell [Mon, 5 Apr 2021 23:07:31 +0000 (00:07 +0100)]
Use the correct return code
Arran Cudbard-Bell [Mon, 5 Apr 2021 23:01:51 +0000 (00:01 +0100)]
Not all requests have clients
Arran Cudbard-Bell [Mon, 5 Apr 2021 23:01:38 +0000 (00:01 +0100)]
Really can't free detached requests here...
Arran Cudbard-Bell [Mon, 5 Apr 2021 22:10:31 +0000 (23:10 +0100)]
Ensure we don't trash request->packet->code
Arran Cudbard-Bell [Mon, 5 Apr 2021 21:51:48 +0000 (22:51 +0100)]
Actually need a worker pointer...
Arran Cudbard-Bell [Mon, 5 Apr 2021 21:48:48 +0000 (22:48 +0100)]
Remove detached requests from the time_order_heap
Arran Cudbard-Bell [Mon, 5 Apr 2021 21:37:12 +0000 (22:37 +0100)]
Unpick some cross dependencies with detach functions
Arran Cudbard-Bell [Mon, 5 Apr 2021 21:08:52 +0000 (22:08 +0100)]
Remove assert... these requests really do need to be internal
Arran Cudbard-Bell [Mon, 5 Apr 2021 20:54:35 +0000 (21:54 +0100)]
Typo
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
Arran Cudbard-Bell [Mon, 5 Apr 2021 16:05:07 +0000 (17:05 +0100)]
Nothing uses request_state anymore
Arran Cudbard-Bell [Mon, 5 Apr 2021 14:11:33 +0000 (15:11 +0100)]
Does DHCPv6 now too
Arran Cudbard-Bell [Mon, 5 Apr 2021 13:31:45 +0000 (14:31 +0100)]
Quiet clang scan
Arran Cudbard-Bell [Mon, 5 Apr 2021 11:15:01 +0000 (12:15 +0100)]
Treat combo IP address attributes as normal types
Arran Cudbard-Bell [Sun, 4 Apr 2021 21:48:10 +0000 (22:48 +0100)]
Add type check macros
Arran Cudbard-Bell [Sun, 4 Apr 2021 19:20:24 +0000 (20:20 +0100)]
Rework xlat code to produce FR_TYPE_NULL boxes
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