]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
2 years agomove radsniff to new API
Alan T. DeKok [Sun, 29 Oct 2023 14:26:37 +0000 (10:26 -0400)] 
move radsniff to new API

2 years agomove tests to using new function
Alan T. DeKok [Sun, 29 Oct 2023 14:16:19 +0000 (10:16 -0400)] 
move tests to using new function

2 years agoremove more fr_pair_list_afrom_str()
Alan T. DeKok [Sun, 29 Oct 2023 13:46:04 +0000 (09:46 -0400)] 
remove more fr_pair_list_afrom_str()

2 years agomove edit functionality to new pair_list_afrom_substr()
Alan T. DeKok [Sun, 29 Oct 2023 13:24:34 +0000 (09:24 -0400)] 
move edit functionality to new pair_list_afrom_substr()

2 years agoradius_exec_program_legacy() doesn't ever get passed output_pairs
Alan T. DeKok [Sun, 29 Oct 2023 13:01:14 +0000 (09:01 -0400)] 
radius_exec_program_legacy() doesn't ever get passed output_pairs

so remove unused code and arguments.

2 years agomake unit_test_attribute use fr_pair_list_afrom_substr()
Alan T. DeKok [Sat, 28 Oct 2023 19:16:17 +0000 (15:16 -0400)] 
make unit_test_attribute use fr_pair_list_afrom_substr()

and update the tests now that they produce the correct result

2 years agolast tweaks to make new pair parser match the old functionality
Alan T. DeKok [Sat, 28 Oct 2023 12:07:52 +0000 (08:07 -0400)] 
last tweaks to make new pair parser match the old functionality

2 years agoallow full paths for multiple struct members
Alan T. DeKok [Fri, 27 Oct 2023 22:29:46 +0000 (18:29 -0400)] 
allow full paths for multiple struct members

which we automagically turn into multiple struct attributes

2 years agoadd "find last by da" API
Alan T. DeKok [Fri, 27 Oct 2023 22:28:47 +0000 (18:28 -0400)] 
add "find last by da" API

2 years agoautomatically append on common cases
Alan T. DeKok [Fri, 27 Oct 2023 14:55:37 +0000 (10:55 -0400)] 
automatically append on common cases

foo.bar = a, .baz = b, foo.bar = c, .baz = d

will now create 2 "foo" attributes

2 years agowhitespace
Alan T. DeKok [Fri, 27 Oct 2023 14:55:10 +0000 (10:55 -0400)] 
whitespace

2 years agocatch more corner cases
Alan T. DeKok [Fri, 27 Oct 2023 01:15:29 +0000 (21:15 -0400)] 
catch more corner cases

2 years agoremove debugging
Alan T. DeKok [Fri, 27 Oct 2023 01:10:27 +0000 (21:10 -0400)] 
remove debugging

2 years agocleanups and checks for static analysis
Alan T. DeKok [Fri, 27 Oct 2023 00:42:10 +0000 (20:42 -0400)] 
cleanups and checks for static analysis

2 years agoNew fr_pair_list_afrom_substr()
Alan T. DeKok [Thu, 26 Oct 2023 20:30:53 +0000 (16:30 -0400)] 
New fr_pair_list_afrom_substr()

not used yet, but with local changes it passes the unit tests.

The function now creates intermediate pairs, including groups!

2 years agorespect terminals during parsing of values
Alan T. DeKok [Thu, 26 Oct 2023 23:22:40 +0000 (19:22 -0400)] 
respect terminals during parsing of values

brute-force copying _all_ of the input sbuff works only when
there are no terminals.

2 years agoctx is used
Alan T. DeKok [Thu, 26 Oct 2023 20:07:48 +0000 (16:07 -0400)] 
ctx is used

2 years agodon't use := for tests, it's not needed
Alan T. DeKok [Thu, 26 Oct 2023 15:31:51 +0000 (11:31 -0400)] 
don't use := for tests, it's not needed

2 years agocheck return code of fr_dict_attr_by_oid_substr()
Alan T. DeKok [Thu, 26 Oct 2023 12:08:32 +0000 (08:08 -0400)] 
check return code of fr_dict_attr_by_oid_substr()

which can return an error even if the "err" ptr is NULL

2 years agoget rid of Tmp-* in configuration and examples
Alan T. DeKok [Wed, 25 Oct 2023 20:59:03 +0000 (16:59 -0400)] 
get rid of Tmp-* in configuration and examples

2 years agoDon't free tracking for cached packets
Nick Porter [Thu, 26 Oct 2023 19:04:00 +0000 (20:04 +0100)] 
Don't free tracking for cached packets

2 years agoallow local variables in redundant and load-balance
Alan T. DeKok [Wed, 25 Oct 2023 20:52:59 +0000 (16:52 -0400)] 
allow local variables in redundant and load-balance

2 years agoExplicitly free list of VPs to maintain list integrity
Nick Porter [Wed, 25 Oct 2023 09:26:48 +0000 (10:26 +0100)] 
Explicitly free list of VPs to maintain list integrity

2 years agoCopy packet->vector to correctly identify retransmits
Nick Porter [Wed, 25 Oct 2023 09:24:17 +0000 (10:24 +0100)] 
Copy packet->vector to correctly identify retransmits

2 years agoUse fr_pair_list_append to move temporary lists
Nick Porter [Wed, 25 Oct 2023 09:23:08 +0000 (10:23 +0100)] 
Use fr_pair_list_append to move temporary lists

2 years agoAdd radsniff to vscode debug launcher
Nick Porter [Wed, 25 Oct 2023 10:02:09 +0000 (11:02 +0100)] 
Add radsniff to vscode debug launcher

2 years agorework macros to be clearer
Alan T. DeKok [Tue, 24 Oct 2023 19:08:57 +0000 (15:08 -0400)] 
rework macros to be clearer

much less repetition == fewer mistakes, and hopefully less
confusion from Coverity

2 years agomore notes on what we don't want to convert
Alan T. DeKok [Mon, 23 Oct 2023 20:48:28 +0000 (16:48 -0400)] 
more notes on what we don't want to convert

2 years agoskip migration "-->" strings
Alan T. DeKok [Mon, 23 Oct 2023 15:30:32 +0000 (11:30 -0400)] 
skip migration "-->" strings

2 years agoremove old tests which we choose to not support
Alan T. DeKok [Mon, 23 Oct 2023 14:19:21 +0000 (10:19 -0400)] 
remove old tests which we choose to not support

2 years agodisable these as we don't (yet) care
Alan T. DeKok [Mon, 23 Oct 2023 13:57:30 +0000 (09:57 -0400)] 
disable these as we don't (yet) care

2 years agowe don't support groups in update -> edit conversions
Alan T. DeKok [Mon, 23 Oct 2023 13:29:38 +0000 (09:29 -0400)] 
we don't support groups in update -> edit conversions

This could probably be added, but perhaps not today.

2 years agonow supported in the edit code
Alan T. DeKok [Mon, 23 Oct 2023 13:04:25 +0000 (09:04 -0400)] 
now supported in the edit code

2 years agothis one is now supported in the edit code
Alan T. DeKok [Mon, 23 Oct 2023 13:03:13 +0000 (09:03 -0400)] 
this one is now supported in the edit code

2 years agomove more update tests to edit
Alan T. DeKok [Mon, 23 Oct 2023 13:02:16 +0000 (09:02 -0400)] 
move more update tests to edit

2 years agofix comments
Alan T. DeKok [Mon, 23 Oct 2023 12:39:31 +0000 (08:39 -0400)] 
fix comments

2 years agomove test to new edit framework
Alan T. DeKok [Sun, 22 Oct 2023 19:48:00 +0000 (15:48 -0400)] 
move test to new edit framework

and fix issue where

&foo := &non-existent

was different from

&foo := {}

or

%foo := %function_that_returns_nothing()

2 years agotypo in debug
Alan T. DeKok [Sun, 22 Oct 2023 19:24:26 +0000 (15:24 -0400)] 
typo in debug

2 years agoallow removal of attributes by index
Alan T. DeKok [Sun, 22 Oct 2023 15:46:19 +0000 (11:46 -0400)] 
allow removal of attributes by index

this is the start of porting update-remove-index, which currently
doesn't work for a host of reasons.

We should probably remove the syntax of &list -= &attr, as it is
now duplicative, and we don't like that.

2 years agomore debugging, and use better macro
Alan T. DeKok [Sun, 22 Oct 2023 15:42:52 +0000 (11:42 -0400)] 
more debugging, and use better macro

2 years agoprint out more of the parsing error
Alan T. DeKok [Sun, 22 Oct 2023 15:41:31 +0000 (11:41 -0400)] 
print out more of the parsing error

2 years agoremove tests which are no longer necessary
Alan T. DeKok [Sun, 22 Oct 2023 14:31:23 +0000 (10:31 -0400)] 
remove tests which are no longer necessary

we don't support cross-protocol attributes

2 years agofix documentation
Alan T. DeKok [Sat, 21 Oct 2023 12:08:46 +0000 (08:08 -0400)] 
fix documentation

2 years agoit helps to access the variable before its freed
Alan T. DeKok [Sat, 21 Oct 2023 12:08:32 +0000 (08:08 -0400)] 
it helps to access the variable before its freed

2 years agohoist "fall-through" to entry
Alan T. DeKok [Fri, 20 Oct 2023 13:07:41 +0000 (09:07 -0400)] 
hoist "fall-through" to entry

so that we don't need to create the VP every time.  Instead,
we parse it once when the module starts, and cache the resulting
"bool"

2 years agojson: Add support for encoding nested attributes
Arran Cudbard-Bell [Fri, 20 Oct 2023 22:47:04 +0000 (16:47 -0600)] 
json: Add support for encoding nested attributes

2 years agoAdd unlang_edit_push() for external use of the new edit functionality
Alan T. DeKok [Fri, 20 Oct 2023 12:50:07 +0000 (08:50 -0400)] 
Add unlang_edit_push() for external use of the new edit functionality

2 years agothis returns int, not unlang_action_t
Alan T. DeKok [Fri, 20 Oct 2023 12:06:40 +0000 (08:06 -0400)] 
this returns int, not unlang_action_t

2 years agoparse-time errors are better than run-time asserts
Alan T. DeKok [Thu, 19 Oct 2023 21:30:41 +0000 (17:30 -0400)] 
parse-time errors are better than run-time asserts

we don't support structural types on the RHS of maps, so don't
even try to parse them.  Just return an error

2 years agoRevert "try to parse things inside of a {...} block"
Alan T. DeKok [Thu, 19 Oct 2023 21:29:10 +0000 (17:29 -0400)] 
Revert "try to parse things inside of a {...} block"

This reverts commit 1a9970927eef06a6a05e5087bf95047b31c68fa8.

nope, the evaluator doesn't like structural RHS

2 years agotry to parse things inside of a {...} block
Alan T. DeKok [Thu, 19 Oct 2023 21:12:23 +0000 (17:12 -0400)] 
try to parse things inside of a {...} block

if this doesn't work, it should be reverted

2 years agoclarify error message
Alan T. DeKok [Thu, 19 Oct 2023 20:48:08 +0000 (16:48 -0400)] 
clarify error message

2 years agocreate nested VSAs for tagged attributes
Alan T. DeKok [Thu, 19 Oct 2023 19:25:33 +0000 (15:25 -0400)] 
create nested VSAs for tagged attributes

and add tests

2 years agosample code to pass expressions as function arguments
Alan T. DeKok [Wed, 18 Oct 2023 20:43:24 +0000 (16:43 -0400)] 
sample code to pass expressions as function arguments

not yet enabled until we work out the implications and double-check
the tests

2 years agoit helps to document this, too
Alan T. DeKok [Wed, 18 Oct 2023 20:36:05 +0000 (16:36 -0400)] 
it helps to document this, too

We would really like to be able to do

%file.escape("foo/bar/" + %{User-Name})

but if that's an expression, then we get the entire string tainted,
and thge "/" in the first part of the string are escaped.

or maybe

%exec("/bin/rm", "foo/bar" + %file.escape(%{User-Name}))

but we can't (yet) pass expressions as function arguments.

2 years agoMark required arguments as nonnull
Nick Porter [Thu, 19 Oct 2023 17:11:56 +0000 (18:11 +0100)] 
Mark required arguments as nonnull

2 years agoEnsure all URI escaping is only done on strings
Nick Porter [Thu, 19 Oct 2023 16:45:12 +0000 (17:45 +0100)] 
Ensure all URI escaping is only done on strings

Xlats already present strings, but there can be cases where the list is
not all strings, such as LDAP map.

2 years agoCast boxes in a URI to string before escaping
Nick Porter [Thu, 19 Oct 2023 16:24:15 +0000 (17:24 +0100)] 
Cast boxes in a URI to string before escaping

2 years agoUse non_socket_listener to detect non-socket listeners
Nick Porter [Thu, 19 Oct 2023 13:32:26 +0000 (14:32 +0100)] 
Use non_socket_listener to detect non-socket listeners

2 years agoCorrect handling of trunk enqueue responses
Nick Porter [Wed, 18 Oct 2023 20:06:56 +0000 (21:06 +0100)] 
Correct handling of trunk enqueue responses

2 years agodon't return grouped data
Alan T. DeKok [Wed, 18 Oct 2023 20:29:46 +0000 (16:29 -0400)] 
don't return grouped data

the arguments to the function are grouped.  But the actual content
of the arguments is the group contents.  It's not the group.

So we can't copy the input groups to the output, that results in
too many groups.

2 years agothe taint / untaint functions are pure
Alan T. DeKok [Wed, 18 Oct 2023 20:28:58 +0000 (16:28 -0400)] 
the taint / untaint functions are pure

if they operate on pure data, they return tainted but pure data

2 years agoadd %file.escape()
Alan T. DeKok [Wed, 18 Oct 2023 20:28:06 +0000 (16:28 -0400)] 
add %file.escape()

2 years agorlm_detail listener can't take the short cut when adding to a network
Nick Porter [Wed, 18 Oct 2023 14:46:26 +0000 (15:46 +0100)] 
rlm_detail listener can't take the short cut when adding to a network

2 years agoIf poll_interval is set don't open a dummy file
Nick Porter [Tue, 17 Oct 2023 10:20:47 +0000 (11:20 +0100)] 
If poll_interval is set don't open a dummy file

Avoids a libkqueue issue which caused a crash on exit.

2 years agoHide inactive mod_write
Nick Porter [Tue, 17 Oct 2023 10:15:10 +0000 (11:15 +0100)] 
Hide inactive mod_write

2 years agoAdd option to allow for non-socket listeners
Nick Porter [Tue, 17 Oct 2023 10:11:59 +0000 (11:11 +0100)] 
Add option to allow for non-socket listeners

2 years agoMore consistent naming with other xlats
Nick Porter [Wed, 18 Oct 2023 07:49:36 +0000 (08:49 +0100)] 
More consistent naming with other xlats

2 years agoTweaks to the new radius_request_verify function
Arran Cudbard-Bell [Wed, 18 Oct 2023 01:37:15 +0000 (19:37 -0600)] 
Tweaks to the new radius_request_verify function

Rename to radius_secret_verify, as that's what it's doing.  The request has already been verified, we're trying different secrets against the request.

2 years agoUse the same codepath to trigger an exit as the signal handlers
Arran Cudbard-Bell [Wed, 18 Oct 2023 01:17:22 +0000 (19:17 -0600)] 
Use the same codepath to trigger an exit as the signal handlers

This allows other I/O callbacks to complete, so when the server exits, pending I/O events for proto_detail_file should've fired.  This mnay help with the crash on exit

2 years agoInclude missing header
Arran Cudbard-Bell [Tue, 17 Oct 2023 23:37:56 +0000 (17:37 -0600)] 
Include missing header

2 years agoModules should NEVER signal an event loop to exit
Arran Cudbard-Bell [Tue, 17 Oct 2023 23:36:39 +0000 (17:36 -0600)] 
Modules should NEVER signal an event loop to exit

2 years agoAdd %radius_request_verify() xlat
Nick Porter [Mon, 16 Oct 2023 08:39:59 +0000 (09:39 +0100)] 
Add %radius_request_verify() xlat

For verifying dynamic clients against a know shared secret

2 years agoallow relative attributes after DEFINEs
Alan T. DeKok [Tue, 17 Oct 2023 12:15:18 +0000 (08:15 -0400)] 
allow relative attributes after DEFINEs

2 years agomake the tests depend on the RADIUS dictionary
Alan T. DeKok [Tue, 17 Oct 2023 12:13:32 +0000 (08:13 -0400)] 
make the tests depend on the RADIUS dictionary

2 years agoBetter error message
Nick Porter [Tue, 17 Oct 2023 10:31:44 +0000 (11:31 +0100)] 
Better error message

2 years agouse sbuff API to quiet Coverity. CID #1547825
Alan T. DeKok [Mon, 16 Oct 2023 22:30:31 +0000 (18:30 -0400)] 
use sbuff API to quiet Coverity.  CID #1547825

Coverity is too dumb to notice that the buffer is initialized.
However, if we use the sbuff API, then it thinks everything is
fine.

2 years agomove to %file.exists()
Alan T. DeKok [Mon, 16 Oct 2023 22:14:24 +0000 (18:14 -0400)] 
move to %file.exists()

fix typo in deletion of old log file

just use "wc -l FILE", there's no need to "cat" everything

2 years agoremove "hoist vpt->xlat into xlat" in tokenize expression
Alan T. DeKok [Mon, 16 Oct 2023 22:10:58 +0000 (18:10 -0400)] 
remove "hoist vpt->xlat into xlat" in tokenize expression

the hoisting would put the expansion into an XLAT_GROUP, which
meant that any output value-boxes were wrapped in a value-box
group.  Which was distinctly unexpected.

2 years agoadded count argument to %file.tail(). and use it in tests
Alan T. DeKok [Mon, 16 Oct 2023 16:49:49 +0000 (12:49 -0400)] 
added count argument to %file.tail(). and use it in tests

2 years agouse %file.tail()
Alan T. DeKok [Mon, 16 Oct 2023 15:17:06 +0000 (11:17 -0400)] 
use %file.tail()

we haven't implemented "-n2" yet

2 years agoadd %file.tail(), along with tests and bug fixes
Alan T. DeKok [Mon, 16 Oct 2023 15:12:18 +0000 (11:12 -0400)] 
add %file.tail(), along with tests and bug fixes

2 years agomove to using internal file functions
Alan T. DeKok [Mon, 16 Oct 2023 13:13:24 +0000 (09:13 -0400)] 
move to using internal file functions

2 years agomove more functions to their own files
Alan T. DeKok [Mon, 16 Oct 2023 13:04:08 +0000 (09:04 -0400)] 
move more functions to their own files

2 years agomove protocol things to their own file
Alan T. DeKok [Mon, 16 Oct 2023 12:38:39 +0000 (08:38 -0400)] 
move protocol things to their own file

2 years agoadd and document log.warn() and log.err()
Alan T. DeKok [Mon, 16 Oct 2023 12:34:10 +0000 (08:34 -0400)] 
add and document log.warn() and log.err()

2 years agosplit up builtin functions, as there are many of them
Alan T. DeKok [Mon, 16 Oct 2023 12:28:09 +0000 (08:28 -0400)] 
split up builtin functions, as there are many of them

2 years agoadd file handling functions
Alan T. DeKok [Mon, 16 Oct 2023 12:20:49 +0000 (08:20 -0400)] 
add file handling functions

2 years agoadd a number of file-based functions
Alan T. DeKok [Sun, 15 Oct 2023 22:16:53 +0000 (18:16 -0400)] 
add a number of file-based functions

2 years agoRevert "we don't need to do "cat X | foo" when we can do "foo X""
Alan T. DeKok [Sun, 15 Oct 2023 19:07:29 +0000 (15:07 -0400)] 
Revert "we don't need to do "cat X | foo" when we can do "foo X""

This reverts commit 7771539fb4397a7831b07fe0330536e6a55a7356.

revert until we have time to track it down a bit more

2 years agowe don't need to do "cat X | foo" when we can do "foo X"
Alan T. DeKok [Sun, 15 Oct 2023 18:48:43 +0000 (14:48 -0400)] 
we don't need to do "cat X | foo" when we can do "foo X"

2 years agoremove accidental character
Alan T. DeKok [Sun, 15 Oct 2023 18:08:22 +0000 (14:08 -0400)] 
remove accidental character

2 years agovoid malloc / free
Alan T. DeKok [Sun, 15 Oct 2023 18:03:02 +0000 (14:03 -0400)] 
void malloc / free

just use local buffer, which is big enough for IPv6 prefixes,
floats, etc.

2 years agouse correct API
Alan T. DeKok [Sun, 15 Oct 2023 17:44:56 +0000 (13:44 -0400)] 
use correct API

fr_value_box_aprint() does not print quotation characters around
strings, even if escaping rules are passed to it.

Instead, we need to call fr_value_box_aprint_quoted(), which
will do the right thing.

2 years agopassing a NULL escape rules doesn't mean "print integer value"
Alan T. DeKok [Sun, 15 Oct 2023 13:49:46 +0000 (09:49 -0400)] 
passing a NULL escape rules doesn't mean "print integer value"

we instead have to copy the box, and nuke the enum name from
the box.

While we're at it, refuse to print structural types, too

2 years agostart of cleaning up escaping rules
Alan T. DeKok [Sun, 15 Oct 2023 13:35:37 +0000 (09:35 -0400)] 
start of cleaning up escaping rules

note that fr_value_box_print() does NOT respect tainting

fix a few callers to just re-implement print_quoted()

2 years agoremove %integer() from the tests
Alan T. DeKok [Sun, 15 Oct 2023 12:54:34 +0000 (08:54 -0400)] 
remove %integer() from the tests

2 years agono need to pass T_BARE_WORD to print_quoted. Just call print
Alan T. DeKok [Sun, 15 Oct 2023 13:25:59 +0000 (09:25 -0400)] 
no need to pass T_BARE_WORD to print_quoted.  Just call print

2 years agoremove unnecessary header
Alan T. DeKok [Sun, 15 Oct 2023 12:23:45 +0000 (08:23 -0400)] 
remove unnecessary header

2 years agovalidate oddities in casting
Alan T. DeKok [Thu, 12 Oct 2023 20:16:29 +0000 (16:16 -0400)] 
validate oddities in casting

(string) &foo[*] returnis a list of value-boxes, each cast
to a string

(string) (&foo[*]) return one string, which is all of the
value-boxes concatenated together

and update documentation