]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
2 years agoTidy up
Nick Porter [Thu, 24 Aug 2023 10:33:46 +0000 (11:33 +0100)] 
Tidy up

2 years agoAdd regex to allow ldapi:// peercred admin binds in tests
Nick Porter [Thu, 24 Aug 2023 10:23:36 +0000 (11:23 +0100)] 
Add regex to allow ldapi:// peercred admin binds in tests

2 years agoAllow Symas LDAP packages for test server and add ldapi:// listener
Nick Porter [Thu, 24 Aug 2023 10:22:45 +0000 (11:22 +0100)] 
Allow Symas LDAP packages for test server and add ldapi:// listener

2 years agoRework LDAP xlat timeout / cancel callbacks
Nick Porter [Wed, 23 Aug 2023 18:34:08 +0000 (19:34 +0100)] 
Rework LDAP xlat timeout / cancel callbacks

To handle the case where the request has returned but the query has not
yet resumed.

In this case there is no outstanding request to cancel.

2 years agoUse boolean enum in ldap group membership xlat
Nick Porter [Wed, 23 Aug 2023 18:28:57 +0000 (19:28 +0100)] 
Use boolean enum in ldap group membership xlat

To be consistent with SQL group membership xlat

2 years agoRename fr_dhcv4_raw_packet_recv() as fr_dhcpv4_raw_packet_recv()
James Jones [Wed, 23 Aug 2023 18:50:32 +0000 (13:50 -0500)] 
Rename fr_dhcv4_raw_packet_recv() as fr_dhcpv4_raw_packet_recv()

2 years agoCorrect tests where xlat outputs boolean
Nick Porter [Wed, 23 Aug 2023 16:26:38 +0000 (17:26 +0100)] 
Correct tests where xlat outputs boolean

2 years agoPay attention to return value of fr_trunk_request_enqueue
Nick Porter [Wed, 23 Aug 2023 15:00:53 +0000 (16:00 +0100)] 
Pay attention to return value of fr_trunk_request_enqueue

2 years agoRe-work failure paths to ensure correct cleanups
Nick Porter [Wed, 23 Aug 2023 15:00:02 +0000 (16:00 +0100)] 
Re-work failure paths to ensure correct cleanups

2 years agotypo
Alan T. DeKok [Wed, 23 Aug 2023 17:43:06 +0000 (13:43 -0400)] 
typo

2 years agowe don't need to rename the SQL-Group attribute
Alan T. DeKok [Wed, 23 Aug 2023 16:56:37 +0000 (12:56 -0400)] 
we don't need to rename the SQL-Group attribute

2 years agothe register function automatically adds our instance name
Alan T. DeKok [Wed, 23 Aug 2023 15:09:08 +0000 (11:09 -0400)] 
the register function automatically adds our instance name

2 years agorespect group_attribute and update it to sql.group
Alan T. DeKok [Wed, 23 Aug 2023 14:23:09 +0000 (10:23 -0400)] 
respect group_attribute and update it to sql.group

2 years agoprint error and fail if registration fails
Alan T. DeKok [Wed, 23 Aug 2023 14:19:24 +0000 (10:19 -0400)] 
print error and fail if registration fails

2 years agoremove logintime module
Alan T. DeKok [Wed, 23 Aug 2023 14:16:09 +0000 (10:16 -0400)] 
remove logintime module

and all references to it, and the attributes it uses

2 years agoadd rule to make adoc file from configuration
Alan T. DeKok [Wed, 23 Aug 2023 14:15:29 +0000 (10:15 -0400)] 
add rule to make adoc file from configuration

2 years agomove SQL-Group ==... to %{sql.group:...}
Alan T. DeKok [Wed, 23 Aug 2023 13:50:57 +0000 (09:50 -0400)] 
move SQL-Group ==... to %{sql.group:...}

2 years agono escaping is done, so we don't need func _or_ uctx
Alan T. DeKok [Wed, 23 Aug 2023 13:12:41 +0000 (09:12 -0400)] 
no escaping is done, so we don't need func _or_ uctx

2 years agoUse a dummy escape function to satisfy xlat arg validation
Nick Porter [Wed, 23 Aug 2023 09:15:25 +0000 (10:15 +0100)] 
Use a dummy escape function to satisfy xlat arg validation

2 years agoadd %{sql.group:name}
Alan T. DeKok [Wed, 23 Aug 2023 01:36:04 +0000 (21:36 -0400)] 
add %{sql.group:name}

to replace SQL-Group == ...

which was misleading because it didn't allow !=, or =~, etc.

2 years agomove group check to stand-alone function
Alan T. DeKok [Wed, 23 Aug 2023 01:18:45 +0000 (21:18 -0400)] 
move group check to stand-alone function

in preparation for adding %{sql.group:name}

2 years agowarn on not removing immutable attribute
Alan T. DeKok [Tue, 22 Aug 2023 19:55:01 +0000 (15:55 -0400)] 
warn on not removing immutable attribute

2 years agoFix missing \n (#5155)
Jorge Pereira [Wed, 23 Aug 2023 01:08:11 +0000 (22:08 -0300)] 
Fix missing \n (#5155)

2 years agoMake the configure scripts work better on macOS
Arran Cudbard-Bell [Tue, 22 Aug 2023 21:46:17 +0000 (15:46 -0600)] 
Make the configure scripts work better on macOS

2 years agocleanups as per unit tests
Alan T. DeKok [Tue, 22 Aug 2023 14:39:10 +0000 (10:39 -0400)] 
cleanups as per unit tests

2 years agoforce these flags, too
Alan T. DeKok [Tue, 22 Aug 2023 14:11:59 +0000 (10:11 -0400)] 
force these flags, too

2 years agodon't sort if the list is already flat.
Alan T. DeKok [Tue, 22 Aug 2023 13:01:55 +0000 (09:01 -0400)] 
don't sort if the list is already flat.

That breaks things due to key fields + child structs

2 years agomake sorting a bit better
Alan T. DeKok [Tue, 22 Aug 2023 12:57:28 +0000 (08:57 -0400)] 
make sorting a bit better

like attributes are now sorted together

2 years agoalso print out offset if the input is long
Alan T. DeKok [Tue, 22 Aug 2023 12:43:48 +0000 (08:43 -0400)] 
also print out offset if the input is long

2 years agoshow which attribute had the issue
Alan T. DeKok [Tue, 22 Aug 2023 12:43:28 +0000 (08:43 -0400)] 
show which attribute had the issue

2 years agoHave struct encoder return the PAIR_ENCODE_FATAL_ERROR constant
Arran Cudbard-Bell [Tue, 22 Aug 2023 02:03:52 +0000 (20:03 -0600)] 
Have struct encoder return the PAIR_ENCODE_FATAL_ERROR constant

2 years agoldap: Typo
Arran Cudbard-Bell [Mon, 21 Aug 2023 23:40:44 +0000 (17:40 -0600)] 
ldap: Typo

2 years agoxlat: Fix xlat alternations that use functions
Arran Cudbard-Bell [Mon, 21 Aug 2023 22:58:16 +0000 (16:58 -0600)] 
xlat: Fix xlat alternations that use functions

2 years agoldap: Print why URI parsing failed
Arran Cudbard-Bell [Thu, 17 Aug 2023 21:17:13 +0000 (15:17 -0600)] 
ldap: Print why URI parsing failed

2 years agolet's make tests pass
Alan T. DeKok [Mon, 21 Aug 2023 22:19:46 +0000 (18:19 -0400)] 
let's make tests pass

2 years ago+= also means "create if it doesn't exist"
Alan T. DeKok [Mon, 21 Aug 2023 21:58:41 +0000 (17:58 -0400)] 
+= also means "create if it doesn't exist"

at least for operations where "+=" is meaningful

We probably want to do something similar for union, merge, etc.
if the LHS doesn't exist.

2 years agoupdate for new behavior of :=
Alan T. DeKok [Mon, 21 Aug 2023 21:37:44 +0000 (17:37 -0400)] 
update for new behavior of :=

2 years agohoist checks to be more consistent
Alan T. DeKok [Mon, 21 Aug 2023 21:19:58 +0000 (17:19 -0400)] 
hoist checks to be more consistent

2 years agoupdate behavior of :=
Alan T. DeKok [Mon, 21 Aug 2023 21:15:19 +0000 (17:15 -0400)] 
update behavior of :=

if RHS expansion fails, it still nukes all of the LHS

2 years agoReassure coverity (CID #1504052) (#5152)
James Jones [Mon, 21 Aug 2023 19:02:21 +0000 (14:02 -0500)] 
Reassure coverity (CID #1504052) (#5152)

Non-group structural type attributes may always have a namespace
hash table, but coverity can't figure that out.

2 years agoforce flatten unless migration flags are set
Alan T. DeKok [Mon, 21 Aug 2023 16:22:39 +0000 (12:22 -0400)] 
force flatten unless migration flags are set

this means we can safely update all of the decoders to create
nested attributes

2 years agoadd flatten migration configuration
Alan T. DeKok [Mon, 21 Aug 2023 16:16:54 +0000 (12:16 -0400)] 
add flatten migration configuration

it turns out "unflatten" is hard, so we need to find a better way
to deal with things

2 years agoprint out more text around mismatch so we can better find it
Alan T. DeKok [Mon, 21 Aug 2023 15:18:45 +0000 (11:18 -0400)] 
print out more text around mismatch so we can better find it

2 years agoadd unflatten_after_encode for test API
Alan T. DeKok [Mon, 21 Aug 2023 15:18:27 +0000 (11:18 -0400)] 
add unflatten_after_encode for test API

2 years agohandle key fields in unflatten
Alan T. DeKok [Mon, 21 Aug 2023 15:17:18 +0000 (11:17 -0400)] 
handle key fields in unflatten

2 years agoif there's no "next", then we don't need a comma
Alan T. DeKok [Mon, 21 Aug 2023 14:41:15 +0000 (10:41 -0400)] 
if there's no "next", then we don't need a comma

2 years agouse correct name
Alan T. DeKok [Mon, 21 Aug 2023 12:38:58 +0000 (08:38 -0400)] 
use correct name

2 years agoclean up and comments
Alan T. DeKok [Mon, 21 Aug 2023 01:06:05 +0000 (21:06 -0400)] 
clean up and comments

2 years agonotes on immutable children of temporary attibutes
Alan T. DeKok [Mon, 21 Aug 2023 00:56:49 +0000 (20:56 -0400)] 
notes on immutable children of temporary attibutes

2 years agoallow operations on list which has some immutable values
Alan T. DeKok [Mon, 21 Aug 2023 00:48:00 +0000 (20:48 -0400)] 
allow operations on list which has some immutable values

2 years agouse vp_ name for immutable field
Alan T. DeKok [Mon, 21 Aug 2023 00:45:31 +0000 (20:45 -0400)] 
use vp_ name for immutable field

2 years agowe can copy immutable values, and the copy is mutable
Alan T. DeKok [Sun, 20 Aug 2023 22:22:05 +0000 (18:22 -0400)] 
we can copy immutable values, and the copy is mutable

2 years agoadd undocumented immutable xlat, and test based on it
Alan T. DeKok [Sun, 20 Aug 2023 15:33:40 +0000 (11:33 -0400)] 
add undocumented immutable xlat, and test based on it

2 years agoadd immutable flag, and check it most places
Alan T. DeKok [Sun, 20 Aug 2023 14:33:52 +0000 (10:33 -0400)] 
add immutable flag, and check it most places

the main purpose of immutable flags is to prevent users from
modifying values that the server wants to keep around.

As a result, the main checks for immutable values are in the
various editing routines:

    src/lib/util/calc.c - cannot store results to immutable leaves
    src/lib/util/edit.c - cannot edit immutable values
  or delete immutable leaves from lists
    src/lib/unlang/edit.c - cannot store to immutable leaves

Many of the internal value box / pair APIs will ignore the
immutable flag, and happily over-write values.  This behavior
is likely good enough for now.  The intention is to stop admins
from doing stupid things, and not to prevent the internal code
from doing what makes sense.

There is currently no flag in structural VPs which says "contains
an immutable child".  The edit code therefore has to check each
time by walking the list recursively.  That's fine for now.

There is as yet no code to set the immutable flag, or unit tests.
The goal is to have the decoders set the immutable flag as necessary,
which means that they don't need to save / restore attributes with
special meaning.

2 years agohoist the secret flag on fr_pair_value_copy() too
Alan T. DeKok [Sun, 20 Aug 2023 13:47:49 +0000 (09:47 -0400)] 
hoist the secret flag on fr_pair_value_copy() too

2 years agocopy tests from keywords/xlat-dhcpv4
Alan T. DeKok [Sat, 19 Aug 2023 14:51:13 +0000 (10:51 -0400)] 
copy tests from keywords/xlat-dhcpv4

2 years agomigrate more tests to new methods
Alan T. DeKok [Sat, 19 Aug 2023 12:57:20 +0000 (08:57 -0400)] 
migrate more tests to new methods

2 years agoremove unused definitions
Alan T. DeKok [Thu, 17 Aug 2023 20:49:24 +0000 (16:49 -0400)] 
remove unused definitions

2 years agoGet rid of remaining unchecked return value (CID #1533664, #1524617)
James Jones [Fri, 18 Aug 2023 13:54:39 +0000 (08:54 -0500)] 
Get rid of remaining unchecked return value (CID #1533664, #1524617)

2 years agoTidy up on connection close
Nick Porter [Thu, 17 Aug 2023 19:10:45 +0000 (20:10 +0100)] 
Tidy up on connection close

2 years agoSwitch from ntohs() to fr_nbo_to_uint16() (CID #1243443)
James Jones [Thu, 17 Aug 2023 19:34:23 +0000 (14:34 -0500)] 
Switch from ntohs() to fr_nbo_to_uint16() (CID #1243443)

Takes advantage of coverity thinking fr_nbo_to_foo() taints
the passed pointer, which here is it's only use, while the
returned value is used several times.

2 years agoCheck returns of [sd]buff write functions (CIDs listed below)
James Jones [Thu, 17 Aug 2023 15:15:17 +0000 (10:15 -0500)] 
Check returns of [sd]buff write functions (CIDs listed below)

CIDs: 16246161524609152461115246181524615

2 years agoRevert "Remove closed connections from the parent's tracking list"
Nick Porter [Thu, 17 Aug 2023 17:13:12 +0000 (18:13 +0100)] 
Revert "Remove closed connections from the parent's tracking list"

This reverts commit bac1129ed8dab05a976fd97cbcd6df98276104ff.

2 years agoRemove closed connections from the parent's tracking list
Nick Porter [Thu, 17 Aug 2023 17:01:14 +0000 (18:01 +0100)] 
Remove closed connections from the parent's tracking list

2 years agovarious coverity fixes
Alan T. DeKok [Thu, 17 Aug 2023 12:46:50 +0000 (08:46 -0400)] 
various coverity fixes

2 years agoallow &leaf += { list }
Alan T. DeKok [Wed, 16 Aug 2023 13:48:41 +0000 (09:48 -0400)] 
allow &leaf += { list }

which applies all of the list to the first found version of "leaf"

2 years agomove "Alive" to dictionary.compat
Alan T. DeKok [Wed, 16 Aug 2023 12:26:05 +0000 (08:26 -0400)] 
move "Alive" to dictionary.compat

it's not defined in any RFC

2 years agorlm_sql_mysql: Formatting
Arran Cudbard-Bell [Thu, 17 Aug 2023 04:47:02 +0000 (22:47 -0600)] 
rlm_sql_mysql: Formatting

2 years agorlm_sql_mysql: Check validity of conn
Arran Cudbard-Bell [Wed, 16 Aug 2023 22:40:41 +0000 (16:40 -0600)] 
rlm_sql_mysql:  Check validity of conn

If conn's magic number is still good, then there's an extremely high chance conn->sock != NULL.  Closes #5144

2 years agoImprove sql_pair_afrom_row() debug output
Jorge Pereira [Tue, 15 Aug 2023 17:25:25 +0000 (14:25 -0300)] 
Improve sql_pair_afrom_row() debug output

It will change the result for:

e.g:

Tue Aug 15 14:24:21 2023: (0) sql - Found row[1]: Acct-Input-Gigawords := 8192

2 years agoUse canonicalized names for Acct-Status-Type
Alan T. DeKok [Tue, 15 Aug 2023 23:56:19 +0000 (19:56 -0400)] 
Use canonicalized names for Acct-Status-Type

Alive is Livingston or maybe Cistron?  It's not in RFC 2059 or
RFC 2139.  RFC 2866 has Interim-Update:

https://www.rfc-editor.org/rfc/rfc2866.html#section-5.1

So we change the "accounting" type to Interim-Update, and add
a unit test which verifies that any attempt to read Alive will
result in the server printing Interim-Update

2 years agoCheck returns (CID #1538387)
James Jones [Fri, 4 Aug 2023 18:56:57 +0000 (13:56 -0500)] 
Check returns (CID #1538387)

Humans can figure out that
        FR_DBUFF_REMAINING_RETURN(&foo, bar);
implies that one can safely write bar bytes to the dbuff foo,
but coverity can't. There's another use, in fr_tacacs_encode(),
but the following operations using the dbuff are checked there.

2 years agoAttempt at a simpler uninit local buffer workaround (CIDs below)
James Jones [Thu, 10 Aug 2023 22:06:27 +0000 (17:06 -0500)] 
Attempt at a simpler uninit local buffer workaround (CIDs below)

CIDs: 150669015066891504436150404115040201503918

This doesn't name the uninitialized local array, but instead
goes via the sbuff/dbuff API to get to the data.

2 years agoradeapol_uat: Add new script for user tests
Jorge Pereira [Thu, 13 Oct 2022 22:06:11 +0000 (19:06 -0300)] 
radeapol_uat: Add new script for user tests

We need something similar to scripts/util/raduat, but instead of using radclient. it needs to be implemented in python calling the eapol_test.

the python one needs to also take an eapol_test config as part of the request
as a separate file like:

"my_peap_test", "my_peap_test_conf", "my_peap_test_expected"

"my_peap_test" contains all the attributes we want to send
"my_peap_test_conf" contains the eapol test config
"my_peap_test_expected' contains the attributes we want to see , and whether it'll be an Access-Accept or Access-Reject

the python script needs to implement something similar to raduat, with how the test files are laid out
it needs to take "my_peap_test", "my_peap_test_conf", and figure out how to pass them to eapol_test (maybe using the radict)

i.e. how to get the attributes out of "my_peap_test" and pass them in a format eapol_test wants
passing the config and when eapol_test finishes, checking to see if the attributes it returned match "my_peap_test_expected"

2 years agoThere's no need to load in the suppressions file
Arran Cudbard-Bell [Tue, 15 Aug 2023 22:48:40 +0000 (16:48 -0600)] 
There's no need to load in the suppressions file

2 years agoalphabetize leaks
Arran Cudbard-Bell [Tue, 15 Aug 2023 22:46:35 +0000 (16:46 -0600)] 
alphabetize leaks

2 years agowe only care that it doesn't crash.
Alan T. DeKok [Tue, 15 Aug 2023 20:33:52 +0000 (16:33 -0400)] 
we only care that it doesn't crash.

We don't care what the results are

2 years agoallow '=' for list assignment to leaf types, too
Alan T. DeKok [Tue, 15 Aug 2023 20:07:25 +0000 (16:07 -0400)] 
allow '=' for list assignment to leaf types, too

2 years agoclear out old resume function and rctx
Alan T. DeKok [Tue, 15 Aug 2023 12:26:07 +0000 (08:26 -0400)] 
clear out old resume function and rctx

when we have two xlats in a row, the first one might need to be
resumed, so it pushes a resume ctx onto the stack.  It then returns
"done", and the xlat evaluator goes to the next xlat node.

However, the next xlat node might _not_ push a resume function onto
the stack.  So when the evaluator resumes, it will see the first
resume function and rctx, and call it again.  Cue boom.

The solution is on DONE, replace the resume function / rctx with
a NULL one which does nothing.

2 years agocopy from v3.2.x
Alan T. DeKok [Tue, 15 Aug 2023 12:25:38 +0000 (08:25 -0400)] 
copy from v3.2.x

2 years agoFix typos
Jorge Pereira [Mon, 14 Aug 2023 22:49:25 +0000 (19:49 -0300)] 
Fix typos

2 years agoremove diag, as some compilers don't understand it
Alan T. DeKok [Mon, 14 Aug 2023 16:16:44 +0000 (12:16 -0400)] 
remove diag, as some compilers don't understand it

2 years agoclean up for semicolons
Alan T. DeKok [Mon, 14 Aug 2023 12:41:18 +0000 (08:41 -0400)] 
clean up for semicolons

2 years agomove wimax tests to new framework
Alan T. DeKok [Sat, 12 Aug 2023 13:39:24 +0000 (09:39 -0400)] 
move wimax tests to new framework

2 years agoCI: use correct inputs
Matthew Newton [Fri, 11 Aug 2023 22:35:02 +0000 (23:35 +0100)] 
CI: use correct inputs

2 years agojson: Another test
Arran Cudbard-Bell [Fri, 11 Aug 2023 20:47:27 +0000 (14:47 -0600)] 
json: Another test

2 years agodelay commas until necessary
Alan T. DeKok [Fri, 11 Aug 2023 13:33:27 +0000 (09:33 -0400)] 
delay commas until necessary

we have a host of stopping conditions, which can be nested.
As a result, a simple `next != NULL` check isn't enough to
determine if we need to write out a comma.  Instead, we delay
the comma until necessary.

2 years agoremove extraneous ,
Alan T. DeKok [Fri, 11 Aug 2023 13:27:23 +0000 (09:27 -0400)] 
remove extraneous ,

2 years agoclean up fr_pair_list_print() and make it work in more situations
Alan T. DeKok [Thu, 10 Aug 2023 16:03:51 +0000 (12:03 -0400)] 
clean up fr_pair_list_print() and make it work in more situations

2 years agoremove extraneous assert
Alan T. DeKok [Wed, 9 Aug 2023 17:21:32 +0000 (13:21 -0400)] 
remove extraneous assert

2 years agojson: various fixes
Arran Cudbard-Bell [Wed, 9 Aug 2023 22:24:03 +0000 (16:24 -0600)] 
json: various fixes

2 years agojson: Modify json_quote function to be more useful
Arran Cudbard-Bell [Wed, 9 Aug 2023 21:29:38 +0000 (15:29 -0600)] 
json: Modify json_quote function to be more useful

Output can now be interpolated with other JSON text and will always produce valid JSON values.

2 years agoinitialise with zero length strings
Arran Cudbard-Bell [Thu, 3 Aug 2023 21:30:53 +0000 (15:30 -0600)] 
initialise with zero length strings

2 years agoit helps to parse psk_identity etc. in the client configuration
Alan T. DeKok [Wed, 9 Aug 2023 14:55:44 +0000 (10:55 -0400)] 
it helps to parse psk_identity etc. in the client configuration

2 years agotypo
James Jones [Tue, 8 Aug 2023 19:57:23 +0000 (14:57 -0500)] 
typo

2 years agoadd and use fr_pair_legacy_print_nested flag
Alan T. DeKok [Tue, 8 Aug 2023 19:59:20 +0000 (15:59 -0400)] 
add and use fr_pair_legacy_print_nested flag

so that we can update the tests to print flat attributes as nested,
without updating all of the tests.

The next step is to set the flag in the tests, so that the tests
will parse flat attributes, but will always print nested ones.

2 years agounify "attribute" and "pair" commands
Alan T. DeKok [Tue, 8 Aug 2023 14:30:04 +0000 (10:30 -0400)] 
unify "attribute" and "pair" commands

the "attribute" command parsed a pair or a list of pairs, as did
the "pair" command.  But the "pair" command did it manually, which
meant that it was unable to correctly deal with structural attributes

2 years agothis was unused by anything
Alan T. DeKok [Tue, 8 Aug 2023 14:25:22 +0000 (10:25 -0400)] 
this was unused by anything

2 years agoAdd Ruckus attributes from Cloudpath config
Nick Porter [Tue, 8 Aug 2023 14:55:05 +0000 (15:55 +0100)] 
Add Ruckus attributes from Cloudpath config

2 years agoremove stray assert
Alan T. DeKok [Tue, 8 Aug 2023 12:57:19 +0000 (08:57 -0400)] 
remove stray assert