]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
2 years agoreference count init/free instead of using boolean
Alan T. DeKok [Mon, 5 Feb 2024 02:22:03 +0000 (21:22 -0500)] 
reference count init/free instead of using boolean

2 years agowe didn't call xlat init, we shouldn't call xlat free.
Alan T. DeKok [Mon, 5 Feb 2024 02:14:24 +0000 (21:14 -0500)] 
we didn't call xlat init, we shouldn't call xlat free.

2 years agonormalize names
Alan T. DeKok [Mon, 5 Feb 2024 02:00:37 +0000 (21:00 -0500)] 
normalize names

foo_global_init() and foo_global_free()

2 years agofor helping with fuzzer issues
Alan T. DeKok [Sun, 4 Feb 2024 21:39:49 +0000 (16:39 -0500)] 
for helping with fuzzer issues

2 years agoI do have loathing for compilers which don't produce error messages
Alan T. DeKok [Sun, 4 Feb 2024 17:28:28 +0000 (12:28 -0500)] 
I do have loathing for compilers which don't produce error messages

2 years agocomment out assertion to see if fuzzer will produce better error
Alan T. DeKok [Sun, 4 Feb 2024 17:17:35 +0000 (12:17 -0500)] 
comment out assertion to see if fuzzer will produce better error

2 years agomake sure to free tag ctx, too
Alan T. DeKok [Sun, 4 Feb 2024 16:12:44 +0000 (11:12 -0500)] 
make sure to free tag ctx, too

2 years agomake sure that we call library init / free
Alan T. DeKok [Sun, 4 Feb 2024 16:09:33 +0000 (11:09 -0500)] 
make sure that we call library init / free

2 years agofree tag ctx, too
Alan T. DeKok [Sun, 4 Feb 2024 15:46:41 +0000 (10:46 -0500)] 
free tag ctx, too

2 years agono longer any need to call init.
Alan T. DeKok [Sun, 4 Feb 2024 15:27:51 +0000 (10:27 -0500)] 
no longer any need to call init.

Missed in commit f7778c55206db

2 years agoAdd foreign tests to DHCPv6
Alan T. DeKok [Sun, 4 Feb 2024 15:24:09 +0000 (10:24 -0500)] 
Add foreign tests to DHCPv6

2 years agoclean up autofree
Alan T. DeKok [Sun, 4 Feb 2024 15:15:35 +0000 (10:15 -0500)] 
clean up autofree

The only remaining errors are:

test.unit.dns, which fails to clean up the DNS dictionaries.
All of the other protocols are fine, so there's some extra magic
here.

test.keywords: fr_dict_free() is asked to remove a dependency
which doesn't exist.  That _should_ be an assertion, but for now
it's a recoverable error which lets other people get work done.

2 years agojust call common function
Alan T. DeKok [Sun, 4 Feb 2024 13:11:15 +0000 (08:11 -0500)] 
just call common function

2 years agoadd dependency if we load the dictionary
Alan T. DeKok [Sun, 4 Feb 2024 13:10:28 +0000 (08:10 -0500)] 
add dependency if we load the dictionary

and thus we can call dict->proto->free()

2 years agoadd debug printing for dependencies
Alan T. DeKok [Sun, 4 Feb 2024 13:09:29 +0000 (08:09 -0500)] 
add debug printing for dependencies

2 years agodon't free dictionaries until we track down reference issues
Alan T. DeKok [Sun, 4 Feb 2024 03:17:29 +0000 (22:17 -0500)] 
don't free dictionaries until we track down reference issues

There are issues with calling proto->free() in the destructor
for the dictionaries

there are issues with foreign references.

2 years agoset loaded flag before calling proto->init()
Alan T. DeKok [Sun, 4 Feb 2024 03:16:29 +0000 (22:16 -0500)] 
set loaded flag before calling proto->init()

to prevent recursion

2 years agoadd assertion
Alan T. DeKok [Sun, 4 Feb 2024 03:16:16 +0000 (22:16 -0500)] 
add assertion

2 years agoremove unused code
Alan T. DeKok [Sun, 4 Feb 2024 02:58:56 +0000 (21:58 -0500)] 
remove unused code

2 years agoMove to init/free for library, and not for each test case
Alan T. DeKok [Sat, 3 Feb 2024 20:47:21 +0000 (15:47 -0500)] 
Move to init/free for library, and not for each test case

now that we (mostly) have library-based init/free, we do not need
to do that for every test case.  Either the library is properly
initialized and it works, or the library isn't initialized, and
the tests fail.

Some protocols still need to be converted to use fr_dict_protocol_t

ethernet, tacacs, tftp, vmps

2 years agodon't add the dependency twice
Alan T. DeKok [Sat, 3 Feb 2024 16:05:20 +0000 (11:05 -0500)] 
don't add the dependency twice

2 years agosome protocols don't have init/free
Alan T. DeKok [Sat, 3 Feb 2024 15:27:13 +0000 (10:27 -0500)] 
some protocols don't have init/free

2 years agodict may be NULL
Alan T. DeKok [Sat, 3 Feb 2024 14:51:37 +0000 (09:51 -0500)] 
dict may be NULL

2 years agoallow for loops in foreign dictionaries
Alan T. DeKok [Sat, 3 Feb 2024 14:05:14 +0000 (09:05 -0500)] 
allow for loops in foreign dictionaries

by adding two flags, "loading", which is set in begin-proto,
and cleared when the dictionary is done.  And "loaded" which is
set by fr_protocol_afrom_file(), to indicate that it has loaded
the dictionary file. and initialized the protocol library.

The dict routines now call proto->init() and proto->free(), so that
when a protocol library is loaded, everything it needs is also
loaded and initialized.

2 years agoremove internal dictionary last.
Alan T. DeKok [Sat, 3 Feb 2024 14:04:08 +0000 (09:04 -0500)] 
remove internal dictionary last.

Many protocol dictionaries reference it.  If we try to remove it
first, it will still be referenced by them.  Instead, we want to
remove the protocol dictionaries first, and only then remove the
internal dictionary.

2 years agoremove extraneous asserts
Alan T. DeKok [Thu, 1 Feb 2024 19:25:57 +0000 (14:25 -0500)] 
remove extraneous asserts

2 years agoturn "load protocol ref" into stand-along function
Alan T. DeKok [Thu, 1 Feb 2024 19:12:52 +0000 (14:12 -0500)] 
turn "load protocol ref" into stand-along function

which only loads foreign protocols, and not local refs

2 years agoScheduled fuzzing: Update src/tests/fuzzer-corpus/radius.tar
github-actions[bot] [Sat, 3 Feb 2024 09:34:40 +0000 (09:34 +0000)] 
Scheduled fuzzing: Update src/tests/fuzzer-corpus/radius.tar

2 years agoScheduled fuzzing: Update src/tests/fuzzer-corpus/bfd.tar
github-actions[bot] [Sat, 3 Feb 2024 09:34:37 +0000 (09:34 +0000)] 
Scheduled fuzzing: Update src/tests/fuzzer-corpus/bfd.tar

2 years agoScheduled fuzzing: Update src/tests/fuzzer-corpus/util.tar
github-actions[bot] [Sat, 3 Feb 2024 09:34:35 +0000 (09:34 +0000)] 
Scheduled fuzzing: Update src/tests/fuzzer-corpus/util.tar

2 years agoScheduled fuzzing: Update src/tests/fuzzer-corpus/tftp.tar
github-actions[bot] [Sat, 3 Feb 2024 09:34:31 +0000 (09:34 +0000)] 
Scheduled fuzzing: Update src/tests/fuzzer-corpus/tftp.tar

2 years agoScheduled fuzzing: Update src/tests/fuzzer-corpus/vmps.tar
github-actions[bot] [Sat, 3 Feb 2024 09:34:29 +0000 (09:34 +0000)] 
Scheduled fuzzing: Update src/tests/fuzzer-corpus/vmps.tar

2 years agoScheduled fuzzing: Update src/tests/fuzzer-corpus/tacacs.tar
github-actions[bot] [Sat, 3 Feb 2024 09:34:25 +0000 (09:34 +0000)] 
Scheduled fuzzing: Update src/tests/fuzzer-corpus/tacacs.tar

2 years agoScheduled fuzzing: Update src/tests/fuzzer-corpus/dns.tar
github-actions[bot] [Sat, 3 Feb 2024 09:34:23 +0000 (09:34 +0000)] 
Scheduled fuzzing: Update src/tests/fuzzer-corpus/dns.tar

2 years agoScheduled fuzzing: Update src/tests/fuzzer-corpus/dhcpv6.tar
github-actions[bot] [Sat, 3 Feb 2024 09:34:19 +0000 (09:34 +0000)] 
Scheduled fuzzing: Update src/tests/fuzzer-corpus/dhcpv6.tar

2 years agoScheduled fuzzing: Update src/tests/fuzzer-corpus/dhcpv4.tar
github-actions[bot] [Sat, 3 Feb 2024 09:34:16 +0000 (09:34 +0000)] 
Scheduled fuzzing: Update src/tests/fuzzer-corpus/dhcpv4.tar

2 years agoReport what database file is being created
Nick Porter [Fri, 2 Feb 2024 14:50:54 +0000 (14:50 +0000)] 
Report what database file is being created

2 years agoInclude sqlite3 in FreeBSD CI build
Nick Porter [Fri, 2 Feb 2024 15:49:26 +0000 (15:49 +0000)] 
Include sqlite3 in FreeBSD CI build

2 years agoMore GitHub action updates
Nick Porter [Fri, 2 Feb 2024 15:48:13 +0000 (15:48 +0000)] 
More GitHub action updates

Just for allocated_address_attr to start with

2 years agoAttempt to placate Coverity in rs_packet_process() (CID #1587345)
James Jones [Mon, 29 Jan 2024 20:28:05 +0000 (14:28 -0600)] 
Attempt to placate Coverity in rs_packet_process() (CID #1587345)

Coverity infers from the check of original->expect in the call to
fr_radius_decode_simple() that original->expect can be NULL, and
hence the later call to rs_stats_update_latency() call that
dereferences original->expect may fail. It may be that if original
and original->linked are non-NULL, one can infer original->expect
is non-NULL. Coverity can't; hence the added check on that call to
rs_stats_update_latency()..

2 years agoDeal with remaining missing locks (CIDs listed below)
James Jones [Tue, 21 Nov 2023 21:53:47 +0000 (15:53 -0600)] 
Deal with remaining missing locks (CIDs listed below)

CIDs: 1551700155170115517041551705

2 years agoSQL driver config can't refer to ...pool
Nick Porter [Wed, 31 Jan 2024 17:54:44 +0000 (17:54 +0000)] 
SQL driver config can't refer to ...pool

since it is included before the pool section.

2 years agoMinor Oracle fixes
Nick Porter [Wed, 31 Jan 2024 17:51:19 +0000 (17:51 +0000)] 
Minor Oracle fixes

2 years agoAlign Oracle spool.max parsing with pool.max
Nick Porter [Wed, 31 Jan 2024 17:50:41 +0000 (17:50 +0000)] 
Align Oracle spool.max parsing with pool.max

If not set, matches the number of worker threads

2 years agoFix oracle query issue
Nick Porter [Wed, 31 Jan 2024 17:49:31 +0000 (17:49 +0000)] 
Fix oracle query issue

2 years agominor copy editing
Alan T. DeKok [Thu, 1 Feb 2024 14:03:10 +0000 (09:03 -0500)] 
minor copy editing

commas, etc.

2 years agoupdate and clarify
Alan T. DeKok [Thu, 1 Feb 2024 13:48:39 +0000 (08:48 -0500)] 
update and clarify

2 years agoNo need for begin / commit for independent UPDATE queries
Nick Porter [Thu, 1 Feb 2024 13:58:43 +0000 (13:58 +0000)] 
No need for begin / commit for independent UPDATE queries

Whilst Oracle had these set to "COMMIT", queries are actually run with
OCI_COMMIT_ON_SUCCESS so no need for a separate COMMIT

2 years agorefresh antora raddb pages
Matthew Newton [Wed, 31 Jan 2024 17:44:26 +0000 (17:44 +0000)] 
refresh antora raddb pages

2 years agodoc: add letsencrypt howto
Matthew Newton [Wed, 31 Jan 2024 17:43:30 +0000 (17:43 +0000)] 
doc: add letsencrypt howto

2 years agodoc: unlang nav case consistency
Matthew Newton [Tue, 30 Jan 2024 18:33:48 +0000 (18:33 +0000)] 
doc: unlang nav case consistency

2 years agodoc: local variables are not keywords
Matthew Newton [Tue, 30 Jan 2024 18:33:04 +0000 (18:33 +0000)] 
doc: local variables are not keywords

2 years agodoc: fix some antora issues
Matthew Newton [Tue, 30 Jan 2024 17:34:40 +0000 (17:34 +0000)] 
doc: fix some antora issues

2 years agohoist checks for EWOULDBLOCK into function calling read()
Alan T. DeKok [Wed, 31 Jan 2024 15:56:35 +0000 (10:56 -0500)] 
hoist checks for EWOULDBLOCK into function calling read()

2 years agocall _exit() when checking if a debugger is attached.
Alan T. DeKok [Wed, 31 Jan 2024 15:20:19 +0000 (10:20 -0500)] 
call _exit() when checking if a debugger is attached.

Callng exit() not only calls all of the atexit() handlers,
which we don't need for a temporary, throw-away child process,
it also causes many pages to be written to unnecessarily.  Which
causes them to be cloned (due to copy on write), and then the
pages are immediately thrown away.

2 years agoadd asserts
Alan T. DeKok [Wed, 31 Jan 2024 02:49:45 +0000 (21:49 -0500)] 
add asserts

2 years agodelay reading dictionaries until after setting up debug state
Alan T. DeKok [Wed, 31 Jan 2024 14:06:31 +0000 (09:06 -0500)] 
delay reading dictionaries until after setting up debug state

On Linux, fr_get_debug_state() calls fork() to get debugging
status.  It then calls exit(), which calls the atexit() handlers,
which complain that memory isn't cleaned up.

We hoist those checks to above the "read dictionary" call, so that
the atexit() handlers won't trigger.

2 years agoprint system error, not fr_strerror()
Alan T. DeKok [Tue, 30 Jan 2024 22:48:12 +0000 (17:48 -0500)] 
print system error, not fr_strerror()

we also likely need a simple way to say "please close this socket",
other than just returning "socket failed"

2 years agohoist TLS cleanup to before mainconfig cleanup
Alan T. DeKok [Tue, 30 Jan 2024 21:05:41 +0000 (16:05 -0500)] 
hoist TLS cleanup to before mainconfig cleanup

2 years agoadd and use TEST_FINI for acutest
Alan T. DeKok [Tue, 30 Jan 2024 21:03:43 +0000 (16:03 -0500)] 
add and use TEST_FINI for acutest

so that the dictionaries are cleaned up when we exit.

This commit also removes the use of constructors.  While this
change makes the tests slower, we do need everything to be cleaned
up on exit, to avoid errors

2 years agocall request_global_free() after request_global_init()
Alan T. DeKok [Tue, 30 Jan 2024 17:46:13 +0000 (12:46 -0500)] 
call request_global_free() after request_global_init()

2 years agoadd prototype to correct file
Alan T. DeKok [Tue, 30 Jan 2024 15:49:03 +0000 (10:49 -0500)] 
add prototype to correct file

2 years agoadd and use fr_tls_dict_free()
Alan T. DeKok [Tue, 30 Jan 2024 15:11:43 +0000 (10:11 -0500)] 
add and use fr_tls_dict_free()

separate the instance_count for OpenSSL and TLS.

If OpenSSL init doesn't call fr_tls_dict_init(), it shouldn't
call autofree for the tls dict

2 years agoCall dict->proto->free() if we called dict->proto->init()
Alan T. DeKok [Tue, 30 Jan 2024 14:47:53 +0000 (09:47 -0500)] 
Call dict->proto->free() if we called dict->proto->init()

With some complete magic

2 years agoclarify debug text
Alan T. DeKok [Tue, 30 Jan 2024 14:27:59 +0000 (09:27 -0500)] 
clarify debug text

2 years agonope. Back out changes until we fix it
Alan T. DeKok [Tue, 30 Jan 2024 14:04:01 +0000 (09:04 -0500)] 
nope.  Back out changes until we fix it

2 years agoremove extraneous assert
Alan T. DeKok [Tue, 30 Jan 2024 13:47:30 +0000 (08:47 -0500)] 
remove extraneous assert

2 years agocall the proto init() routine from finalize()
Alan T. DeKok [Tue, 30 Jan 2024 12:58:50 +0000 (07:58 -0500)] 
call the proto init() routine from finalize()

so that we can apply fixups, and load any foreign dictionaries.

2 years agoquiet compiler
Alan T. DeKok [Tue, 30 Jan 2024 11:55:08 +0000 (06:55 -0500)] 
quiet compiler

2 years agoThere may already be a packet in the buffer. Helps with #5286
Alan T. DeKok [Tue, 30 Jan 2024 11:49:09 +0000 (06:49 -0500)] 
There may already be a packet in the buffer.  Helps with #5286

2 years agoreset dict_gctx if necessary
Alan T. DeKok [Mon, 29 Jan 2024 20:54:51 +0000 (15:54 -0500)] 
reset dict_gctx if necessary

fr_dict_global_ctx_init() sets dict_gctx, so we need
to clean it up if fr_dict_global_ctx_free() is called

2 years agohandle EWOULDBLOCK. Helps with #5286
Alan T. DeKok [Mon, 29 Jan 2024 19:52:03 +0000 (14:52 -0500)] 
handle EWOULDBLOCK.  Helps with #5286

2 years agoset accept FD to be non blocking. Helps with #5286
Alan T. DeKok [Mon, 29 Jan 2024 19:45:46 +0000 (14:45 -0500)] 
set accept FD to be non blocking.  Helps with #5286

2 years agodisable until we fix loading dictionaries with loops
Alan T. DeKok [Mon, 29 Jan 2024 19:41:20 +0000 (14:41 -0500)] 
disable until we fix loading dictionaries with loops

2 years agonarrow down the checks
Alan T. DeKok [Mon, 29 Jan 2024 19:39:14 +0000 (14:39 -0500)] 
narrow down the checks

2 years agomore checks on init / free
Alan T. DeKok [Mon, 29 Jan 2024 13:50:52 +0000 (08:50 -0500)] 
more checks on init / free

on init, we increment the ref count _before_ autoloading the
dictionaries.  That way if the function is called recursively,
(as when dictionaries reference each other), nothing is done.

On free, assert that the reference count is >0

2 years agoassert that the dictionaries are initialized
Alan T. DeKok [Mon, 29 Jan 2024 13:19:31 +0000 (08:19 -0500)] 
assert that the dictionaries are initialized

2 years agoPacify coverity (CID #1587346)
Nick Porter [Mon, 29 Jan 2024 17:33:10 +0000 (17:33 +0000)] 
Pacify coverity (CID #1587346)

2 years agoAllow request to be optional in PostgreSQL escape function
Nick Porter [Mon, 29 Jan 2024 16:48:24 +0000 (16:48 +0000)] 
Allow request to be optional in PostgreSQL escape function

2 years agoUse correct SQLite syntax for id column to reference ROWID
Nick Porter [Mon, 29 Jan 2024 16:47:42 +0000 (16:47 +0000)] 
Use correct SQLite syntax for id column to reference ROWID

2 years agoadded foreign decode to DHCPv6 and tests
Alan T. DeKok [Sun, 28 Jan 2024 22:17:18 +0000 (17:17 -0500)] 
added foreign decode to DHCPv6 and tests

2 years agojust return on error on TLV decode
Alan T. DeKok [Sun, 28 Jan 2024 21:09:35 +0000 (16:09 -0500)] 
just return on error on TLV decode

2 years agocheck slen
Alan T. DeKok [Sun, 28 Jan 2024 17:21:17 +0000 (12:21 -0500)] 
check slen

2 years agoremove unnecessary comment
Alan T. DeKok [Sun, 28 Jan 2024 17:16:58 +0000 (12:16 -0500)] 
remove unnecessary comment

2 years agoadd foreign encoder to DHCPv6
Alan T. DeKok [Sun, 28 Jan 2024 17:06:40 +0000 (12:06 -0500)] 
add foreign encoder to DHCPv6

update dictionaries and tests

2 years agouse consistent names
Alan T. DeKok [Sun, 28 Jan 2024 16:57:10 +0000 (11:57 -0500)] 
use consistent names

2 years agodon't modify slen on return
Alan T. DeKok [Sun, 28 Jan 2024 16:49:56 +0000 (11:49 -0500)] 
don't modify slen on return

2 years agohoist encode foreign ref to common function
Alan T. DeKok [Sun, 28 Jan 2024 16:37:58 +0000 (11:37 -0500)] 
hoist encode foreign ref to common function

2 years agoset ref correctly. don't set it to itself :(
Alan T. DeKok [Sun, 28 Jan 2024 16:37:28 +0000 (11:37 -0500)] 
set ref correctly.  don't set it to itself :(

and don't over-ride the current dictionary

2 years agoadd foreign handlers for DHCPv6
Alan T. DeKok [Sun, 28 Jan 2024 16:22:37 +0000 (11:22 -0500)] 
add foreign handlers for DHCPv6

2 years agothis attribute encodes other DHCPv6 options, not TLVs
Alan T. DeKok [Sun, 28 Jan 2024 16:21:17 +0000 (11:21 -0500)] 
this attribute encodes other DHCPv6 options, not TLVs

2 years agoupdate test for code changes
Alan T. DeKok [Sun, 28 Jan 2024 15:26:14 +0000 (10:26 -0500)] 
update test for code changes

2 years agoslen maybe SSIZE_MIN :(
Alan T. DeKok [Sun, 28 Jan 2024 15:12:31 +0000 (10:12 -0500)] 
slen maybe SSIZE_MIN :(

2 years agoprint actual reasons
Alan T. DeKok [Sun, 28 Jan 2024 14:54:06 +0000 (09:54 -0500)] 
print actual reasons

2 years agoclean up corner cases for decoder as found by fuzzer
Alan T. DeKok [Sun, 28 Jan 2024 14:53:44 +0000 (09:53 -0500)] 
clean up corner cases for decoder as found by fuzzer

2 years agojust return on error on TLV decode
Alan T. DeKok [Sun, 28 Jan 2024 14:46:22 +0000 (09:46 -0500)] 
just return on error on TLV decode

2 years agodhcp attributes can have zeeo length
Alan T. DeKok [Sun, 28 Jan 2024 14:20:52 +0000 (09:20 -0500)] 
dhcp attributes can have zeeo length

2 years agouse thread-local buffer for decoding
Alan T. DeKok [Sat, 27 Jan 2024 21:41:32 +0000 (16:41 -0500)] 
use thread-local buffer for decoding

to save on heap memory allocation

2 years agochange scope of variable
Alan T. DeKok [Sat, 27 Jan 2024 20:58:22 +0000 (15:58 -0500)] 
change scope of variable

2 years agouse tmp_ctx for decoding, not decode_ctx
Alan T. DeKok [Sat, 27 Jan 2024 16:38:20 +0000 (11:38 -0500)] 
use tmp_ctx for decoding, not decode_ctx