]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
3 years agoStart using modeling for Coverity (#4853)
James Jones [Tue, 31 Jan 2023 15:03:30 +0000 (09:03 -0600)] 
Start using modeling for Coverity (#4853)

This involves
* making the coverity workflow build the model
* adding model source file(s)

3 years agoUse found terminal character to determine how many URI parts to advance
Nick Porter [Mon, 30 Jan 2023 14:50:24 +0000 (14:50 +0000)] 
Use found terminal character to determine how many URI parts to advance

not the character found after skipping `extra_skip`

3 years agoCorrect module config for rest module test
Nick Porter [Mon, 30 Jan 2023 13:52:15 +0000 (13:52 +0000)] 
Correct module config for rest module test

3 years agoReplace != with !( == ) in rest module tests
Nick Porter [Mon, 30 Jan 2023 13:51:53 +0000 (13:51 +0000)] 
Replace != with !( == ) in rest module tests

3 years agocleanups and fixes
Alan T. DeKok [Mon, 30 Jan 2023 21:06:57 +0000 (16:06 -0500)] 
cleanups and fixes

3 years agore-initialize the iterator for every module we delete
Alan T. DeKok [Mon, 30 Jan 2023 20:27:34 +0000 (15:27 -0500)] 
re-initialize the iterator for every module we delete

because deleting one module may cause it to delete child modules
in the tree, which confuses the iterator and makes it sad.

3 years agoskip the '/'
Alan T. DeKok [Mon, 30 Jan 2023 19:51:09 +0000 (14:51 -0500)] 
skip the '/'

3 years agoautomatically set DEBUGGER_ATTACHED when executing gdb or lldb
Alan T. DeKok [Mon, 30 Jan 2023 16:34:30 +0000 (11:34 -0500)] 
automatically set DEBUGGER_ATTACHED when executing gdb or lldb

because the debugger detection on some OS's is broken and doesn't
work.

3 years agotypo
Alan T. DeKok [Mon, 30 Jan 2023 16:18:28 +0000 (11:18 -0500)] 
typo

3 years agomore checking for corner cases
Alan T. DeKok [Mon, 30 Jan 2023 12:51:44 +0000 (07:51 -0500)] 
more checking for corner cases

3 years agoit helps to set the value for State
Alan T. DeKok [Mon, 30 Jan 2023 00:27:49 +0000 (19:27 -0500)] 
it helps to set the value for State

3 years agouse VALID macro
Alan T. DeKok [Sun, 29 Jan 2023 22:07:57 +0000 (17:07 -0500)] 
use VALID macro

3 years agorename TACACS+ packet types
Alan T. DeKok [Sat, 28 Jan 2023 01:45:11 +0000 (20:45 -0500)] 
rename TACACS+ packet types

for increased clarity, now that we're actually using it.

and do a number of other cleanups.  Fix the state machine to match
the new packet types.  Fix the state machine to track state based
on synthesized information.  Add authentication logging ala RADIUS

3 years agofix up macros to be sure there's no possibility of error
Alan T. DeKok [Fri, 27 Jan 2023 19:11:36 +0000 (14:11 -0500)] 
fix up macros to be sure there's no possibility of error

3 years agoResequence to avoid potential double free. Fixes #4863
Nick Porter [Fri, 27 Jan 2023 16:10:20 +0000 (16:10 +0000)] 
Resequence to avoid potential double free.  Fixes #4863

3 years agoEnsure LDAPMessage is freed on errors. Fixes #4864
Nick Porter [Fri, 27 Jan 2023 15:49:12 +0000 (15:49 +0000)] 
Ensure LDAPMessage is freed on errors. Fixes #4864

3 years agothere should have been no reply yet
Alan T. DeKok [Fri, 27 Jan 2023 00:17:46 +0000 (19:17 -0500)] 
there should have been no reply yet

3 years agoforce reject if there's no auth-type
Alan T. DeKok [Thu, 26 Jan 2023 23:50:52 +0000 (18:50 -0500)] 
force reject if there's no auth-type

and don't set default accept if "recv Access-Request" returns "ok"

3 years agotypo and cleanups
Alan T. DeKok [Thu, 26 Jan 2023 20:48:57 +0000 (15:48 -0500)] 
typo and cleanups

3 years agonot needed
Alan T. DeKok [Thu, 26 Jan 2023 18:20:23 +0000 (13:20 -0500)] 
not needed

3 years agoupdate docs
Alan T. DeKok [Thu, 26 Jan 2023 15:16:57 +0000 (10:16 -0500)] 
update docs

3 years agoRemove dead code (CID #1519001) (#4854)
James Jones [Thu, 26 Jan 2023 15:04:57 +0000 (09:04 -0600)] 
Remove dead code (CID #1519001) (#4854)

_event_build_indexes() always returns 0, so fr_atexit_global_once_ret()
will always set ret to zero, and hence ret won't be negative.

3 years agopap: Hoist &control:User-Password check so that it can be found (#4866)
Terry Burton [Thu, 26 Jan 2023 14:05:46 +0000 (14:05 +0000)] 
pap: Hoist &control:User-Password check so that it can be found (#4866)

Since loop is rooted at &Password.

3 years agofix unlock and return code. Fixes #4862
Alan T. DeKok [Thu, 26 Jan 2023 13:59:23 +0000 (08:59 -0500)] 
fix unlock and return code.  Fixes #4862

Don't override an error return code with a successful one.
Instead, set the success code first, and then override it if
there's an error.

Now that that's cleaned up, always unlock the mutex

3 years agouse FR_TACACS_PACKET_CODE_VALID
Alan T. DeKok [Wed, 25 Jan 2023 01:33:27 +0000 (20:33 -0500)] 
use FR_TACACS_PACKET_CODE_VALID

3 years agoOnly leaf vps have the data object
Nick Porter [Wed, 25 Jan 2023 19:19:44 +0000 (19:19 +0000)] 
Only leaf vps have the data object

3 years agoAdd unit tests launcher to launch.json
Nick Porter [Wed, 18 Jan 2023 10:53:17 +0000 (10:53 +0000)] 
Add unit tests launcher to launch.json

3 years agoDon't set the path in the spec file
Arran Cudbard-Bell [Thu, 26 Jan 2023 06:42:07 +0000 (01:42 -0500)] 
Don't set the path in the spec file

3 years agoPlacate coverity about day-to-second calculation (CID #1520503, #1520502) (#4859)
James Jones [Wed, 25 Jan 2023 01:06:03 +0000 (19:06 -0600)] 
Placate coverity about day-to-second calculation (CID #1520503, #1520502) (#4859)

Coverity doesn't realize that day of week or month is constrained
such that multiplying by seconds per day won't overflow int32_t.

3 years agoinstall libtalloc && libpcap, too
Alan T. DeKok [Tue, 24 Jan 2023 19:27:42 +0000 (14:27 -0500)] 
install libtalloc && libpcap, too

3 years agoClean up versioning for libtalloc and libkqueue, add rule to install libpcap (#4858)
Stephen Blackwell [Tue, 24 Jan 2023 19:15:48 +0000 (13:15 -0600)] 
Clean up versioning for libtalloc and libkqueue, add rule to install libpcap (#4858)

Signed-off-by: Stephen Blackwell <sblackwell@networkradius.com>
Signed-off-by: Stephen Blackwell <sblackwell@networkradius.com>
3 years agochange assert to run-time warning
Alan T. DeKok [Tue, 24 Jan 2023 17:27:40 +0000 (12:27 -0500)] 
change assert to run-time warning

until we track down why it occurs in CI but not locally

3 years agoscript to build (hopefully) prerequisites on RH
Alan T. DeKok [Tue, 24 Jan 2023 17:16:49 +0000 (12:16 -0500)] 
script to build (hopefully) prerequisites on RH

3 years agowrapper scripts to run local binaries
Alan T. DeKok [Tue, 24 Jan 2023 17:03:04 +0000 (12:03 -0500)] 
wrapper scripts to run local binaries

3 years agotell people about "xcrun foo" on OSX
Alan T. DeKok [Tue, 24 Jan 2023 16:41:17 +0000 (11:41 -0500)] 
tell people about "xcrun foo" on OSX

3 years agoassert that we don't leak memory on each packet
Alan T. DeKok [Tue, 24 Jan 2023 14:49:56 +0000 (09:49 -0500)] 
assert that we don't leak memory on each packet

3 years agochange name from SARL to SAS
Alan T. DeKok [Tue, 24 Jan 2023 12:12:37 +0000 (07:12 -0500)] 
change name from SARL to SAS

3 years agowhitespace
Alan T. DeKok [Tue, 24 Jan 2023 12:08:16 +0000 (07:08 -0500)] 
whitespace

3 years agoit's a day for typos
Alan T. DeKok [Tue, 24 Jan 2023 01:43:23 +0000 (20:43 -0500)] 
it's a day for typos

3 years agoclean up and regularize names
Alan T. DeKok [Tue, 24 Jan 2023 01:21:58 +0000 (20:21 -0500)] 
clean up and regularize names

 perl -p -i -e 's/fr_vmps_codes/fr_vmps_packet_names/g' $(git grep -l fr_vmps_codes)

3 years agoclean up and regularize names
Alan T. DeKok [Tue, 24 Jan 2023 01:16:42 +0000 (20:16 -0500)] 
clean up and regularize names

perl -p -i -e 's/fr_dns_packet_codes/fr_dns_packet_names/g' $(git grep -l fr_dns_packet_codes)

3 years agoClean up and regularize names
Alan T. DeKok [Tue, 24 Jan 2023 01:14:47 +0000 (20:14 -0500)] 
Clean up and regularize names

perl -p -i -e 's/fr_dhcpv6_packet_types/fr_dhcpv6_packet_names/g' $(git grep -l fr_dhcpv6_packet_types)

3 years agoclean up and standardize names
Alan T. DeKok [Tue, 24 Jan 2023 01:12:08 +0000 (20:12 -0500)] 
clean up and standardize names

perl -p -i -e 's/fr_request_types/fr_radius_request_name_table/g' $(git grep -l fr_request_types)

3 years agoclean up and dedup FR_RADIUS_PACKET_CODE_VALID
Alan T. DeKok [Tue, 24 Jan 2023 01:07:37 +0000 (20:07 -0500)] 
clean up and dedup FR_RADIUS_PACKET_CODE_VALID

perl -p -i -e 's/is_radius_code/FR_RADIUS_PACKET_CODE_VALID/g' $(find . -name "*.[ch]" -print)

3 years agoclean up RADIUS names
Alan T. DeKok [Tue, 24 Jan 2023 01:05:09 +0000 (20:05 -0500)] 
clean up RADIUS names

perl -p -i -e 's/fr_packet_codes/fr_radius_packet_names/g' $(find . -name "*.[ch]" -print)

3 years agoclean up names
Alan T. DeKok [Tue, 24 Jan 2023 01:04:07 +0000 (20:04 -0500)] 
clean up names

perl -p -i -e 's/fr_tacacs_packet_codes/fr_tacacs_packet_names/g' $(find . -name "*.[ch]" -print)

3 years agoclean up definition of FR_TACACS_CODE_MAX. Fixes #4856
Alan T. DeKok [Tue, 24 Jan 2023 00:58:19 +0000 (19:58 -0500)] 
clean up definition of FR_TACACS_CODE_MAX.  Fixes #4856

The CODE_MAX definition should be one more than the last valid
packet code.

The DO_NOT_RESPOND value should be a value which will never show
up in a real packet.

The PACKET_CODE_VALID macro should be used instead of relying on
manual checks of CODE_MAX

3 years agotypo
Alan T. DeKok [Mon, 23 Jan 2023 22:18:11 +0000 (17:18 -0500)] 
typo

3 years agotypo to rearrange code
Alan T. DeKok [Mon, 23 Jan 2023 22:10:04 +0000 (17:10 -0500)] 
typo to rearrange code

3 years agodon't call frame_pop() if we have REQUEST_STOP_PROCESSING
Alan T. DeKok [Mon, 23 Jan 2023 21:30:31 +0000 (16:30 -0500)] 
don't call frame_pop() if we have REQUEST_STOP_PROCESSING

3 years agoclean up descriptions and names
Alan T. DeKok [Mon, 23 Jan 2023 20:25:25 +0000 (15:25 -0500)] 
clean up descriptions and names

so that the names and functions are descriptive and correct.

3 years agouse CLOCK_MONOTONIC_RAW if it exists
Alan T. DeKok [Mon, 23 Jan 2023 19:35:07 +0000 (14:35 -0500)] 
use CLOCK_MONOTONIC_RAW if it exists

otherwise use CLOCK_MONOTONIC.  The RAW version is unaffected
by frequency or time adjustments

3 years agoremove mach functions.
Alan T. DeKok [Mon, 23 Jan 2023 19:31:41 +0000 (14:31 -0500)] 
remove mach functions.

OSX now (and for a long time) has had clock_gettime().  The old
code using the mach functions didn't even compile when we tried
to not use clock_gettime().  So... nuke the old / broken / unused
code.

3 years agoclarifications and typo fixes
Alan T. DeKok [Mon, 23 Jan 2023 21:34:24 +0000 (16:34 -0500)] 
clarifications and typo fixes

3 years agoadd functions to get gmt offset and daylight savings flag
Alan T. DeKok [Sun, 22 Jan 2023 13:51:30 +0000 (08:51 -0500)] 
add functions to get gmt offset and daylight savings flag

we should note that the server tracks times in UTC, so

(date) foo % (time_delta) 1d

will return the offset from the UTC day, not from the local time.
This could perhaps be more prominent.  But tracking times internally
in UTC is the only way to make sure we're not screwed up by time
zone and DST changes.

3 years agoupdate for expressions terminating before EOL
Alan T. DeKok [Sun, 22 Jan 2023 12:56:50 +0000 (07:56 -0500)] 
update for expressions terminating before EOL

the admin must manually add backslashes for continuation

3 years agoadd week / month / year time resolution
Alan T. DeKok [Sun, 22 Jan 2023 11:33:06 +0000 (06:33 -0500)] 
add week / month / year time resolution

which are vaguely correct for months, and correct to the second
for years.  The main purpose here is to allow for at least rough
parsing of years / months

3 years agoGet rid of double unlock in fr_atexit_global_once_ret() (CID #1518999) (#4855)
James Jones [Sun, 22 Jan 2023 15:52:11 +0000 (09:52 -0600)] 
Get rid of double unlock in fr_atexit_global_once_ret() (CID #1518999) (#4855)

3 years agoadd Tmp-Time-Delta-*
Alan T. DeKok [Sat, 21 Jan 2023 21:48:40 +0000 (16:48 -0500)] 
add Tmp-Time-Delta-*

we really need local variables :(

3 years agodate % time_delta --> time_delta
Alan T. DeKok [Sat, 21 Jan 2023 21:46:54 +0000 (16:46 -0500)] 
date % time_delta --> time_delta

so we can round dates up / down as appropriate.

Note that this really only works for fixed periods of time_delta,
such as seconds / minutes / hours / days.  It doesn't work for
months.

3 years agoadd magic flag for expressions
Alan T. DeKok [Sat, 21 Jan 2023 21:23:43 +0000 (16:23 -0500)] 
add magic flag for expressions

so that they always get parsed via xlat_tokenize_expression().

Because if we pass an expression to tmpl_afrom_substr(), it will
happily return a tmpl for the entire string, which is a series of
string concatenations.  And that's not what we want.

3 years agoprint out what we're assigning before we assign it
Alan T. DeKok [Sat, 21 Jan 2023 21:02:04 +0000 (16:02 -0500)] 
print out what we're assigning before we assign it

3 years agoadd map_afrom*_edit() for edit sections
Alan T. DeKok [Sat, 21 Jan 2023 20:36:32 +0000 (15:36 -0500)] 
add map_afrom*_edit() for edit sections

because the RHS of edit sections can now be expressions.

3 years agoAPI to get log destination by name
Alan T. DeKok [Sat, 21 Jan 2023 20:36:08 +0000 (15:36 -0500)] 
API to get log destination by name

3 years agoif we can't parse a token, it must be an expression
Alan T. DeKok [Sat, 21 Jan 2023 15:24:23 +0000 (10:24 -0500)] 
if we can't parse a token, it must be an expression

3 years agofirst pass at multiple log destinations
Alan T. DeKok [Fri, 20 Jan 2023 17:59:08 +0000 (12:59 -0500)] 
first pass at multiple log destinations

for now, only files.  And there's no way to change log destinations.
but it's at least a start

3 years agouse more consistent names
Alan T. DeKok [Fri, 20 Jan 2023 15:28:37 +0000 (10:28 -0500)] 
use more consistent names

3 years agopartial parse is only if at eol, and depth==0, and terminal character
Alan T. DeKok [Fri, 20 Jan 2023 14:51:20 +0000 (09:51 -0500)] 
partial parse is only if at eol, and depth==0, and terminal character

3 years agoset an error string
Alan T. DeKok [Fri, 20 Jan 2023 14:35:50 +0000 (09:35 -0500)] 
set an error string

3 years agoadd tmpl_set_xlat()
Alan T. DeKok [Fri, 20 Jan 2023 14:35:29 +0000 (09:35 -0500)] 
add tmpl_set_xlat()

for use with edit expressions

3 years agoonly sections can have ident2 name trees
Alan T. DeKok [Fri, 20 Jan 2023 13:14:11 +0000 (08:14 -0500)] 
only sections can have ident2 name trees

i.e. CONF_PAIR and CONF_DATA don't have children which use
ident2.

Or currently even ident1 for that matter, but it's theoretically
possible and useful.

3 years agoprint out sizes of configuration things, too
Alan T. DeKok [Fri, 20 Jan 2023 13:04:19 +0000 (08:04 -0500)] 
print out sizes of configuration things, too

3 years agorearrange to decrease size
Alan T. DeKok [Fri, 20 Jan 2023 13:04:09 +0000 (08:04 -0500)] 
rearrange to decrease size

3 years agomore typo
Alan T. DeKok [Thu, 19 Jan 2023 23:49:01 +0000 (18:49 -0500)] 
more typo

3 years agotypo
Alan T. DeKok [Thu, 19 Jan 2023 23:06:03 +0000 (18:06 -0500)] 
typo

3 years agoset global search path, so that the fuzzer can find things
Alan T. DeKok [Thu, 19 Jan 2023 22:21:25 +0000 (17:21 -0500)] 
set global search path, so that the fuzzer can find things

3 years agotypo
Alan T. DeKok [Thu, 19 Jan 2023 20:20:03 +0000 (15:20 -0500)] 
typo

3 years agotreat time_delta as floating point for multiplication
Alan T. DeKok [Thu, 19 Jan 2023 20:11:47 +0000 (15:11 -0500)] 
treat time_delta as floating point for multiplication

3 years agoif there's no precision, time_deltas are evaluated in seconds
Alan T. DeKok [Thu, 19 Jan 2023 20:02:47 +0000 (15:02 -0500)] 
if there's no precision, time_deltas are evaluated in seconds

3 years agoremove extraneous "break"
Alan T. DeKok [Thu, 19 Jan 2023 20:01:30 +0000 (15:01 -0500)] 
remove extraneous "break"

3 years agoadd and document %(time:now)
Alan T. DeKok [Thu, 19 Jan 2023 17:50:56 +0000 (12:50 -0500)] 
add and document %(time:now)

which returns a _boxed_ time, and not a stupid integer.

3 years agocasting date to time_delta does NOT change the value
Alan T. DeKok [Thu, 19 Jan 2023 17:29:00 +0000 (12:29 -0500)] 
casting date to time_delta does NOT change the value

it only changes the precision, and that's only used for
printing / parsing.  Internally, all different-precision dates
and time_deltas are stored as 64-bit integers in nanoseconds

and the same goes for date --> time_delta

3 years agospecial-case (date - date) --> time_delta
Alan T. DeKok [Thu, 19 Jan 2023 17:28:26 +0000 (12:28 -0500)] 
special-case  (date - date) --> time_delta

3 years agonote crappy code && todo's
Alan T. DeKok [Thu, 19 Jan 2023 15:54:08 +0000 (10:54 -0500)] 
note crappy code && todo's

3 years agouse normal APIs to print the reply packet
Alan T. DeKok [Thu, 19 Jan 2023 14:40:38 +0000 (09:40 -0500)] 
use normal APIs to print the reply packet

and make sure that the contents all go to the same FILE* handle

3 years agoadd fr_log_init_fp()
Alan T. DeKok [Thu, 19 Jan 2023 14:39:48 +0000 (09:39 -0500)] 
add fr_log_init_fp()

for pre-existing FILE* handles

3 years agotypo
Alan T. DeKok [Thu, 19 Jan 2023 14:37:51 +0000 (09:37 -0500)] 
typo

3 years agowe use SRC_CFLAGS, not TGT_CFLAGS
Alan T. DeKok [Thu, 19 Jan 2023 13:59:51 +0000 (08:59 -0500)] 
we use SRC_CFLAGS, not TGT_CFLAGS

3 years agothe documentation lies.
Alan T. DeKok [Thu, 19 Jan 2023 13:48:58 +0000 (08:48 -0500)] 
the documentation lies.

The build output shows

CFLAGS=-O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link

So let's try that.

3 years agoregenerate as per previous patch
Alan T. DeKok [Thu, 19 Jan 2023 13:15:03 +0000 (08:15 -0500)] 
regenerate as per previous patch

3 years agoFixed misplaced bash syntax when adding the debug flag to CFLAGS in developer mode...
Margaret Cullen [Thu, 19 Jan 2023 13:14:29 +0000 (08:14 -0500)] 
Fixed misplaced bash syntax when adding the debug flag to CFLAGS in developer mode (#4852)

3 years agoMAX code is invalid
Alan T. DeKok [Wed, 18 Jan 2023 20:39:06 +0000 (15:39 -0500)] 
MAX code is invalid

3 years agocheck that the sequence numbers match
Alan T. DeKok [Wed, 18 Jan 2023 20:36:31 +0000 (15:36 -0500)] 
check that the sequence numbers match

as a "duct tape" kind of security.

3 years agocheck that clients send odd sequence numbers
Alan T. DeKok [Wed, 18 Jan 2023 20:35:54 +0000 (15:35 -0500)] 
check that clients send odd sequence numbers

3 years agouse random session ID for connections
Alan T. DeKok [Wed, 18 Jan 2023 20:27:42 +0000 (15:27 -0500)] 
use random session ID for connections

3 years agominor cleanups
Alan T. DeKok [Wed, 18 Jan 2023 20:26:53 +0000 (15:26 -0500)] 
minor cleanups

3 years agoinclude the header in the packet length
Alan T. DeKok [Wed, 18 Jan 2023 19:55:50 +0000 (14:55 -0500)] 
include the header in the packet length

3 years agoprint decode error, too
Alan T. DeKok [Wed, 18 Jan 2023 19:55:38 +0000 (14:55 -0500)] 
print decode error, too

3 years agothe EOF callback may free and close the socket
Alan T. DeKok [Wed, 18 Jan 2023 19:39:16 +0000 (14:39 -0500)] 
the EOF callback may free and close the socket

so check for is_registered before calling ef->error(), as the
event_callback() in the EOF handler may have closed and freed
the socket.

3 years agodon't smash CFLAGS when doing --with-developer
Alan T. DeKok [Wed, 18 Jan 2023 19:12:25 +0000 (14:12 -0500)] 
don't smash CFLAGS when doing --with-developer