]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
2 years agovscode: Always insert a final newline
Arran Cudbard-Bell [Wed, 29 Mar 2023 22:54:51 +0000 (16:54 -0600)] 
vscode: Always insert a final newline

2 years agoxlat: Move function registration code into its own source file
Arran Cudbard-Bell [Wed, 29 Mar 2023 22:44:10 +0000 (16:44 -0600)] 
xlat: Move function registration code into its own source file

2 years agovscode: Always trim trailing whitespace
Arran Cudbard-Bell [Wed, 29 Mar 2023 22:43:02 +0000 (16:43 -0600)] 
vscode: Always trim trailing whitespace

2 years agosubrequests/synchronous interpreter: Use the detached done callback to free requests
Arran Cudbard-Bell [Wed, 29 Mar 2023 18:25:58 +0000 (12:25 -0600)] 
subrequests/synchronous interpreter: Use the detached done callback to free requests

Use unlang_interpret_signal to manage cleaning up detached requests instead of having custom code inside the subrequest code

2 years agorequest: When a request is detached it's no longer detachable...
Arran Cudbard-Bell [Wed, 29 Mar 2023 18:24:40 +0000 (12:24 -0600)] 
request: When a request is detached it's no longer detachable...

2 years agosubrequest: More verbose log messages on subrequest completion
Arran Cudbard-Bell [Wed, 29 Mar 2023 02:55:08 +0000 (20:55 -0600)] 
subrequest: More verbose log messages on subrequest completion

2 years agosubrequest: Detached subrequest sections should not return calculate the result of...
Arran Cudbard-Bell [Wed, 29 Mar 2023 02:50:18 +0000 (20:50 -0600)] 
subrequest: Detached subrequest sections should not return calculate the result of the section

What was happening previously was the current section rcode was being evaluated with the priorities of the subrequest section, and causing spurious failures.

2 years agoxlat: Set func flags using a separate function as the majority of registrations don...
Arran Cudbard-Bell [Tue, 28 Mar 2023 23:58:36 +0000 (17:58 -0600)] 
xlat: Set func flags using a separate function as the majority of registrations don't have flags set

2 years agoDon't leak memory on error conditions (#4947)
Jorge Pereira [Tue, 28 Mar 2023 22:42:45 +0000 (19:42 -0300)] 
Don't leak memory on error conditions (#4947)

2 years agointerpreter: Be more eplicit about which action gets used for what
Arran Cudbard-Bell [Tue, 28 Mar 2023 20:46:49 +0000 (14:46 -0600)] 
interpreter: Be more eplicit about which action gets used for what

2 years agoRevert "tacacs: Move packet code check to before the main encoder?"
Arran Cudbard-Bell [Tue, 28 Mar 2023 20:36:39 +0000 (14:36 -0600)] 
Revert "tacacs: Move packet code check to before the main encoder?"

This reverts commit 93885589666b73e660d42d94bd5a330483f58914.

2 years agodocs: Document missing argument
Nick Porter [Tue, 28 Mar 2023 12:50:42 +0000 (13:50 +0100)] 
docs: Document missing argument

2 years agoEscape & for doxygen
Nick Porter [Tue, 28 Mar 2023 12:46:52 +0000 (13:46 +0100)] 
Escape & for doxygen

2 years agomove disallow_qualifiers boolean to list_presence enum
Alan T. DeKok [Tue, 28 Mar 2023 07:36:46 +0000 (16:36 +0900)] 
move disallow_qualifiers boolean to list_presence enum

2 years agoadd enum to allow / forbid / require list references
Alan T. DeKok [Tue, 28 Mar 2023 05:01:42 +0000 (14:01 +0900)] 
add enum to allow / forbid / require list references

because it makes no sense to do:

&reply += {
&request.User-Name = "foo"
}

2 years agotypos
Alan T. DeKok [Tue, 28 Mar 2023 00:49:21 +0000 (09:49 +0900)] 
typos

2 years agoadd BFD to PROTOCOLS list so that the fuzzer can run
Alan T. DeKok [Tue, 28 Mar 2023 00:48:12 +0000 (09:48 +0900)] 
add BFD to PROTOCOLS list so that the fuzzer can run

2 years agoDetach cancelled children from their parents
Arran Cudbard-Bell [Tue, 28 Mar 2023 00:10:16 +0000 (18:10 -0600)] 
Detach cancelled children from their parents

2 years agoFix various warnings
Arran Cudbard-Bell [Tue, 28 Mar 2023 00:06:55 +0000 (18:06 -0600)] 
Fix various warnings

2 years agoFix counts
Arran Cudbard-Bell [Mon, 27 Mar 2023 23:16:45 +0000 (17:16 -0600)] 
Fix counts

2 years agofuzzer: Ignore extracted corpus files for BFD
Arran Cudbard-Bell [Sat, 18 Mar 2023 04:46:41 +0000 (00:46 -0400)] 
fuzzer: Ignore extracted corpus files for BFD

2 years agotacacs: Move regression tests into their own file
Arran Cudbard-Bell [Sat, 18 Mar 2023 04:45:25 +0000 (00:45 -0400)] 
tacacs: Move regression tests into their own file

2 years agotacacs: Move packet code check to before the main encoder?
Arran Cudbard-Bell [Sat, 18 Mar 2023 04:40:17 +0000 (00:40 -0400)] 
tacacs: Move packet code check to before the main encoder?

2 years agocancel: Add more complete tests
Arran Cudbard-Bell [Sat, 18 Mar 2023 04:37:56 +0000 (00:37 -0400)] 
cancel: Add more complete tests

2 years agoFormatting
Arran Cudbard-Bell [Sat, 18 Mar 2023 04:37:28 +0000 (00:37 -0400)] 
Formatting

2 years agosubrequest: Resume the parent if the child is cancelled
Arran Cudbard-Bell [Sat, 18 Mar 2023 04:37:20 +0000 (00:37 -0400)] 
subrequest:  Resume the parent if the child is cancelled

2 years agocancel: Insert dummy resume function to keep interpreter happy
Arran Cudbard-Bell [Sat, 18 Mar 2023 04:36:56 +0000 (00:36 -0400)] 
cancel: Insert dummy resume function to keep interpreter happy

2 years agosynchronous interpreter: Decrement yielded count on stopped requests
Arran Cudbard-Bell [Sat, 18 Mar 2023 04:35:58 +0000 (00:35 -0400)] 
synchronous interpreter: Decrement yielded count on stopped requests

2 years agoFirst attempt at a state transition diagram for trunk requests (#4940)
James Jones [Mon, 27 Mar 2023 22:16:32 +0000 (17:16 -0500)] 
First attempt at a state transition diagram for trunk requests (#4940)

Some of the functions cause two state transitions. Those are shown
with dashed-style edges, with a distinct color.

2 years agoCI: mirror more Docker images locally
Matthew Newton [Thu, 23 Mar 2023 16:20:31 +0000 (16:20 +0000)] 
CI: mirror more Docker images locally

2 years agomore magic
Alan T. DeKok [Thu, 23 Mar 2023 20:35:43 +0000 (16:35 -0400)] 
more magic

2 years ago$(Q) -> ${Q}
Alan T. DeKok [Thu, 23 Mar 2023 17:20:09 +0000 (13:20 -0400)] 
$(Q) -> ${Q}

$(...) can be function calls in GNU Make.

${...} are always variable references

2 years agoCI: use local copies of Docker images
Matthew Newton [Thu, 23 Mar 2023 16:25:38 +0000 (16:25 +0000)] 
CI: use local copies of Docker images

2 years agoCI: remove post-ci cleanup job
Matthew Newton [Thu, 23 Mar 2023 15:31:02 +0000 (15:31 +0000)] 
CI: remove post-ci cleanup job

2 years agocheck for "too small" earlier
Alan T. DeKok [Thu, 23 Mar 2023 13:43:48 +0000 (09:43 -0400)] 
check for "too small" earlier

so that we don't allocate VPs, try to decode them, and then discover
that it never would have worked.

2 years agocheck for overflow when we add the length field
Alan T. DeKok [Thu, 23 Mar 2023 13:43:25 +0000 (09:43 -0400)] 
check for overflow when we add the length field

2 years ago0 return is "cannot decode", so we stop
Alan T. DeKok [Wed, 22 Mar 2023 21:40:01 +0000 (17:40 -0400)] 
0 return is "cannot decode", so we stop

2 years agoCI: gcc-11 has issues with the fuzzer
Matthew Newton [Wed, 22 Mar 2023 19:25:28 +0000 (19:25 +0000)] 
CI: gcc-11 has issues with the fuzzer

2 years agoadd BFD fuzzer
Alan T. DeKok [Wed, 22 Mar 2023 15:11:19 +0000 (11:11 -0400)] 
add BFD fuzzer

2 years agofurther simplifications
Alan T. DeKok [Tue, 21 Mar 2023 20:36:11 +0000 (16:36 -0400)] 
further simplifications

2 years agoCI: use local docker image for self-hosted runs
Matthew Newton [Tue, 21 Mar 2023 22:47:35 +0000 (22:47 +0000)] 
CI: use local docker image for self-hosted runs

2 years agoCI: build local Docker images for CI runs
Matthew Newton [Tue, 21 Mar 2023 22:47:19 +0000 (22:47 +0000)] 
CI: build local Docker images for CI runs

2 years agojust send the reply
Alan T. DeKok [Tue, 21 Mar 2023 20:30:23 +0000 (16:30 -0400)] 
just send the reply

2 years agothere's only one possibility here. CID #1524493
Alan T. DeKok [Tue, 21 Mar 2023 20:28:49 +0000 (16:28 -0400)] 
there's only one possibility here.  CID #1524493

2 years agodon't block forever if we fail to enqueue a packet
Alan T. DeKok [Tue, 21 Mar 2023 20:12:35 +0000 (16:12 -0400)] 
don't block forever if we fail to enqueue a packet

2 years agoDO_NOT_RESPOND is a valid reply packet type
Alan T. DeKok [Tue, 21 Mar 2023 15:41:04 +0000 (11:41 -0400)] 
DO_NOT_RESPOND is a valid reply packet type

2 years agopass the correct context
Alan T. DeKok [Tue, 21 Mar 2023 15:39:20 +0000 (11:39 -0400)] 
pass the correct context

2 years agohoist useful error messages
Alan T. DeKok [Tue, 21 Mar 2023 15:25:45 +0000 (11:25 -0400)] 
hoist useful error messages

2 years agov4: Switch rlm_smtp to slab allocated connection handles (#4926)
Nick Porter [Tue, 21 Mar 2023 15:28:25 +0000 (15:28 +0000)] 
v4: Switch rlm_smtp to slab allocated connection handles (#4926)

* Add CURL connection config to rlm_smtp

* Add slab to rlm_smtp_thead_t and initialise and free with thread

* Rename mod_authorize to mod_mail

mod_mail is the general purpose method to send an email - not
specifically tied to a given processing section.

* Add config options to specify credentials for sending emails

* Use CURL handles from slab allocator rather than one off allocated

* Move setting of consistent CURL options to element initialiser

* Merge the two resume callbacks - they have identical functionality

* Remove unnecessary header

* Set missing list_def

* Freeing of curl slists is done by slab element destructor

* Rearrange initialisation of mail_ctx

In case errors occur and the handle is released early

* Actually set the user name and password in mod_authenticate

* Use a specific structure for SMTP header list

It's not really a map as the LHS is just names for the SMTP headers

* Remove un-used variables

* Remove checking of Auth-Type attribute

This module never sets Auth-Type, and the check only prevents the module
from being used to send a mail if Auth-Type was already set.

* CI: Improve tidy up in exim-setup.sh

* CI: Add authentication to test SMTP server

* CI: Update exim-setup to honour exim's rules on tainted data

* Fix up rlm_smtp tests

* Enable tests of rlm_smtp

* Extend wait for SMTP deliveries to allow for slow CI hosts

* CI: Update exim-setup.sh to work with Docker container

* Errors should be REDEBUG

* Talloc tmpl expansions off request rather than thread

So they are cleared when the request is freed

* WS

* Update default smtp module config

2 years agoone last change to tmpl tokenizer for groups.
Alan T. DeKok [Tue, 21 Mar 2023 14:44:33 +0000 (10:44 -0400)] 
one last change to tmpl tokenizer for groups.

The function tmpl_attr_afrom_substr() calls itself recursively,
but doesn't update at_rules->dict_def.  So when looking at groups,
we have to prioritize the input parent over the dict_def

2 years agoDisable caller graphs for (some) functions with many callers (#4919)
James Jones [Mon, 20 Mar 2023 23:31:46 +0000 (18:31 -0500)] 
Disable caller graphs for (some) functions with many callers (#4919)

It turns out that one has to specify @hidecallergraph twice for
non-static functions: once where it's declared in a header and
once where it's defined. This doesn't catch everything; there's
still the matter of

1. Library functions. According to the doxygen-user mailing list,
   doxygen won't make *call* graphs for library functions... but
   what causes it to generate *caller* graphs for library functions,
   and if it does, why isn't it complaining about fprintf(), which
   FreeRADIUS code calls far more than fifty times?

2. xlat_init() and strlcpy(). (On Ubuntu, and probably other Linuxes,
   strlcpy() is in an optional libbsd package, and configure
   understandably doesn't check for that--hence we get the "missing"
   version.) For some still-unknown reason, two @hidecallergraphs
   doesn't do the trick.

2 years agoBump to latest FreeBSD GitHub action
Nick Porter [Fri, 17 Mar 2023 17:38:53 +0000 (17:38 +0000)] 
Bump to latest FreeBSD GitHub action

2 years agoCI: Update test LDAP config to allow SASL binds
Nick Porter [Mon, 20 Mar 2023 18:56:55 +0000 (18:56 +0000)] 
CI: Update test LDAP config to allow SASL binds

2 years agomore cleanups of tmpl tokenize code
Alan T. DeKok [Mon, 20 Mar 2023 19:04:21 +0000 (15:04 -0400)] 
more cleanups of tmpl tokenize code

disallow using OIDs to reference internal attributes.  Most of them
will be converted to DEFINEs, which have no (or irrelevant / changing)
numbers.

Remove duplicate check for "allow_foreign".  Because the main
dictionary parsing code should be checking that.

2 years agodon't set flags.internal here.
Alan T. DeKok [Mon, 20 Mar 2023 15:30:12 +0000 (11:30 -0400)] 
don't set flags.internal here.

The dictionary code should do this, as per the previous commit.

The tmpl tokenizer has no business mangling the internals of the
attribute structures

2 years agoset internal flag from parent
Alan T. DeKok [Mon, 20 Mar 2023 15:25:59 +0000 (11:25 -0400)] 
set internal flag from parent

so that others don't need to do this

2 years agoHonour exec module timeout for module calls
Nick Porter [Mon, 20 Mar 2023 10:43:13 +0000 (10:43 +0000)] 
Honour exec module timeout for module calls

2 years agoAdd nullable option to module enviroment
Nick Porter [Wed, 15 Mar 2023 14:35:47 +0000 (14:35 +0000)] 
Add nullable option to module enviroment

Differentiates between:

 - required - config pair must exist
 - nullable - tmpl can return nothing

2 years agoAdd optional pointer to original tmpl_t when expanding module environment
Nick Porter [Wed, 15 Mar 2023 13:35:15 +0000 (13:35 +0000)] 
Add optional pointer to original tmpl_t when expanding module environment

Allows the module receiving value boxes from expanded tmpls to know
where the data came from e.g. was it static data or an expanded
attribute.

2 years agoUse default exec timeout for exec tmpls
Nick Porter [Mon, 20 Mar 2023 08:20:27 +0000 (08:20 +0000)] 
Use default exec timeout for exec tmpls

2 years agomore changes to tmpl tokenizing and tests
Alan T. DeKok [Sun, 19 Mar 2023 22:14:17 +0000 (18:14 -0400)] 
more changes to tmpl tokenizing and tests

add assertions to clarify assumptions, comments to describe what
is going on, etc.

2 years agostupid case insensitive file systems
Alan T. DeKok [Sun, 19 Mar 2023 21:23:14 +0000 (17:23 -0400)] 
stupid case insensitive file systems

2 years agotest for parsing foreign attributes in the current context
Alan T. DeKok [Sun, 19 Mar 2023 21:00:14 +0000 (17:00 -0400)] 
test for parsing foreign attributes in the current context

previously only used by the ldap_sync code.  it's worth adding a
test here for it, so errors are caught earlier.

2 years agoRevert "revert last two commits."
Alan T. DeKok [Sun, 19 Mar 2023 14:23:17 +0000 (10:23 -0400)] 
Revert "revert last two commits."

This reverts commit b4a5aada3801b57f94ee2ade65f35f8f25ea5e10.

2 years agorevert last two commits.
Alan T. DeKok [Sat, 18 Mar 2023 19:38:14 +0000 (15:38 -0400)] 
revert last two commits.

The whole process of resolving attributes is extremely complex,
fragile, and undocumented  :(

2 years agowe need to set our_parent=NULL when switching namespace
Alan T. DeKok [Sat, 18 Mar 2023 19:15:36 +0000 (15:15 -0400)] 
we need to set our_parent=NULL when switching namespace

2 years agosimplify setting of parent / namespace for grouping attributes
Alan T. DeKok [Sat, 18 Mar 2023 18:27:34 +0000 (14:27 -0400)] 
simplify setting of parent / namespace for grouping attributes

we can't put random protocol attributes into an internal group,
as there's no way to reference them

2 years agodisallow_internal is no longer set by anything
Alan T. DeKok [Fri, 17 Mar 2023 16:43:19 +0000 (12:43 -0400)] 
disallow_internal is no longer set by anything

and therefore no longer used or needed

2 years agojust use fr_hash(), instead of hand-rolled hash from 2002.
Alan T. DeKok [Fri, 17 Mar 2023 13:15:00 +0000 (09:15 -0400)] 
just use fr_hash(), instead of hand-rolled hash from 2002.

2 years agouse macro instead of oddly named field
Alan T. DeKok [Thu, 16 Mar 2023 15:21:04 +0000 (11:21 -0400)] 
use macro instead of oddly named field

2 years agoCheck fr_internal_encode_list() return in mod_encode() (#4930)
James Jones [Thu, 16 Mar 2023 14:30:08 +0000 (09:30 -0500)] 
Check fr_internal_encode_list() return in mod_encode() (#4930)

2 years agoclean up fd on all error paths
Alan T. DeKok [Thu, 16 Mar 2023 13:12:38 +0000 (09:12 -0400)] 
clean up fd on all error paths

2 years agofr_io_connection_alloc() closes the FD. CID #1522023
Alan T. DeKok [Wed, 15 Mar 2023 20:54:50 +0000 (16:54 -0400)] 
fr_io_connection_alloc() closes the FD.  CID #1522023

2 years agodepend on the internal encoder library, too
Alan T. DeKok [Wed, 15 Mar 2023 19:48:29 +0000 (15:48 -0400)] 
depend on the internal encoder library, too

2 years agoupdate BFD sample virtual server
Alan T. DeKok [Wed, 15 Mar 2023 18:59:13 +0000 (14:59 -0400)] 
update BFD sample virtual server

2 years agoencode additional data
Alan T. DeKok [Wed, 15 Mar 2023 18:34:57 +0000 (14:34 -0400)] 
encode additional data

the main BFD state machine just creates packets manually from
internal data structures, for speed.  So sending packets skips
the encoder, and we have to encode additional data ourselves.

2 years agodefine, encode, and decode additional data after a BFD packet.
Alan T. DeKok [Wed, 15 Mar 2023 18:27:55 +0000 (14:27 -0400)] 
define, encode, and decode additional data after a BFD packet.

2 years agoallow "offset" field for structs when "length=..."
Alan T. DeKok [Wed, 15 Mar 2023 17:53:44 +0000 (13:53 -0400)] 
allow "offset" field for structs when "length=..."

so that we can pack BFD structures correctly

2 years agomore debugging
Alan T. DeKok [Wed, 15 Mar 2023 13:20:21 +0000 (09:20 -0400)] 
more debugging

2 years agomark client as active
Alan T. DeKok [Wed, 15 Mar 2023 13:20:11 +0000 (09:20 -0400)] 
mark client as active

2 years agoUpdate dictionary.wifialliance (#4928)
Stefan Paetow [Wed, 15 Mar 2023 17:48:21 +0000 (17:48 +0000)] 
Update dictionary.wifialliance (#4928)

Discovered HS20-Roaming-Consortium being mentioned here:
https://wiki.geant.org/pages/viewpage.action?pageId=133763844

2 years agoPacify clang scan
Nick Porter [Wed, 15 Mar 2023 08:59:23 +0000 (08:59 +0000)] 
Pacify clang scan

2 years agoOnly used in debug builds
Nick Porter [Wed, 15 Mar 2023 08:58:29 +0000 (08:58 +0000)] 
Only used in debug builds

2 years agosign, etc. issues
Alan T. DeKok [Wed, 15 Mar 2023 02:07:48 +0000 (22:07 -0400)] 
sign, etc. issues

2 years agocheck auth-type lengths, too
Alan T. DeKok [Tue, 14 Mar 2023 21:40:57 +0000 (17:40 -0400)] 
check auth-type lengths, too

2 years agogo to admin-down on routing errors
Alan T. DeKok [Tue, 14 Mar 2023 21:28:28 +0000 (17:28 -0400)] 
go to admin-down on routing errors

2 years agowe don't need unlang_module_resume_t any more.
Alan T. DeKok [Tue, 14 Mar 2023 21:12:46 +0000 (17:12 -0400)] 
we don't need unlang_module_resume_t any more.

it's just a module method

perl -p -i -e 's/unlang_module_resume_t/module_method_t/g' $(git grep -l unlang_module_resume_t src/)

2 years agorun "send foo" through unlang
Alan T. DeKok [Tue, 14 Mar 2023 21:09:29 +0000 (17:09 -0400)] 
run "send foo" through unlang

2 years agoprocess sending BFD packets
Alan T. DeKok [Tue, 14 Mar 2023 21:04:39 +0000 (17:04 -0400)] 
process sending BFD packets

where we don't have a request, but we do have a reply

2 years agosimple auth is 3 + password length
Alan T. DeKok [Tue, 14 Mar 2023 17:47:26 +0000 (13:47 -0400)] 
simple auth is 3 + password length

2 years agoAPI to allocate an io_track_t
Alan T. DeKok [Mon, 13 Mar 2023 18:28:17 +0000 (14:28 -0400)] 
API to allocate an io_track_t

for sending to the worker

2 years agoAPI to allow sending packets directly to the worker
Alan T. DeKok [Mon, 13 Mar 2023 18:29:09 +0000 (14:29 -0400)] 
API to allow sending packets directly to the worker

2 years agoclean up debug output
Alan T. DeKok [Mon, 13 Mar 2023 20:32:47 +0000 (16:32 -0400)] 
clean up debug output

use

BFD <self> peer <name> message

as we don't really care about IP addresses and ports

2 years agomove check for "already started" to function which manages it
Alan T. DeKok [Mon, 13 Mar 2023 20:31:23 +0000 (16:31 -0400)] 
move check for "already started" to function which manages it

2 years agoleave detection_time as not multiplied by detect_multi
Alan T. DeKok [Mon, 13 Mar 2023 20:30:56 +0000 (16:30 -0400)] 
leave detection_time as not multiplied by detect_multi

which makes some of the logic a little simpler

2 years agodon't restart polling if we're already polling
Alan T. DeKok [Mon, 13 Mar 2023 20:29:05 +0000 (16:29 -0400)] 
don't restart polling if we're already polling

2 years agoremove unnecessary checks for app_io decoder
Alan T. DeKok [Sun, 12 Mar 2023 01:49:03 +0000 (20:49 -0500)] 
remove unnecessary checks for app_io decoder

2 years agohoist common code to worker
Alan T. DeKok [Sun, 12 Mar 2023 01:43:04 +0000 (20:43 -0500)] 
hoist common code to worker

none of the app_io libraries currently have their own encode
functions.  So remove the duplicate code in each proto_foo which
checks for that.

Instead, hoist it to the worker, which prioritizes the app_io
over the app encode routine

2 years agodon't write data on RECV packet or STATE CHANGE
Alan T. DeKok [Sun, 12 Mar 2023 01:32:59 +0000 (20:32 -0500)] 
don't write data on RECV packet or STATE CHANGE

2 years agoallow for zero data in messages
Alan T. DeKok [Sun, 12 Mar 2023 01:09:46 +0000 (20:09 -0500)] 
allow for zero data in messages