]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
3 years agoupdate comments
Alan T. DeKok [Fri, 20 May 2022 19:17:32 +0000 (15:17 -0400)] 
update comments

3 years agojust use talloc_const_free()
Alan T. DeKok [Fri, 20 May 2022 18:53:29 +0000 (14:53 -0400)] 
just use talloc_const_free()

3 years agojust use talloc_const_free
Alan T. DeKok [Fri, 20 May 2022 18:52:56 +0000 (14:52 -0400)] 
just use talloc_const_free

3 years agoPlacate -Wincompatible-pointer-types-discards-qualifiers (#4523)
James Jones [Fri, 20 May 2022 16:27:28 +0000 (11:27 -0500)] 
Placate -Wincompatible-pointer-types-discards-qualifiers (#4523)

3 years agore-enable purify.txt tests
Alan T. DeKok [Fri, 20 May 2022 16:07:20 +0000 (12:07 -0400)] 
re-enable purify.txt tests

With some hacks to do xlat thread instantiation only when running
the xlat_purify tests.  If "-p" is passed in other circumstances,
you will get weird and esoteric errors.  Oh well.

That will be fixed once we get rid of conditions, and replace them
with the new xlat expressions.

3 years agotry to resolve tmpls, and give better errors
Alan T. DeKok [Fri, 20 May 2022 13:42:23 +0000 (09:42 -0400)] 
try to resolve tmpls, and give better errors

3 years agoresolve function arguments before the function itself
Alan T. DeKok [Fri, 20 May 2022 13:41:38 +0000 (09:41 -0400)] 
resolve function arguments before the function itself

otherwise the function may steal the arguments into its internal
structures, where they cannot be resolved.

3 years agolists are resolved as attributes
Alan T. DeKok [Fri, 20 May 2022 13:41:18 +0000 (09:41 -0400)] 
lists are resolved as attributes

3 years agoinitialize more fields
Alan T. DeKok [Fri, 20 May 2022 13:29:15 +0000 (09:29 -0400)] 
initialize more fields

3 years agoset more flags properly, and try to resolve things.
Alan T. DeKok [Thu, 19 May 2022 23:23:55 +0000 (19:23 -0400)] 
set more flags properly, and try to resolve things.

There's (as yet) no "resolve" callback for the xlat functions,
so we can't parse things like

&Service-Type == Framed-User

The LHS will be an attribute, and the RHS will be TMPL_UNRESOLVED.

The interpreter currently does this resolution in all kinds of
complex pass2_fixup functions.  We will need to move those fixups
to common code, and call the custom resolvers from xlat_resolve()

3 years agolet's assert at the right point.
Alan T. DeKok [Thu, 19 May 2022 23:27:25 +0000 (19:27 -0400)] 
let's assert at the right point.

3 years agomove prototype of xlat_purify()
Alan T. DeKok [Thu, 19 May 2022 23:06:55 +0000 (19:06 -0400)] 
move prototype of xlat_purify()

3 years agoheads start out as pure
Alan T. DeKok [Thu, 19 May 2022 23:06:41 +0000 (19:06 -0400)] 
heads start out as pure

3 years agoinitialize more fields
Alan T. DeKok [Thu, 19 May 2022 23:06:13 +0000 (19:06 -0400)] 
initialize more fields

3 years agoonly set destructors if they're going to do work.
Alan T. DeKok [Thu, 19 May 2022 23:01:03 +0000 (19:01 -0400)] 
only set destructors if they're going to do work.

This papers over certain issues with pure functions, and purifying
them.  But arguably pure functions should use no instance data,
and should take no destructors.  If they do, they're not pure.

3 years agoprint flags, and don't assume XLAT_TMPLs are all attributes
Alan T. DeKok [Thu, 19 May 2022 20:12:19 +0000 (16:12 -0400)] 
print flags, and don't assume XLAT_TMPLs are all attributes

3 years agolet's set can_purify here, too.
Alan T. DeKok [Thu, 19 May 2022 20:11:04 +0000 (16:11 -0400)] 
let's set can_purify here, too.

Note that we don't deal well with an N-ary operation which
starts off with pure children, and then has impure children
later appended.  That needs a bit more thinking

3 years agoFix permissions for mods_config/sql extras in rpms
Nick Porter [Fri, 20 May 2022 13:00:39 +0000 (14:00 +0100)] 
Fix permissions for mods_config/sql extras in rpms

3 years agoDon't assert on resync Close #4522
Arran Cudbard-Bell [Fri, 20 May 2022 12:46:24 +0000 (07:46 -0500)] 
Don't assert on resync Close #4522

3 years agorlm_couchbase: Fix several issues (#4517)
Jorge Pereira [Thu, 19 May 2022 23:00:49 +0000 (20:00 -0300)] 
rlm_couchbase: Fix several issues (#4517)

3 years agoCheck return values in rlm_date.c (CID #1503947, #1503971) (#4520)
James Jones [Thu, 19 May 2022 22:59:43 +0000 (17:59 -0500)] 
Check return values in rlm_date.c (CID #1503947, #1503971) (#4520)

3 years agoCatch the non-OSX cmd->install_path == NULL case (CID #1504302) (#4521)
James Jones [Thu, 19 May 2022 22:56:13 +0000 (17:56 -0500)] 
Catch the non-OSX cmd->install_path == NULL case (CID #1504302) (#4521)

3 years agoadd xlat_purify() function
Alan T. DeKok [Thu, 19 May 2022 18:28:50 +0000 (14:28 -0400)] 
add xlat_purify() function

for now, it calls unlang_interpret_synchronous().  We'll fix
that later.

3 years agoshut up clang scan
Alan T. DeKok [Thu, 19 May 2022 18:28:03 +0000 (14:28 -0400)] 
shut up clang scan

3 years agoon second thought, this isn't necessary
Alan T. DeKok [Thu, 19 May 2022 15:59:54 +0000 (11:59 -0400)] 
on second thought, this isn't necessary

3 years agodouble-check and fix flags.
Alan T. DeKok [Thu, 19 May 2022 15:38:07 +0000 (11:38 -0400)] 
double-check and fix flags.

We now have a "can_purify" flag.  This is set to "true" for
pure functions which have pure arguments.  And for alternations
which have pure arguments.

%% is set to pure.  XLAT_BOX and XLAT_LITERAL are pure, but
they are not "can_purify".

The result is that we tell if there are portions of the tree
which need additional work for purification.

3 years agothis loop isn't necessary. It's done by xlat_copy.
Alan T. DeKok [Thu, 19 May 2022 14:48:26 +0000 (10:48 -0400)] 
this loop isn't necessary.  It's done by xlat_copy.

3 years agoupdate APIs to allow for "evaluate only one node"
Alan T. DeKok [Thu, 19 May 2022 14:39:49 +0000 (10:39 -0400)] 
update APIs to allow for "evaluate only one node"

instead of looping through everything

3 years agoAdd util-linux as dependency for freeradius-config rpm
Nick Porter [Thu, 19 May 2022 10:36:15 +0000 (11:36 +0100)] 
Add util-linux as dependency for freeradius-config rpm

Required to run the certificate generation post install script

3 years agoAlways put something in temporary buffer, if only "" (CID #1503992) (#4519)
James Jones [Wed, 18 May 2022 21:24:34 +0000 (16:24 -0500)] 
Always put something in temporary buffer, if only "" (CID #1503992) (#4519)

From the point where src->dst_type is determined to have fixed
size, fr_value_box_from_substr() works with a local copy... but
if fr_sbuff_remaining() returned zero, nothing was written in the
local copy. With this change, in that case, the local copy is made
an empty string, NUL-terminated.

3 years agoAdd a second run of installing rpm build dependencies
Nick Porter [Wed, 18 May 2022 10:01:21 +0000 (11:01 +0100)] 
Add a second run of installing rpm build dependencies

It has been observed that not all dependencies get installed first time
on rocky 8

3 years agoRevert "clean up internal requests if they have no parent"
Alan T. DeKok [Wed, 18 May 2022 00:30:50 +0000 (20:30 -0400)] 
Revert "clean up internal requests if they have no parent"

This reverts commit 9f8b9bb3ad94687b378f5539a1010310a089bc80.

the interpreter should still clean up some requests which have
no parent, as there are very much cases where those are leaked.
however, until we track all of those issues down, let's not
break CI

3 years agoclean up internal requests if they have no parent
Alan T. DeKok [Wed, 18 May 2022 00:17:51 +0000 (20:17 -0400)] 
clean up internal requests if they have no parent

Specifically for trigger_exec(), which can be called with
a real interpreter, but no parent for the "request" which is
running the trigger.

3 years agoRevert "put yielded increment / decrement into the callbacks"
Alan T. DeKok [Wed, 18 May 2022 00:15:19 +0000 (20:15 -0400)] 
Revert "put yielded increment / decrement into the callbacks"

This reverts commit a3aee1615ab0986cebe596c536e840e667de2943.

intp->func.resume() is called when a request _starts_ running
for the first time, too.  Which means that we can't decrement
the "yielded" count, because it's already at zero

3 years agoadd "help" target for laziness
Alan T. DeKok [Wed, 18 May 2022 00:04:25 +0000 (20:04 -0400)] 
add "help" target for laziness

3 years agoused
Alan T. DeKok [Tue, 17 May 2022 23:58:36 +0000 (19:58 -0400)] 
used

3 years agoremove old code and just use unlang_module_yield_to_section()
Alan T. DeKok [Tue, 17 May 2022 21:43:11 +0000 (17:43 -0400)] 
remove old code and just use unlang_module_yield_to_section()

there are a few other places which use unlang_interpret_synchronous()
which could likely also be converted.

3 years agocheck for a new event list only once.
Alan T. DeKok [Tue, 17 May 2022 20:57:05 +0000 (16:57 -0400)] 
check for a new event list only once.

3 years agoput yielded increment / decrement into the callbacks
Alan T. DeKok [Tue, 17 May 2022 20:55:25 +0000 (16:55 -0400)] 
put yielded increment / decrement into the callbacks

which makes the main interpret loop a little clearer

3 years agoadd dict in preparation for xlat_purify
Alan T. DeKok [Tue, 17 May 2022 15:08:19 +0000 (11:08 -0400)] 
add dict in preparation for xlat_purify

3 years agoRevert "close on error. Fixes #4518"
Alan T. DeKok [Tue, 17 May 2022 14:39:19 +0000 (10:39 -0400)] 
Revert "close on error. Fixes #4518"

This reverts commit 4040e326d7bc637f55cdb029ea3c3127de3d2a96.

this is done by cf_stack_cleanup(), and there are many other paths
in cf_file_include() which do "return -1" without closing the
file.

3 years agoradsniff: Add '-Z' option allowing to dump the packets (#4504)
Jorge Pereira [Tue, 17 May 2022 14:07:20 +0000 (11:07 -0300)] 
radsniff: Add '-Z' option allowing to dump the packets (#4504)

* log: Fix  fr_pair_list_log() to accept level identation parameter

* log: Fix fr_log_init_file() 'fd' set

* log: Fix fr_log_close() 'dst' check

* radsniff: Add '-Z' option allowing to dump the packets

3 years agoreturn actual offset, not bumped up by 1
Alan T. DeKok [Tue, 17 May 2022 13:19:52 +0000 (09:19 -0400)] 
return actual offset, not bumped up by 1

3 years agoclose on error. Fixes #4518
Alan T. DeKok [Tue, 17 May 2022 13:19:33 +0000 (09:19 -0400)] 
close on error.  Fixes #4518

3 years agoclose on error. Fixes #4518
Alan T. DeKok [Tue, 17 May 2022 13:19:16 +0000 (09:19 -0400)] 
close on error. Fixes #4518

3 years agolog: Fix fr_log_close() 'dst' check
Jorge Pereira [Tue, 26 Apr 2022 23:46:44 +0000 (20:46 -0300)] 
log: Fix fr_log_close() 'dst' check

3 years agolog: Fix fr_log_init_file() 'fd' set
Jorge Pereira [Tue, 26 Apr 2022 23:36:14 +0000 (20:36 -0300)] 
log: Fix fr_log_init_file() 'fd' set

3 years agoEnsure module loading errors are printed out
Nick Porter [Tue, 17 May 2022 07:47:04 +0000 (08:47 +0100)] 
Ensure module loading errors are printed out

3 years agoadd MEM. CID #1504430
Alan T. DeKok [Mon, 16 May 2022 21:13:06 +0000 (17:13 -0400)] 
add MEM.  CID #1504430

3 years agotypo
Alan T. DeKok [Sat, 14 May 2022 17:31:44 +0000 (13:31 -0400)] 
typo

3 years agoshut up clang scan
Alan T. DeKok [Sat, 14 May 2022 12:46:50 +0000 (08:46 -0400)] 
shut up clang scan

3 years agodon't free too much
Alan T. DeKok [Fri, 13 May 2022 21:48:39 +0000 (17:48 -0400)] 
don't free too much

3 years agomove xlats to dlists.
Alan T. DeKok [Fri, 13 May 2022 18:31:08 +0000 (14:31 -0400)] 
move xlats to dlists.

3 years agoclean up in preparation for moving to lists
Alan T. DeKok [Thu, 12 May 2022 18:20:01 +0000 (14:20 -0400)] 
clean up in preparation for moving to lists

3 years agoclean up so that there's less magic.
Alan T. DeKok [Thu, 12 May 2022 18:01:52 +0000 (14:01 -0400)] 
clean up so that there's less magic.

3 years agoremove flags from xlat expr tokenize functions.
Alan T. DeKok [Thu, 12 May 2022 17:34:54 +0000 (13:34 -0400)] 
remove flags from xlat expr tokenize functions.

3 years agosanity check for flags
Alan T. DeKok [Thu, 12 May 2022 02:09:13 +0000 (22:09 -0400)] 
sanity check for flags

the caller should't set run-time flags.

3 years agoremove flags from xlat tokenize functions.
Alan T. DeKok [Thu, 12 May 2022 01:58:40 +0000 (21:58 -0400)] 
remove flags from xlat tokenize functions.

The flags are now only used for xlat registrations.

3 years agostart of API cleanup
Alan T. DeKok [Thu, 12 May 2022 01:38:18 +0000 (21:38 -0400)] 
start of API cleanup

3 years agominor clarifications
Alan T. DeKok [Thu, 12 May 2022 01:34:40 +0000 (21:34 -0400)] 
minor clarifications

3 years agoxlat tokenize functions now only need head
Alan T. DeKok [Thu, 12 May 2022 01:07:19 +0000 (21:07 -0400)] 
xlat tokenize functions now only need head

not ctx, out, and flags

3 years agoset flags correctly.
Alan T. DeKok [Thu, 12 May 2022 00:37:52 +0000 (20:37 -0400)] 
set flags correctly.

it's probably easier to do this correctly if we have a better API

3 years agoxlat_resolve() no longer needs flags
Alan T. DeKok [Thu, 12 May 2022 00:50:53 +0000 (20:50 -0400)] 
xlat_resolve() no longer needs flags

3 years agoensiure that xlat_resolve() can always be passed NULL flags
Alan T. DeKok [Wed, 11 May 2022 14:12:30 +0000 (10:12 -0400)] 
ensiure that xlat_resolve() can always be passed NULL flags

3 years agono need to pass flags here
Alan T. DeKok [Wed, 11 May 2022 13:55:16 +0000 (09:55 -0400)] 
no need to pass flags here

3 years agoremove xlat flags from tmpl structure
Alan T. DeKok [Wed, 11 May 2022 02:22:12 +0000 (22:22 -0400)] 
remove xlat flags from tmpl structure

3 years agostart of removing xlat_flags_t from tmpl
Alan T. DeKok [Wed, 11 May 2022 02:16:54 +0000 (22:16 -0400)] 
start of removing xlat_flags_t from tmpl

sometimes go a bit sideways to make progress.

3 years agoremove flags from xlat some functions.
Alan T. DeKok [Tue, 10 May 2022 21:24:31 +0000 (17:24 -0400)] 
remove flags from xlat some functions.

expose an API to get at the few flags which are needed.
move tmpls to use the API

3 years agoset head flags, too
Alan T. DeKok [Wed, 11 May 2022 02:01:02 +0000 (22:01 -0400)] 
set head flags, too

3 years agoschedule: Fix potential memory-leak (#4510)
Jorge Pereira [Mon, 16 May 2022 18:59:48 +0000 (15:59 -0300)] 
schedule: Fix potential memory-leak (#4510)

3 years agoCheck fr_value_box_from_network(), fr_value_box_cast() returns (CID #1469115, #150393...
James Jones [Mon, 16 May 2022 16:54:37 +0000 (11:54 -0500)] 
Check fr_value_box_from_network(), fr_value_box_cast() returns (CID #1469115, #1503931) (#4514)

3 years agore-add flags removed erroneously
Alan T. DeKok [Mon, 16 May 2022 16:40:25 +0000 (12:40 -0400)] 
re-add flags removed erroneously

3 years agoAdd explicit paths for OSX
Alan T. DeKok [Sun, 15 May 2022 14:09:41 +0000 (10:09 -0400)] 
Add explicit paths for OSX

because apparently some of the C compilers aren't built with the
default paths for everything on the system.

3 years agofix up for OSX
Alan T. DeKok [Sat, 14 May 2022 17:37:32 +0000 (13:37 -0400)] 
fix up for OSX

newer versions of clang can't find things.  So we need to manually
add the paths in.

3 years agoCatch invalid status values in tls_cache_session_ticket_app_data_get (#4509)
James Jones [Fri, 13 May 2022 21:30:56 +0000 (16:30 -0500)] 
Catch invalid status values in tls_cache_session_ticket_app_data_get (#4509)

3 years agoMake load_noinstall_path() free what it doesn't return (CID #1504304) (#4500)
James Jones [Fri, 13 May 2022 21:29:49 +0000 (16:29 -0500)] 
Make load_noinstall_path() free what it doesn't return (CID #1504304) (#4500)

3 years agov4: Changes needed for fr_pair_list_..._by_da macros (#4508)
Nick Porter [Fri, 13 May 2022 21:26:54 +0000 (22:26 +0100)] 
v4: Changes needed for fr_pair_list_..._by_da macros (#4508)

3 years agoAdd checks of fr_lst_insert() calls (CID #1503950, #1504014) (#4512)
James Jones [Fri, 13 May 2022 21:25:13 +0000 (16:25 -0500)] 
Add checks of fr_lst_insert() calls (CID #1503950, #1504014) (#4512)

3 years agoCheck fr_minmax_heap_alloc() return value (CID #1504069) (#4513)
James Jones [Fri, 13 May 2022 21:24:40 +0000 (16:24 -0500)] 
Check fr_minmax_heap_alloc() return value (CID #1504069) (#4513)

3 years agoDefine macros for adding a pair to a list and assinging its value (#4507)
Nick Porter [Thu, 12 May 2022 15:52:39 +0000 (16:52 +0100)] 
Define macros for adding a pair to a list and assinging its value (#4507)

3 years agoJust adjust ext when removing "mod_" (CID #1504300) (#4506)
James Jones [Thu, 12 May 2022 14:03:46 +0000 (09:03 -0500)] 
Just adjust ext when removing "mod_" (CID #1504300) (#4506)

One need only adjust ext by 4 when, in truncate_dll_name(), one
removes "mod_". Then if len exceeds 8 ext still points at the
extension, and coverity can't kvetch about not checking the value
strchr() returns (Using strchr() the second time means
"mumblefrotz.foo.dll" won't behave as expected; does that ever
turn up in practice?)

3 years agoSwitch to memmove() for truncate_dll_name() (CID #1504298) (#4495)
James Jones [Thu, 12 May 2022 02:47:55 +0000 (21:47 -0500)] 
Switch to memmove() for truncate_dll_name() (CID #1504298) (#4495)

with overlapping src/dest, strcpy() gives undefined behavior

3 years agoRemove the needless done_init variables from tests (#4505)
James Jones [Thu, 12 May 2022 02:47:39 +0000 (21:47 -0500)] 
Remove the needless done_init variables from tests (#4505)

This change should settle CIDs 1504383-150439, making clear to
Coverity that rand_ctx is indeed initialized.

3 years agoUse fr_fast_rand() to select operation in burn-in (CID #1503935, #1504015) (#4503)
James Jones [Wed, 11 May 2022 21:06:40 +0000 (16:06 -0500)] 
Use fr_fast_rand() to select operation in burn-in (CID #1503935, #1504015) (#4503)

3 years agoConvert tests to use fr_fast_rand() rather than srand()/rand() (#4502)
James Jones [Wed, 11 May 2022 17:34:27 +0000 (12:34 -0500)] 
Convert tests to use fr_fast_rand() rather than srand()/rand() (#4502)

Coverity considers rand() risky, but data structure tests don't
require cryptographically secure pseudorandom numbers. This should
take care of CIDs 14691201469179150392715039351503941,
15039671503977150399015040151504048, and 1504054.

3 years agoCheck value returned by fr_pair_value_mem_alloc() (CID #1503929) (#4498)
James Jones [Mon, 9 May 2022 21:38:44 +0000 (16:38 -0500)] 
Check value returned by fr_pair_value_mem_alloc() (CID #1503929) (#4498)

3 years agoCorrect MEM() check of fr_pair_value_mem_alloc() return value (#4497)
James Jones [Mon, 9 May 2022 21:38:14 +0000 (16:38 -0500)] 
Correct MEM() check of fr_pair_value_mem_alloc() return value (#4497)

3 years agoMake python configure script check that it can actually link to the python libraries
Arran Cudbard-Bell [Thu, 5 May 2022 22:27:54 +0000 (00:27 +0200)] 
Make python configure script check that it can actually link to the python libraries

3 years agoFix atomic queue alignment on 32bit systems
Arran Cudbard-Bell [Thu, 5 May 2022 22:27:21 +0000 (00:27 +0200)] 
Fix atomic queue alignment on 32bit systems

3 years agostderr and stdout are macros and conflict with these fields
Arran Cudbard-Bell [Thu, 5 May 2022 22:27:05 +0000 (00:27 +0200)] 
stderr and stdout are macros and conflict with these fields

3 years agoAllow building without semaphores
Arran Cudbard-Bell [Thu, 5 May 2022 14:14:50 +0000 (16:14 +0200)] 
Allow building without semaphores

3 years agoBuild build system libraries with HOST_CC
Arran Cudbard-Bell [Thu, 5 May 2022 12:55:03 +0000 (14:55 +0200)] 
Build build system libraries with HOST_CC

3 years agoPrint out canonical target names and add "darwin"
Arran Cudbard-Bell [Thu, 5 May 2022 12:17:00 +0000 (14:17 +0200)] 
Print out canonical target names and add "darwin"

3 years agoAllow toolset to be set explicitly
Arran Cudbard-Bell [Thu, 5 May 2022 10:39:37 +0000 (12:39 +0200)] 
Allow toolset to be set explicitly

3 years agoremove unused variable
Alan T. DeKok [Sat, 7 May 2022 13:42:35 +0000 (09:42 -0400)] 
remove unused variable

3 years agominor cleanups
Alan T. DeKok [Sat, 7 May 2022 13:40:52 +0000 (09:40 -0400)] 
minor cleanups

3 years agoadd "ignore this list" entries.
Alan T. DeKok [Sat, 7 May 2022 12:19:49 +0000 (08:19 -0400)] 
add "ignore this list" entries.

If we're inserting a new structural member, then we don't need
to undo edits to any children in it's lists.  Those edits will be
undone automatically when the parent pair is undone.

We keep a separate list of "lists to ignore", and check that
before doing anything.  If the list can be ignored, then we
discard delete / clear / etc.

In inserts, if the VP is structural, then remember its child list,
so that we can ignore edits to it, too.

3 years agorename, as there are too many "list" things here.
Alan T. DeKok [Sat, 7 May 2022 12:08:39 +0000 (08:08 -0400)] 
rename, as there are too many "list" things here.

3 years agoRemove initial FR_TYPE_NULL check from fr_value_box_from_substr() (CID #1504016)...
James Jones [Sat, 7 May 2022 01:26:16 +0000 (20:26 -0500)] 
Remove initial FR_TYPE_NULL check from fr_value_box_from_substr() (CID #1504016) (#4496)

Better to let it be handled in the switch statement.

3 years agoFree result of file_name_stripped() when needed (CID #1504303) (#4494)
James Jones [Fri, 6 May 2022 17:36:26 +0000 (12:36 -0500)] 
Free result of file_name_stripped() when needed (CID #1504303) (#4494)