]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
6 years agoradius: Don't need file/line for fr_assert_fail anymore
Arran Cudbard-Bell [Tue, 14 Apr 2020 01:34:42 +0000 (20:34 -0500)] 
radius: Don't need file/line for fr_assert_fail anymore

6 years agoDon't need fake expr
Arran Cudbard-Bell [Tue, 14 Apr 2020 01:11:27 +0000 (20:11 -0500)] 
Don't need fake expr

6 years agoevent: Better to make it an assert
Arran Cudbard-Bell [Tue, 14 Apr 2020 01:04:33 +0000 (20:04 -0500)] 
event: Better to make it an assert

6 years agoMissing header
Arran Cudbard-Bell [Tue, 14 Apr 2020 01:03:48 +0000 (20:03 -0500)] 
Missing header

6 years agoMore compiler issues
Arran Cudbard-Bell [Tue, 14 Apr 2020 00:57:59 +0000 (19:57 -0500)] 
More compiler issues

6 years agoDefine macros for NDEBUG
Arran Cudbard-Bell [Tue, 14 Apr 2020 00:48:00 +0000 (19:48 -0500)] 
Define macros for NDEBUG

6 years agoQuiet compiler
Arran Cudbard-Bell [Tue, 14 Apr 2020 00:45:30 +0000 (19:45 -0500)] 
Quiet compiler

6 years agoRemove all calls to exit() and _Exit() except where hey're absolutely necessary
Arran Cudbard-Bell [Mon, 13 Apr 2020 22:57:27 +0000 (17:57 -0500)] 
Remove all calls to exit() and _Exit() except where hey're absolutely necessary

6 years agoFixup assert macros
Arran Cudbard-Bell [Mon, 13 Apr 2020 21:57:58 +0000 (16:57 -0500)] 
Fixup assert macros

# Conflicts:
# src/lib/unlang/tmpl.c

6 years agominor clean ups and bug fixes so that it works
Alan T. DeKok [Mon, 13 Apr 2020 21:52:49 +0000 (17:52 -0400)] 
minor clean ups and bug fixes so that it works

6 years agokevent() will return an error if the process has already exited
Alan T. DeKok [Mon, 13 Apr 2020 21:50:08 +0000 (17:50 -0400)] 
kevent() will return an error if the process has already exited

so we just call waitpid() to reap its status

6 years agoreturn the child_fd to the caller
Alan T. DeKok [Mon, 13 Apr 2020 21:32:29 +0000 (17:32 -0400)] 
return the child_fd to the caller

because fr_exec_child() doesn't do it

6 years agoit helps to wait for the child...
Alan T. DeKok [Mon, 13 Apr 2020 21:32:13 +0000 (17:32 -0400)] 
it helps to wait for the child...

6 years agoadd unlang_module_yield_to_tmpl()
Alan T. DeKok [Mon, 13 Apr 2020 20:38:05 +0000 (16:38 -0400)] 
add unlang_module_yield_to_tmpl()

6 years agocleanups and simplifications
Alan T. DeKok [Mon, 13 Apr 2020 15:15:57 +0000 (11:15 -0400)] 
cleanups and simplifications

6 years agoturn the output buffer into an output value box
Alan T. DeKok [Mon, 13 Apr 2020 14:43:36 +0000 (10:43 -0400)] 
turn the output buffer into an output value box

and allow exec-wait without an output FD

6 years agoFix rlm_cache_ sanity check for crazy people (#3370)
Disconnect3d [Mon, 13 Apr 2020 14:45:14 +0000 (16:45 +0200)] 
Fix rlm_cache_ sanity check for crazy people (#3370)

This PR fixes an incorrect size argument passed to `strncmp` which resulted in smaller prefix matching than intended.

6 years agouse kevent to wait for the PID
Alan T. DeKok [Mon, 13 Apr 2020 13:11:25 +0000 (09:11 -0400)] 
use kevent to wait for the PID

it should all be working.  Next is to add tests

6 years agomore framework for exec-wait
Alan T. DeKok [Mon, 13 Apr 2020 12:09:29 +0000 (08:09 -0400)] 
more framework for exec-wait

we still need to use kqueue to wait for the child PID.  But the
basic parts of the framework are now here.

6 years agoadd fr_exec_waitpid()
Alan T. DeKok [Mon, 13 Apr 2020 11:51:47 +0000 (07:51 -0400)] 
add fr_exec_waitpid()

so that child processes will be cleaned up if we do exec-wait,
but there's an error.

6 years agostart of framework for exec-wait
Alan T. DeKok [Mon, 13 Apr 2020 00:16:28 +0000 (20:16 -0400)] 
start of framework for exec-wait

with reading the output.

And some "todo" notes for the future.

6 years agoexec-wait API using new methods
Alan T. DeKok [Mon, 13 Apr 2020 00:12:25 +0000 (20:12 -0400)] 
exec-wait API using new methods

6 years agofix typo
Alan T. DeKok [Sun, 12 Apr 2020 23:22:02 +0000 (19:22 -0400)] 
fix typo

6 years agostupid OSX leaks memory on fork(). Let's ignore it.
Alan T. DeKok [Sun, 12 Apr 2020 22:11:28 +0000 (18:11 -0400)] 
stupid OSX leaks memory on fork().  Let's ignore it.

6 years agocheck for tainted flag on first argument
Alan T. DeKok [Sun, 12 Apr 2020 22:09:12 +0000 (18:09 -0400)] 
check for tainted flag on first argument

6 years agoprecompile TMPL_TYPE_EXEC in unlang
Alan T. DeKok [Sun, 12 Apr 2020 21:51:58 +0000 (17:51 -0400)] 
precompile TMPL_TYPE_EXEC in unlang

into vpt->tmpl_xlat
Update tmpl_verify to allow this.

In preparation for having precompiled xlat's everywhere.

6 years agopreparation for signal handlers
Alan T. DeKok [Sun, 12 Apr 2020 19:55:57 +0000 (15:55 -0400)] 
preparation for signal handlers

6 years agominor cleanups
Alan T. DeKok [Sun, 12 Apr 2020 18:06:40 +0000 (14:06 -0400)] 
minor cleanups

6 years agoallow modules to push async calls onto the stack
Alan T. DeKok [Sun, 12 Apr 2020 12:49:37 +0000 (08:49 -0400)] 
allow modules to push async calls onto the stack

i.e. triggers.  Which are fire and forget, but which also need
to do async expansions.

6 years agodon't exit on full stack
Alan T. DeKok [Sun, 12 Apr 2020 12:27:08 +0000 (08:27 -0400)] 
don't exit on full stack

instead just cancel the request

6 years agorlm_radius: Fail the first message not the last message
Arran Cudbard-Bell [Sat, 11 Apr 2020 17:18:35 +0000 (12:18 -0500)] 
rlm_radius: Fail the first message not the last message

6 years agorlm_radius - Remove function names, not needed anymore
Arran Cudbard-Bell [Sat, 11 Apr 2020 17:11:29 +0000 (12:11 -0500)] 
rlm_radius - Remove function names, not needed anymore

There's a logging mode which prints log lines that'd be better to use

6 years agoAlways reset repetitions counter
Arran Cudbard-Bell [Sat, 11 Apr 2020 05:22:58 +0000 (00:22 -0500)] 
Always reset repetitions counter

6 years agolog: Fix repetition check
Arran Cudbard-Bell [Sat, 11 Apr 2020 05:21:43 +0000 (00:21 -0500)] 
log: Fix repetition check

6 years agorlm_radius: Free packets before retransmission
Arran Cudbard-Bell [Sat, 11 Apr 2020 05:11:14 +0000 (00:11 -0500)] 
rlm_radius: Free packets before retransmission

6 years agoradius_udp: Simplify cancellation function
Arran Cudbard-Bell [Sat, 11 Apr 2020 01:01:00 +0000 (20:01 -0500)] 
radius_udp: Simplify cancellation function

6 years agotrunk: More documentation
Arran Cudbard-Bell [Sat, 11 Apr 2020 01:00:41 +0000 (20:00 -0500)] 
trunk: More documentation

6 years agotest: lets test the 'radsniff -a' (#3367)
Jorge Pereira [Sat, 11 Apr 2020 00:43:55 +0000 (21:43 -0300)] 
test: lets test the 'radsniff -a' (#3367)

It will prevent to detect issues with pcap.c API used to fetch and list
all network interfaces.

6 years agorlm_radius: Add conn_release callback and cleanup release logic
Arran Cudbard-Bell [Fri, 10 Apr 2020 23:28:49 +0000 (18:28 -0500)] 
rlm_radius: Add conn_release callback and cleanup release logic

6 years agotrack: Enable "free by ctx"
Arran Cudbard-Bell [Fri, 10 Apr 2020 23:12:04 +0000 (18:12 -0500)] 
track: Enable "free by ctx"

6 years agotrunk: Add callback that is called any time a request is remove from a connection
Arran Cudbard-Bell [Fri, 10 Apr 2020 23:01:13 +0000 (18:01 -0500)] 
trunk: Add callback that is called any time a request is remove from a connection

6 years agoTypo
Arran Cudbard-Bell [Fri, 10 Apr 2020 21:16:38 +0000 (16:16 -0500)] 
Typo

6 years agotrunk: Do tconn assignment earlier
Arran Cudbard-Bell [Fri, 10 Apr 2020 21:09:35 +0000 (16:09 -0500)] 
trunk: Do tconn assignment earlier

6 years agotrunk: Zero out log entry structs
Arran Cudbard-Bell [Fri, 10 Apr 2020 21:00:18 +0000 (16:00 -0500)] 
trunk: Zero out log entry structs

6 years agoTypo
Arran Cudbard-Bell [Fri, 10 Apr 2020 20:29:30 +0000 (15:29 -0500)] 
Typo

6 years agoclean up and allow async xlat's to work again
Alan T. DeKok [Fri, 10 Apr 2020 20:22:11 +0000 (16:22 -0400)] 
clean up and allow async xlat's to work again

6 years agodisable this for a day until we finish the async tmpl expansion
Alan T. DeKok [Fri, 10 Apr 2020 18:32:40 +0000 (14:32 -0400)] 
disable this for a day until we finish the async tmpl expansion

6 years agopcap: Fix multiple issues with fr_pcap_device_names - Closes #3363
Arran Cudbard-Bell [Fri, 10 Apr 2020 18:15:15 +0000 (13:15 -0500)] 
pcap: Fix multiple issues with fr_pcap_device_names - Closes #3363

- Strip trailing separation char correctly.
- Don't over allocate string buffer
- Don't use snprintf (it's slow).
- Don't use is_truncated... For some reason it doesn't work correctly here.

6 years agotrunk: Record info about the tconn the request is assigned to
Arran Cudbard-Bell [Fri, 10 Apr 2020 17:43:12 +0000 (12:43 -0500)] 
trunk: Record info about the tconn the request is assigned to

6 years agorlm_radius: Fix potential double-free (#3366)
Jorge Pereira [Fri, 10 Apr 2020 17:06:22 +0000 (14:06 -0300)] 
rlm_radius: Fix potential double-free (#3366)

6 years ago%{1} is async-safe
Alan T. DeKok [Fri, 10 Apr 2020 15:03:12 +0000 (11:03 -0400)] 
%{1} is async-safe

6 years agomake `foo` work again in the config files
Alan T. DeKok [Fri, 10 Apr 2020 14:51:35 +0000 (10:51 -0400)] 
make `foo` work again in the config files

this isn't strictly necessary and should probably be deleted.
But for now, it's a simple way to test UNLANG_TYPE_TMPL and
the async exec functionality

6 years agoset our async_safe value, based on the childs value
Alan T. DeKok [Fri, 10 Apr 2020 14:30:51 +0000 (10:30 -0400)] 
set our async_safe value, based on the childs value

6 years agoUNLANG_TYPE_TMPL is allowed to yield
Alan T. DeKok [Fri, 10 Apr 2020 14:30:26 +0000 (10:30 -0400)] 
UNLANG_TYPE_TMPL is allowed to yield

6 years agowalk over the list of child xlat nodes, too
Alan T. DeKok [Fri, 10 Apr 2020 14:30:01 +0000 (10:30 -0400)] 
walk over the list of child xlat nodes, too

6 years agowarning fixes
Alan T. DeKok [Fri, 10 Apr 2020 12:56:30 +0000 (08:56 -0400)] 
warning fixes

6 years agoremove UNLANG_TYPE_XLAT_INLINE and replace with UNLANG_TYPE_TMPL
Alan T. DeKok [Fri, 10 Apr 2020 12:44:34 +0000 (08:44 -0400)] 
remove UNLANG_TYPE_XLAT_INLINE and replace with UNLANG_TYPE_TMPL

which has the same functionality, but will also allow for async
template expansions.

6 years agostart of code for async template evaluation
Alan T. DeKok [Thu, 9 Apr 2020 21:28:28 +0000 (17:28 -0400)] 
start of code for async template evaluation

6 years agoadd more 'const'
Alan T. DeKok [Thu, 9 Apr 2020 20:28:26 +0000 (16:28 -0400)] 
add more 'const'

we shouldn't be modifying instructions as they are being interpreted.
they're essentially static after the server starts.

6 years agoradsniff: Check if fr_radius_init() started with success (#3362)
Jorge Pereira [Thu, 9 Apr 2020 22:28:18 +0000 (19:28 -0300)] 
radsniff: Check if fr_radius_init() started with success (#3362)

6 years agoradius_udp: Skip free ID allocations
Arran Cudbard-Bell [Thu, 9 Apr 2020 20:21:29 +0000 (15:21 -0500)] 
radius_udp: Skip free ID allocations

6 years agotrunk/radius: Print out detailed state log
Arran Cudbard-Bell [Thu, 9 Apr 2020 19:20:37 +0000 (14:20 -0500)] 
trunk/radius: Print out detailed state log

6 years agorequest: Record where allocation occurred
Arran Cudbard-Bell [Thu, 9 Apr 2020 19:20:15 +0000 (14:20 -0500)] 
request: Record where allocation occurred

6 years agoGeneralize the "hack" in dhcpv4_encode_xlat()
James Jones [Wed, 8 Apr 2020 16:41:00 +0000 (11:41 -0500)] 
Generalize the "hack" in dhcpv4_encode_xlat()

Add three functions:
- fr_cursor_filter_head()
- fr_cursor_filter_next()
- fr_cursor_filter_current()
to let one select items for which an "evaluation function" passed
the item and a context value returns true.

6 years agoadd and expose fr_exec_nowait()
Alan T. DeKok [Thu, 9 Apr 2020 18:30:27 +0000 (14:30 -0400)] 
add and expose fr_exec_nowait()

which is much simpler than the previous code.

6 years agoadd and expose fr_value_box_list_flatten_argv()
Alan T. DeKok [Thu, 9 Apr 2020 18:17:43 +0000 (14:17 -0400)] 
add and expose fr_value_box_list_flatten_argv()

which takes a list of value box groups (e.g. from xlat_eval)
and turns them into an argv-style array

6 years agoconstify things that don't modify their inputs
Alan T. DeKok [Thu, 9 Apr 2020 18:15:49 +0000 (14:15 -0400)] 
constify things that don't modify their inputs

6 years agoadd and expose tmpl_async_required()
Alan T. DeKok [Thu, 9 Apr 2020 17:57:20 +0000 (13:57 -0400)] 
add and expose tmpl_async_required()

6 years agoadd and expose xlat_async_required()
Alan T. DeKok [Thu, 9 Apr 2020 17:52:01 +0000 (13:52 -0400)] 
add and expose xlat_async_required()

6 years agobreak string across lines
Arran Cudbard-Bell [Thu, 9 Apr 2020 17:22:43 +0000 (12:22 -0500)] 
break string across lines

6 years agoradius_track: Non-debug version shouldn't have file/line
Arran Cudbard-Bell [Thu, 9 Apr 2020 17:22:35 +0000 (12:22 -0500)] 
radius_track: Non-debug version shouldn't have file/line

6 years agorework so CHILD_GROUP is no longer necessary
Alan T. DeKok [Thu, 9 Apr 2020 12:29:59 +0000 (08:29 -0400)] 
rework so CHILD_GROUP is no longer necessary

6 years agore-do commit 798ef3a9b
Alan T. DeKok [Thu, 9 Apr 2020 11:59:47 +0000 (07:59 -0400)] 
re-do commit 798ef3a9b

6 years agoreturn something
Arran Cudbard-Bell [Thu, 9 Apr 2020 03:12:52 +0000 (22:12 -0500)] 
return something

6 years agotrack: We still probably want this check for non-debug builds
Arran Cudbard-Bell [Thu, 9 Apr 2020 03:09:58 +0000 (22:09 -0500)] 
track: We still probably want this check for non-debug builds

6 years agoschedule: Fix debug messages for workers
Arran Cudbard-Bell [Thu, 9 Apr 2020 03:07:01 +0000 (22:07 -0500)] 
schedule: Fix debug messages for workers

6 years agotrunk: Remove asserts limiting states we can enter the failed state from
Arran Cudbard-Bell [Thu, 9 Apr 2020 03:04:32 +0000 (22:04 -0500)] 
trunk: Remove asserts limiting states we can enter the failed state from

6 years agoconnection: Allow nested signal pausing, and prevent duplicates
Arran Cudbard-Bell [Thu, 9 Apr 2020 02:36:10 +0000 (21:36 -0500)] 
connection: Allow nested signal pausing, and prevent duplicates

trunk: Pause connection signal delivery in more places

6 years agotrack: Disallow double allocations
Arran Cudbard-Bell [Thu, 9 Apr 2020 02:34:28 +0000 (21:34 -0500)] 
track: Disallow double allocations

6 years agoradius: Add check for treq being freed without releasing its tracking entry
Arran Cudbard-Bell [Thu, 9 Apr 2020 01:17:52 +0000 (20:17 -0500)] 
radius: Add check for treq being freed without releasing its tracking entry

6 years agoprobably not a valid assert given the way the rest of the public API works
Arran Cudbard-Bell [Wed, 8 Apr 2020 23:40:30 +0000 (18:40 -0500)] 
probably not a valid assert given the way the rest of the public API works

6 years agotrunk: Assert if we attempt to requeue a request in an invalid state
Arran Cudbard-Bell [Wed, 8 Apr 2020 23:38:28 +0000 (18:38 -0500)] 
trunk: Assert if we attempt to requeue a request in an invalid state

6 years agofixup evaluation of XLAT_CHILD nodes
Alan T. DeKok [Wed, 8 Apr 2020 21:31:02 +0000 (17:31 -0400)] 
fixup evaluation of XLAT_CHILD nodes

put the result into state->rhead
on resume, merge that result into the parent group

6 years agoparent string value from value_box we just created
Alan T. DeKok [Wed, 8 Apr 2020 21:30:11 +0000 (17:30 -0400)] 
parent string value from value_box we just created

6 years agoFix memory leak in radsniff (#3359)
Jorge Pereira [Wed, 8 Apr 2020 21:19:17 +0000 (18:19 -0300)] 
Fix memory leak in radsniff (#3359)

We should call pcap_freealldevs() always after pcap_findalldevs()

6 years agoadd async_exec method for testing async execs
Alan T. DeKok [Wed, 8 Apr 2020 20:58:48 +0000 (16:58 -0400)] 
add async_exec method for testing async execs

not done, and mostly for debugging the framework.  Will be
extended as the framework is fixed.

6 years agofix typo
Alan T. DeKok [Wed, 8 Apr 2020 20:26:50 +0000 (16:26 -0400)] 
fix typo

6 years agoallow things like --foo=%{bar}
Alan T. DeKok [Wed, 8 Apr 2020 20:19:16 +0000 (16:19 -0400)] 
allow things like --foo=%{bar}

for argv expansion.

6 years agostop on "p == end", too
Alan T. DeKok [Wed, 8 Apr 2020 20:18:16 +0000 (16:18 -0400)] 
stop on "p == end", too

6 years agoterminate string
Alan T. DeKok [Wed, 8 Apr 2020 19:58:38 +0000 (15:58 -0400)] 
terminate string

6 years agoforbid duplicate sections
Alan T. DeKok [Wed, 8 Apr 2020 19:25:07 +0000 (15:25 -0400)] 
forbid duplicate sections

6 years agorlm_radius: better assert
Arran Cudbard-Bell [Wed, 8 Apr 2020 18:04:06 +0000 (13:04 -0500)] 
rlm_radius: better assert

6 years agorlm_radius: Assert if we still have tracking entries when the connection is being...
Arran Cudbard-Bell [Wed, 8 Apr 2020 17:59:49 +0000 (12:59 -0500)] 
rlm_radius: Assert if we still have tracking entries when the connection is being closed

6 years agomore debug messages
Alan T. DeKok [Wed, 8 Apr 2020 17:38:44 +0000 (13:38 -0400)] 
more debug messages

6 years agoreturn "read error" when we're done reading
Alan T. DeKok [Wed, 8 Apr 2020 16:47:35 +0000 (12:47 -0400)] 
return "read error" when we're done reading

which then ensures that the sockets are closed.

6 years agoa blocked worker is now a non-fatal error.
Alan T. DeKok [Wed, 8 Apr 2020 16:40:13 +0000 (12:40 -0400)] 
a blocked worker is now a non-fatal error.

The network side just tries another worker.  And if all workers
are blocked, it suspends all network reads.

Then when a worker replies, it unsuspends the network IO

6 years agopass "inlen" to the various functions
Alan T. DeKok [Wed, 8 Apr 2020 15:56:01 +0000 (11:56 -0400)] 
pass "inlen" to the various functions

which mostly just pass it along to the functions they call,
and don't check it as much as they should.  But it's needed for
later work.

6 years agoscheduler: Don't need to destroy the network mutliple times
Arran Cudbard-Bell [Wed, 8 Apr 2020 16:27:26 +0000 (11:27 -0500)] 
scheduler: Don't need to destroy the network mutliple times

fr_network_exit now destroys the network too.

Calling it again on line 666 results in use-after-free issues with the message set.

6 years agonetwork: Pop messages before signalling workers to exit
Arran Cudbard-Bell [Wed, 8 Apr 2020 16:14:47 +0000 (11:14 -0500)] 
network: Pop messages before signalling workers to exit

6 years agofix problems introduced in commit 3e7e6970
Alan T. DeKok [Wed, 8 Apr 2020 15:01:35 +0000 (11:01 -0400)] 
fix problems introduced in commit 3e7e6970

u->code != code.  They are different variables with different
meanings.