]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
2 years agoremove all tests we don't want, instead of using elsif
Alan T. DeKok [Thu, 20 Jul 2023 17:48:40 +0000 (13:48 -0400)] 
remove all tests we don't want, instead of using elsif

2 years agoadd and use "safe" fields for LDAP and SQL
Alan T. DeKok [Thu, 20 Jul 2023 13:17:01 +0000 (09:17 -0400)] 
add and use "safe" fields for LDAP and SQL

which means that if we escape data once, it is not escaped again.

For SQL, the escape function is tracked per driver.  So you can't
escape something for MySQL, and then later use it for PostgreSQL
without that _also_ being escaped.

2 years agodefine macro for automatically setting "safe" values
Alan T. DeKok [Thu, 20 Jul 2023 12:50:06 +0000 (08:50 -0400)] 
define macro for automatically setting "safe" values

2 years ago"safe" values can still be tainted.
Alan T. DeKok [Thu, 20 Jul 2023 12:39:50 +0000 (08:39 -0400)] 
"safe" values can still be tainted.

Users of that data who understand this particular value of the "safe"
flagmar can then ignore the "tainted" flag, and use the value as if it
was untainted.  Every other user of the data must still treat it as
tainted.

2 years agofr_value_box_alloc() does not need to take a "tainted" flag
Alan T. DeKok [Thu, 20 Jul 2023 12:13:03 +0000 (08:13 -0400)] 
fr_value_box_alloc() does not need to take a "tainted" flag

a bare box is not tainted.  In the few cases where the data is
tainted, it is copied from a tainted source via fr_value_box_copy(),
which also copies the tainted flag

2 years agoancestors must be structural
Alan T. DeKok [Thu, 20 Jul 2023 11:52:00 +0000 (07:52 -0400)] 
ancestors must be structural

2 years agomember_num starts at 1, not 0
Alan T. DeKok [Thu, 20 Jul 2023 11:51:43 +0000 (07:51 -0400)] 
member_num starts at 1, not 0

2 years agoadd fr_box() generic
Alan T. DeKok [Thu, 20 Jul 2023 11:49:41 +0000 (07:49 -0400)] 
add fr_box() generic

which only works for some leaf types, as there string / octets
types need also to deal with length and talloc issues.  Other types
like ipaddr need to check the contents of the source.

2 years agostart setting migration flags
Alan T. DeKok [Mon, 17 Jul 2023 19:28:12 +0000 (15:28 -0400)] 
start setting migration flags

2 years agomore change vp->da->type to vp->vp_type
Alan T. DeKok [Mon, 17 Jul 2023 18:48:37 +0000 (14:48 -0400)] 
more change vp->da->type to vp->vp_type

2 years agovp_type and da->type are allowed to be different for COMBO_IP
Alan T. DeKok [Mon, 17 Jul 2023 18:47:43 +0000 (14:47 -0400)] 
vp_type and da->type are allowed to be different for COMBO_IP

2 years agoensure that vp->vp_data is initialized correctly
Alan T. DeKok [Mon, 17 Jul 2023 18:47:08 +0000 (14:47 -0400)] 
ensure that vp->vp_data is initialized correctly

2 years agoremove unused function
Alan T. DeKok [Mon, 17 Jul 2023 18:25:04 +0000 (14:25 -0400)] 
remove unused function

2 years agochange vp->da->type to vp->vp_type
Alan T. DeKok [Mon, 17 Jul 2023 18:13:16 +0000 (14:13 -0400)] 
change vp->da->type to vp->vp_type

not only is it friendlier to cache locality, it's more correct
because of things like FR_TYPE_COMBO_IPADDR, where the realized
vp->vp_type is different from the theoretical da->type

2 years agoMake debug_ policies a little simpler
Nick Porter [Mon, 17 Jul 2023 15:37:52 +0000 (16:37 +0100)] 
Make debug_ policies a little simpler

Removes some noise from the debug output

2 years agoThere is no coa list anymore
Nick Porter [Mon, 17 Jul 2023 15:35:31 +0000 (16:35 +0100)] 
There is no coa list anymore

2 years agoclean up
Alan T. DeKok [Mon, 17 Jul 2023 12:50:35 +0000 (08:50 -0400)] 
clean up

delete advice and descriptions which are ancient and out of date

2 years agomake fr_tacacs_packet_log_hex() take and check a length field
Alan T. DeKok [Mon, 17 Jul 2023 12:28:42 +0000 (08:28 -0400)] 
make fr_tacacs_packet_log_hex() take and check a length field

2 years agoClarify "session" section in TACACS virtual server
Nick Porter [Mon, 17 Jul 2023 10:31:18 +0000 (11:31 +0100)] 
Clarify "session" section in TACACS virtual server

2 years agoUpdate password attribute references to use Password.xxx format
Nick Porter [Mon, 17 Jul 2023 10:08:13 +0000 (11:08 +0100)] 
Update password attribute references to use Password.xxx format

2 years agoadd macros fror pair_nested_tests
Alan T. DeKok [Sun, 16 Jul 2023 11:27:10 +0000 (07:27 -0400)] 
add macros fror pair_nested_tests

2 years agomove switch to array lookup
Alan T. DeKok [Sun, 16 Jul 2023 02:00:29 +0000 (22:00 -0400)] 
move switch to array lookup

2 years agomore checks
Alan T. DeKok [Sun, 16 Jul 2023 01:55:35 +0000 (21:55 -0400)] 
more checks

seems like a heisenbug?

2 years agoremove update
Alan T. DeKok [Sun, 16 Jul 2023 01:24:28 +0000 (21:24 -0400)] 
remove update

and re-enable additional check, as the APIs have been updated
as per the comment which disabled the test

2 years agoremove update
Alan T. DeKok [Sun, 16 Jul 2023 01:22:03 +0000 (21:22 -0400)] 
remove update

2 years agosimplify test_fr_pair_list_copy_by_ancestor
Alan T. DeKok [Sun, 16 Jul 2023 01:18:18 +0000 (21:18 -0400)] 
simplify test_fr_pair_list_copy_by_ancestor

2 years agonote migration flags for tests
Alan T. DeKok [Fri, 14 Jul 2023 20:56:24 +0000 (16:56 -0400)] 
note migration flags for tests

2 years agore-enable test which over-writes default list
Alan T. DeKok [Fri, 14 Jul 2023 20:52:38 +0000 (16:52 -0400)] 
re-enable test which over-writes default list

2 years agodon't use "update"
Alan T. DeKok [Fri, 14 Jul 2023 20:50:09 +0000 (16:50 -0400)] 
don't use "update"

2 years agodon't automatically create the key field for nested structs.
Alan T. DeKok [Fri, 14 Jul 2023 20:37:13 +0000 (16:37 -0400)] 
don't automatically create the key field for nested structs.

The old code didn't do it, so we shouldn't do it either.

2 years agoupdate fr_pair_list_copy_by_ancestor()
Alan T. DeKok [Fri, 14 Jul 2023 20:24:35 +0000 (16:24 -0400)] 
update fr_pair_list_copy_by_ancestor()

if we see a TLV, we just copy that.  The function can then work
both with nested and non-nested attributes.

we don't need to pass "count", as the only caller always says
"copy all of them"

2 years agoFix auto-added strerror header
Arran Cudbard-Bell [Fri, 14 Jul 2023 14:18:36 +0000 (08:18 -0600)] 
Fix auto-added strerror header

2 years agoRevert "assert that the channel has no running requests before ACK close"
Arran Cudbard-Bell [Fri, 14 Jul 2023 14:13:06 +0000 (08:13 -0600)] 
Revert "assert that the channel has no running requests before ACK close"

This reverts commit bdec27409cda11b9432c583748bfac69241a118b.

2 years agoassert that the channel has no running requests before ACK close
Alan T. DeKok [Fri, 14 Jul 2023 13:30:12 +0000 (09:30 -0400)] 
assert that the channel has no running requests before ACK close

and cancel all of the related requests when the worker is signalled
to exit.

2 years agoadd parse_new_conditions migration flag
Alan T. DeKok [Fri, 14 Jul 2023 13:27:36 +0000 (09:27 -0400)] 
add parse_new_conditions migration flag

and set it to "true" by default.  So that the condition tests
will all be run through both the old fr_cond_tokenize() function,
and the new xlat_tokenize_condition() function.

2 years agomdd migration flag for nested pairs, and test it
Alan T. DeKok [Fri, 14 Jul 2023 13:01:51 +0000 (09:01 -0400)] 
mdd migration flag for nested pairs, and test it

2 years agoPacify Coverity (CID #1506302)
Nick Porter [Fri, 14 Jul 2023 09:46:26 +0000 (10:46 +0100)] 
Pacify Coverity (CID #1506302)

2 years agoExtract packet code even if body is not encrypted
Nick Porter [Fri, 14 Jul 2023 09:11:29 +0000 (10:11 +0100)] 
Extract packet code even if body is not encrypted

2 years agoRevert "revert DHCPv6 struct_nested patch"
Alan T. DeKok [Thu, 13 Jul 2023 18:35:20 +0000 (14:35 -0400)] 
Revert "revert DHCPv6 struct_nested patch"

This reverts commit 500ee71862765d26694e52b41169958406347334.

2 years agoit helps to initialize fields
Alan T. DeKok [Thu, 13 Jul 2023 18:35:10 +0000 (14:35 -0400)] 
it helps to initialize fields

2 years agoFix hangs/crashes on exit if thread instantiation fails
Arran Cudbard-Bell [Thu, 13 Jul 2023 22:04:47 +0000 (16:04 -0600)] 
Fix hangs/crashes on exit if thread instantiation fails

2 years agonetwork: Use an explicit exiting flag instead of a started flag
Arran Cudbard-Bell [Thu, 13 Jul 2023 21:17:50 +0000 (15:17 -0600)] 
network: Use an explicit exiting flag instead of a started flag

2 years agoatexit: Support checking if the thread is exiting
Arran Cudbard-Bell [Thu, 13 Jul 2023 21:15:15 +0000 (15:15 -0600)] 
atexit: Support checking if the thread is exiting

2 years agoUse filename from PAIR_LIST in debug output
Nick Porter [Thu, 13 Jul 2023 18:24:35 +0000 (19:24 +0100)] 
Use filename from PAIR_LIST in debug output

Gives the correct file that the entry was originally read from

2 years agoMore user name -> key in rlm_files debug output
Nick Porter [Thu, 13 Jul 2023 18:22:07 +0000 (19:22 +0100)] 
More user name -> key in rlm_files debug output

2 years agoAdd tests of < and > comparison in rlm_files
Nick Porter [Thu, 13 Jul 2023 18:21:10 +0000 (19:21 +0100)] 
Add tests of < and > comparison in rlm_files

And exercise use of $INCLUDE

2 years agorevert DHCPv6 struct_nested patch
Alan T. DeKok [Thu, 13 Jul 2023 18:26:41 +0000 (14:26 -0400)] 
revert DHCPv6 struct_nested patch

It seems to randomly set the flag to "true" locally and in CI.
even though ASAN doesn't complain

2 years agoadd decode flags for nested structs
Alan T. DeKok [Thu, 13 Jul 2023 17:26:12 +0000 (13:26 -0400)] 
add decode flags for nested structs

nothing uses them right now, but it's a good way to track what
needs to be changed.

2 years agoadd -S pair_legacy_nested=true
Alan T. DeKok [Thu, 13 Jul 2023 16:12:16 +0000 (12:12 -0400)] 
add -S pair_legacy_nested=true

and set it for keyword tests.

Except for map-xlat-struct, which calls fr_pair_afrom_da_depth_nested()
with a struct that has a "key" field.

update pair.c to correctly create and auto-populate the key field,
and create the child struct correctly.

map-xlat-struct fails because the output now contains a key field,
and is nested.  But that is easy enough to fix when we move over
to fully nested.

2 years agorlm_files are not just keyed off user names
Nick Porter [Thu, 13 Jul 2023 15:48:02 +0000 (16:48 +0100)] 
rlm_files are not just keyed off user names

2 years agoCast pointer to correct type
Nick Porter [Thu, 13 Jul 2023 15:47:26 +0000 (16:47 +0100)] 
Cast pointer to correct type

2 years agoReference the correct list for comparisons in rlm_files data
Nick Porter [Thu, 13 Jul 2023 15:21:54 +0000 (16:21 +0100)] 
Reference the correct list for comparisons in rlm_files data

If it's internal attriubtes - stay with the control list
Protocol attributes are compared in the request list

2 years agoadd and export migration flag for pair_legacy_nested
Alan T. DeKok [Thu, 13 Jul 2023 15:33:10 +0000 (11:33 -0400)] 
add and export migration flag for pair_legacy_nested

2 years agomore debugging
Alan T. DeKok [Thu, 13 Jul 2023 14:52:10 +0000 (10:52 -0400)] 
more debugging

2 years agoCheck for error return from fr_sbuff_in_bstrncpy() (CID #1503901)
James Jones [Tue, 11 Jul 2023 20:42:13 +0000 (15:42 -0500)] 
Check for error return from fr_sbuff_in_bstrncpy() (CID #1503901)

2 years agomore debug output
Alan T. DeKok [Thu, 13 Jul 2023 14:36:45 +0000 (10:36 -0400)] 
more debug output

2 years agoRewrite length check so coverity will recognize it (CID #1445221)
James Jones [Thu, 13 Jul 2023 13:49:11 +0000 (08:49 -0500)] 
Rewrite length check so coverity will recognize it (CID #1445221)

As the result of byte-swapping, coverity considers it tainted. It
appears that coverity only recognizes comparisons with the alleged
tainted value on the LHS as validation, so we rewrite the check
as an equivalent chack that coverity wil recognize.

2 years agoadd tests for DEFAULT and User-Name==
Alan T. DeKok [Thu, 13 Jul 2023 14:23:32 +0000 (10:23 -0400)] 
add tests for DEFAULT and User-Name==

The == comparison doesn't work. :(

2 years agoclean up fr_pair_list_move_op() and uses
Alan T. DeKok [Thu, 13 Jul 2023 13:50:07 +0000 (09:50 -0400)] 
clean up fr_pair_list_move_op() and uses

some users didn't free the source list.  But it should really have
been freed.  So we move the free into fr_pair_list_move_op()

and do other minor cleanups of the function and users

2 years agoIf parsing attributes fails, discard temporary list
Nick Porter [Thu, 13 Jul 2023 08:48:26 +0000 (09:48 +0100)] 
If parsing attributes fails, discard temporary list

2 years agoPacify Coverity (CID #1538294 and #1538293)
Nick Porter [Thu, 13 Jul 2023 07:35:23 +0000 (08:35 +0100)] 
Pacify Coverity (CID #1538294 and #1538293)

2 years agoadd missing file
Alan T. DeKok [Wed, 12 Jul 2023 19:11:51 +0000 (15:11 -0400)] 
add missing file

2 years agoMinor debug message improvements
Nick Porter [Wed, 12 Jul 2023 18:38:52 +0000 (19:38 +0100)] 
Minor debug message improvements

2 years agoupdate for tested VPs
Alan T. DeKok [Wed, 12 Jul 2023 18:05:34 +0000 (14:05 -0400)] 
update for tested VPs

if we set the nested flag "true" and edit the tests, they should
all now pass.

2 years agosplit out separate function
Alan T. DeKok [Wed, 12 Jul 2023 18:04:54 +0000 (14:04 -0400)] 
split out separate function

so we can create nested VPs, starting from an intermediate point

2 years agomove tmp_list to caller
Alan T. DeKok [Wed, 12 Jul 2023 13:38:02 +0000 (09:38 -0400)] 
move tmp_list to caller

because the fr_pair_list_afrom_file() function already created
a temporary list.  So there isn't much point in creating an
additional one.

2 years agoQuiet both Coverity and clang scan
Nick Porter [Wed, 12 Jul 2023 14:29:25 +0000 (15:29 +0100)] 
Quiet both Coverity and clang scan

2 years agoThe xlat is %{urlquote: } not %{urlencode: }
Nick Porter [Wed, 12 Jul 2023 14:21:58 +0000 (15:21 +0100)] 
The xlat is %{urlquote: } not %{urlencode: }

2 years agoPull side effects out of TEST_CHECK() (CID #1538288)
James Jones [Wed, 12 Jul 2023 13:13:04 +0000 (08:13 -0500)] 
Pull side effects out of TEST_CHECK() (CID #1538288)

2 years agouse correct number
Alan T. DeKok [Wed, 12 Jul 2023 12:45:02 +0000 (08:45 -0400)] 
use correct number

2 years agoparse conditional filters in attributes
Alan T. DeKok [Wed, 12 Jul 2023 12:22:51 +0000 (08:22 -0400)] 
parse conditional filters in attributes

&Foo[&bar == baz]

None of this works for a bunch of reason.  See filter.txt for a
discussion.

* filtering on leaf attributes needs to be double-checked for
  good and bad things

ok: &User-Name[&User-Name == 'bar']
better: &USer-Name[=='bar']
bad: &User-Name[&Filter-Id == 'bar]

  It's probably simplest to just allow the first syntax. It's
  redundant, but not wrong.

  We then need to update the tokenizer to walk over the condition,
  and ensure that the only attribute used in the condition is the
  leaf attribute which we are checking.

* the tests are for conditions, but we do want to allow filtering
  on group attributes:

&TLS-Certificate[&Common-Name == 'foo']

  but the conditions don't allow comparisons on groups:

&TLS-Certificate == ...

  So it makes sense to forbid

&TLS-Certificate[&Common-Name == 'foo'] == ...

  until such time as we do allow conditions on groups.

* tmpl_dcursor now has an assertion if you try to use conditions
  in filters.  We still need to write the run-time evaluation code
  which checks if the condition matches.

2 years agoAdd missing libraries to libfreeradius4 deb package
Nick Porter [Wed, 12 Jul 2023 10:56:01 +0000 (11:56 +0100)] 
Add missing libraries to libfreeradius4 deb package

And sort into alphabetical sequence

2 years agoadd tests for fr_pair_list_afrom_file()
Alan T. DeKok [Wed, 12 Jul 2023 02:59:43 +0000 (22:59 -0400)] 
add tests for fr_pair_list_afrom_file()

and update the code to produce more descriptive error messages

2 years agoframework for allowing nested attributes via internal flag
Alan T. DeKok [Wed, 12 Jul 2023 02:03:01 +0000 (22:03 -0400)] 
framework for allowing nested attributes via internal flag

which is always set to 'false' for now.

2 years agoclean up and regularize messages
Alan T. DeKok [Wed, 12 Jul 2023 01:16:20 +0000 (21:16 -0400)] 
clean up and regularize messages

2 years agoquiet coverity
Alan T. DeKok [Tue, 11 Jul 2023 20:32:04 +0000 (16:32 -0400)] 
quiet coverity

2 years agocheck returns. CID #1503939 Fixes #5103
Alan T. DeKok [Tue, 11 Jul 2023 18:35:36 +0000 (14:35 -0400)] 
check returns.  CID #1503939  Fixes #5103

2 years agouse patsubst instead of foreach / eval
Alan T. DeKok [Tue, 11 Jul 2023 18:32:38 +0000 (14:32 -0400)] 
use patsubst instead of foreach / eval

eval requires more layers of indirection

2 years agoFix 'process' dict setup by protocols
Jorge Pereira [Tue, 11 Jul 2023 17:10:49 +0000 (14:10 -0300)] 
Fix 'process' dict setup by protocols

2 years agoprocess tests don't need to listen on the network
Alan T. DeKok [Tue, 11 Jul 2023 16:28:53 +0000 (12:28 -0400)] 
process tests don't need to listen on the network

2 years agoadd support for test.process.dhcpv4, etc
Alan T. DeKok [Tue, 11 Jul 2023 16:28:10 +0000 (12:28 -0400)] 
add support for test.process.dhcpv4, etc

2 years agoremove debugging information
Alan T. DeKok [Tue, 11 Jul 2023 16:23:02 +0000 (12:23 -0400)] 
remove debugging information

2 years agotests: Add process tests for dhcpv6
Jorge Pereira [Wed, 28 Jun 2023 15:11:35 +0000 (12:11 -0300)] 
tests: Add process tests for dhcpv6

2 years agotests: Add process tests for dhcpv4
Jorge Pereira [Tue, 4 Jul 2023 01:33:55 +0000 (22:33 -0300)] 
tests: Add process tests for dhcpv4

2 years agoThe automatic state machine is now working correctly for ASCII auth
Nick Porter [Tue, 11 Jul 2023 14:59:08 +0000 (15:59 +0100)] 
The automatic state machine is now working correctly for ASCII auth

2 years agoAdd TACACS authentication type to cached attriubtes
Nick Porter [Tue, 11 Jul 2023 14:44:49 +0000 (15:44 +0100)] 
Add TACACS authentication type to cached attriubtes

It is not in Authentication-Continue packets and caching it helps with
automatic selection of Auth-Type

2 years agoCheck TACACS authentication type using pair
Nick Porter [Tue, 11 Jul 2023 13:52:49 +0000 (14:52 +0100)] 
Check TACACS authentication type using pair

The packet available here has an encrypted body - so
packet->authen_start does not point at the bytes that make up the start
of an authentication packet body.

2 years agoCopy additional attributes into the session cache on multi packet auth
Nick Porter [Tue, 11 Jul 2023 13:39:07 +0000 (14:39 +0100)] 
Copy additional attributes into the session cache on multi packet auth

2 years agoAdd debugging to session caching and restoring
Nick Porter [Tue, 11 Jul 2023 12:27:56 +0000 (13:27 +0100)] 
Add debugging to session caching and restoring

2 years agoPopulate appropirate attribute from user_message
Nick Porter [Tue, 11 Jul 2023 12:27:02 +0000 (13:27 +0100)] 
Populate appropirate attribute from user_message

We requested either user name or password with an appropriate "get"
reply - so put the replied data in where it makes sense.

2 years agoUse correct code to test for "get username" reply
Nick Porter [Tue, 11 Jul 2023 12:23:37 +0000 (13:23 +0100)] 
Use correct code to test for "get username" reply

2 years agoDon't decode optional attributes
Nick Porter [Tue, 11 Jul 2023 12:22:51 +0000 (13:22 +0100)] 
Don't decode optional attributes

Certain attributes are defined as optional, and will have zero length if
they are not present.

2 years agostupid gnu make
Alan T. DeKok [Tue, 11 Jul 2023 14:43:55 +0000 (10:43 -0400)] 
stupid gnu make

2 years agofilter based on test existence, not one process_foo modules
Alan T. DeKok [Tue, 11 Jul 2023 14:26:41 +0000 (10:26 -0400)] 
filter based on test existence, not one process_foo modules

2 years agotests: Let's use $(Q) instead of @
Jorge Pereira [Fri, 30 Jun 2023 21:51:32 +0000 (18:51 -0300)] 
tests: Let's use $(Q) instead of @

It's helpful to troubleshoot.

2 years agotests: Print out the module and test name
Jorge Pereira [Wed, 28 Jun 2023 15:11:26 +0000 (12:11 -0300)] 
tests: Print out the module and test name

2 years agowhitespace and formatting
Jorge Pereira [Tue, 4 Jul 2023 01:07:10 +0000 (22:07 -0300)] 
whitespace and formatting

2 years agoAdd comment about LDAP failing if identity is specified
Arran Cudbard-Bell [Tue, 11 Jul 2023 07:10:20 +0000 (01:10 -0600)] 
Add comment about LDAP failing if identity is specified

2 years agoswitch to assert
Alan T. DeKok [Mon, 10 Jul 2023 20:39:01 +0000 (16:39 -0400)] 
switch to assert

2 years agoremove unused assignment
Alan T. DeKok [Mon, 10 Jul 2023 20:19:34 +0000 (16:19 -0400)] 
remove unused assignment