]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
6 years agoAdd gctx to dict struct
Arran Cudbard-Bell [Wed, 6 Nov 2019 23:49:37 +0000 (17:49 -0600)] 
Add gctx to dict struct

6 years agoFixup dict free functions to work in the gctx the dictionary was allocated
Arran Cudbard-Bell [Wed, 6 Nov 2019 23:29:58 +0000 (17:29 -0600)] 
Fixup dict free functions to work in the gctx the dictionary was allocated

Fixup unit_test_attribute to allocate test dictionaries in a different gctx

6 years agoUse talloc_get_type_abort_const
Arran Cudbard-Bell [Wed, 6 Nov 2019 23:27:38 +0000 (17:27 -0600)] 
Use talloc_get_type_abort_const

6 years agowe need more memory in the default global pool.
Alan T. DeKok [Wed, 6 Nov 2019 22:21:24 +0000 (17:21 -0500)] 
we need more memory in the default global pool.

It would be nice if the functions would check for OOM in the
global pool and return a descriptive error.

6 years agocheck for OOM errors
Alan T. DeKok [Wed, 6 Nov 2019 22:20:37 +0000 (17:20 -0500)] 
check for OOM errors

6 years agocheck limit before dereferencing it
Alan T. DeKok [Wed, 6 Nov 2019 17:28:40 +0000 (12:28 -0500)] 
check limit before dereferencing it

6 years agoerror out on memory allocation failures
Alan T. DeKok [Wed, 6 Nov 2019 17:26:01 +0000 (12:26 -0500)] 
error out on memory allocation failures

6 years agoshut up PVS studio
Alan T. DeKok [Wed, 6 Nov 2019 17:24:34 +0000 (12:24 -0500)] 
shut up PVS studio

6 years agocheck for memory allocation failures
Alan T. DeKok [Wed, 6 Nov 2019 17:22:14 +0000 (12:22 -0500)] 
check for memory allocation failures

6 years agomove assert to before dereference of variable
Alan T. DeKok [Wed, 6 Nov 2019 17:21:18 +0000 (12:21 -0500)] 
move assert to before dereference of variable

6 years agoTypo (#3106)
Jorge Pereira [Wed, 6 Nov 2019 21:27:36 +0000 (18:27 -0300)] 
Typo (#3106)

6 years agoMove to a read only "config" struct in unit_test_attribute
Arran Cudbard-Bell [Wed, 6 Nov 2019 20:27:58 +0000 (14:27 -0600)] 
Move to a read only "config" struct in unit_test_attribute

6 years agoStupid const issues
Arran Cudbard-Bell [Wed, 6 Nov 2019 20:08:16 +0000 (14:08 -0600)] 
Stupid const issues

This reverts commit dd6375099cb27af6af99fe6fa6d45652a552759a.

6 years agoHere too.
Arran Cudbard-Bell [Wed, 6 Nov 2019 19:43:37 +0000 (13:43 -0600)] 
Here too.

6 years agoNULLify pointers on dl_free
Arran Cudbard-Bell [Wed, 6 Nov 2019 19:42:48 +0000 (13:42 -0600)] 
NULLify pointers on dl_free

6 years agoFree dictionaries later
Arran Cudbard-Bell [Wed, 6 Nov 2019 19:38:22 +0000 (13:38 -0600)] 
Free dictionaries later

6 years agoReturn how many references remain when freeing dictionaries
Arran Cudbard-Bell [Wed, 6 Nov 2019 19:14:29 +0000 (13:14 -0600)] 
Return how many references remain when freeing dictionaries

6 years agoBe nicer about NULL pointers in dl_free
Arran Cudbard-Bell [Wed, 6 Nov 2019 19:07:00 +0000 (13:07 -0600)] 
Be nicer about NULL pointers in dl_free

6 years agoMore grr...
Arran Cudbard-Bell [Wed, 6 Nov 2019 19:05:34 +0000 (13:05 -0600)] 
More grr...

6 years agoGrr...
Arran Cudbard-Bell [Wed, 6 Nov 2019 19:03:57 +0000 (13:03 -0600)] 
Grr...

6 years agoTypo
Arran Cudbard-Bell [Wed, 6 Nov 2019 19:00:50 +0000 (13:00 -0600)] 
Typo

6 years agoMake talloc_const_free return an error code
Arran Cudbard-Bell [Wed, 6 Nov 2019 18:59:46 +0000 (12:59 -0600)] 
Make talloc_const_free return an error code

Make talloc_decrease_ref_count return the number of remaining references.

Add explicit dl_free function.

6 years agoFix more return points in fr_dict_global_init
Arran Cudbard-Bell [Wed, 6 Nov 2019 18:29:58 +0000 (12:29 -0600)] 
Fix more return points in fr_dict_global_init

6 years agoTypo
Jorge Pereira [Wed, 6 Nov 2019 17:58:51 +0000 (14:58 -0300)] 
Typo

6 years agoFix return code check
Arran Cudbard-Bell [Wed, 6 Nov 2019 17:51:33 +0000 (11:51 -0600)] 
Fix return code check

6 years agoReturn a handle to the global dictionary context
Arran Cudbard-Bell [Wed, 6 Nov 2019 17:29:06 +0000 (11:29 -0600)] 
Return a handle to the global dictionary context

6 years agoconvert bit test to truth test
Alan T. DeKok [Wed, 6 Nov 2019 17:14:24 +0000 (12:14 -0500)] 
convert bit test to truth test

6 years agoSwitch to compile time check for ASAN
Arran Cudbard-Bell [Wed, 6 Nov 2019 17:09:15 +0000 (11:09 -0600)] 
Switch to compile time check for ASAN

6 years agoFix invalid check
Arran Cudbard-Bell [Wed, 6 Nov 2019 16:59:51 +0000 (10:59 -0600)] 
Fix invalid check

6 years agoRemove unused function
Arran Cudbard-Bell [Wed, 6 Nov 2019 16:12:42 +0000 (10:12 -0600)] 
Remove unused function

6 years agoRemove some instances of fr_hash_table_walk
Arran Cudbard-Bell [Wed, 6 Nov 2019 15:50:54 +0000 (09:50 -0600)] 
Remove some instances of fr_hash_table_walk

6 years agounload dl's, too.
Alan T. DeKok [Wed, 6 Nov 2019 15:21:17 +0000 (10:21 -0500)] 
unload dl's, too.

6 years agofree "autofree" context manually
Alan T. DeKok [Wed, 6 Nov 2019 15:16:33 +0000 (10:16 -0500)] 
free "autofree" context manually

there seems to be issues with calling it automatically via
atexit()

6 years agoset gctx to NULL and check it in more places
Alan T. DeKok [Wed, 6 Nov 2019 15:11:48 +0000 (10:11 -0500)] 
set gctx to NULL and check it in more places

6 years agoset gctx to NULL on free
Alan T. DeKok [Wed, 6 Nov 2019 13:44:27 +0000 (08:44 -0500)] 
set gctx to NULL on free

6 years agoRevert "Use _r variant of basename and dirname"
Arran Cudbard-Bell [Wed, 6 Nov 2019 13:11:14 +0000 (07:11 -0600)] 
Revert "Use _r variant of basename and dirname"

This reverts commit 22599fd332eb13f82923f3401a1780370ac12532.

6 years agoUse _r variant of basename and dirname
Arran Cudbard-Bell [Wed, 6 Nov 2019 12:51:35 +0000 (06:51 -0600)] 
Use _r variant of basename and dirname

6 years agodon't use dirname() or basename(). They are NOT safe.
Alan T. DeKok [Wed, 6 Nov 2019 12:44:42 +0000 (07:44 -0500)] 
don't use dirname() or basename().  They are NOT safe.

6 years agoHelpful to print the fullpath of unit test (#3103)
Jorge Pereira [Tue, 5 Nov 2019 23:23:16 +0000 (20:23 -0300)] 
Helpful to print the fullpath of unit test (#3103)

6 years agolog_dir not logdir
Arran Cudbard-Bell [Tue, 5 Nov 2019 22:50:10 +0000 (16:50 -0600)] 
log_dir not logdir

6 years agoMore fixes...
Arran Cudbard-Bell [Tue, 5 Nov 2019 22:49:04 +0000 (16:49 -0600)] 
More fixes...

6 years agoallow decode of zero-length strings
Alan T. DeKok [Tue, 5 Nov 2019 22:34:06 +0000 (17:34 -0500)] 
allow decode of zero-length strings

6 years agoInclude missing header
Arran Cudbard-Bell [Tue, 5 Nov 2019 22:34:49 +0000 (16:34 -0600)] 
Include missing header

6 years agoRemove rad_mkdir, and the _file from the fr_file functions
Arran Cudbard-Bell [Tue, 5 Nov 2019 22:24:58 +0000 (16:24 -0600)] 
Remove rad_mkdir, and the _file from the fr_file functions

6 years agoUse name not argv[0]
Arran Cudbard-Bell [Tue, 5 Nov 2019 22:03:32 +0000 (16:03 -0600)] 
Use name not argv[0]

6 years agouse TESTBIN which has all of the magic necessary for jlibtool
Alan T. DeKok [Tue, 5 Nov 2019 22:03:11 +0000 (17:03 -0500)] 
use TESTBIN which has all of the magic necessary for jlibtool

6 years agoget rid of stupid "error 0"
Alan T. DeKok [Tue, 5 Nov 2019 21:55:29 +0000 (16:55 -0500)] 
get rid of stupid "error 0"

6 years agoWe only get "waking up" messages at DEBUG4
Arran Cudbard-Bell [Tue, 5 Nov 2019 20:55:29 +0000 (14:55 -0600)] 
We only get "waking up" messages at DEBUG4

6 years agoPrint what we failed to open
Arran Cudbard-Bell [Tue, 5 Nov 2019 20:45:30 +0000 (14:45 -0600)] 
Print what we failed to open

6 years agoAnother typo...
Arran Cudbard-Bell [Tue, 5 Nov 2019 20:36:44 +0000 (14:36 -0600)] 
Another typo...

6 years agoTypo
Arran Cudbard-Bell [Tue, 5 Nov 2019 20:28:16 +0000 (14:28 -0600)] 
Typo

6 years agoPrint what we failed to allocate
Arran Cudbard-Bell [Tue, 5 Nov 2019 20:24:31 +0000 (14:24 -0600)] 
Print what we failed to allocate

6 years agoAdd new top level dict_gctx, fix a bunch of const issues, make dictionaries read...
Arran Cudbard-Bell [Tue, 5 Nov 2019 20:17:25 +0000 (14:17 -0600)] 
Add new top level dict_gctx, fix a bunch of const issues, make dictionaries read only at runtime

6 years agos/coerce/unconst/
Arran Cudbard-Bell [Tue, 5 Nov 2019 18:11:48 +0000 (12:11 -0600)] 
s/coerce/unconst/

6 years agoRename 'alias' to 'name' in the dictionary code
Arran Cudbard-Bell [Tue, 5 Nov 2019 17:59:09 +0000 (11:59 -0600)] 
Rename 'alias' to 'name' in the dictionary code

6 years agoadd and use fr_dict_coerce()
Alan T. DeKok [Tue, 5 Nov 2019 16:57:55 +0000 (11:57 -0500)] 
add and use fr_dict_coerce()

to allow adding attributes to dicts at run time

6 years agoRevert "make more dict functions take const"
Alan T. DeKok [Tue, 5 Nov 2019 16:41:41 +0000 (11:41 -0500)] 
Revert "make more dict functions take const"

This reverts commit 8f063890eb37823f362c22843d2a9db87ebe907f.

6 years agoRevert "this now takes const, too"
Alan T. DeKok [Tue, 5 Nov 2019 16:41:31 +0000 (11:41 -0500)] 
Revert "this now takes const, too"

This reverts commit a26cfed31d81d59e50a5b2df886a8e8daef2f19e.

6 years agomake dict autoload functions take `fr_dict_t const*`
Alan T. DeKok [Tue, 5 Nov 2019 14:37:57 +0000 (09:37 -0500)] 
make dict autoload functions take `fr_dict_t const*`

which changes everything, but trivially.

This is in preparation for adding `fr_dict_t const*` to the
`fr_application_t` struct, so that each proto_foo can point to
the dictionaries that it needs.

6 years agoRemove all the rediculously complex logging code from rlm_unbound
Arran Cudbard-Bell [Tue, 5 Nov 2019 16:42:53 +0000 (10:42 -0600)] 
Remove all the rediculously complex logging code from rlm_unbound

6 years agoFix const issue
Arran Cudbard-Bell [Tue, 5 Nov 2019 16:40:03 +0000 (10:40 -0600)] 
Fix const issue

6 years agoExplicitly free more things
Arran Cudbard-Bell [Tue, 5 Nov 2019 16:10:57 +0000 (10:10 -0600)] 
Explicitly free more things

6 years agodon't use mktemp. We already have the "build" directory
Alan T. DeKok [Tue, 5 Nov 2019 14:34:53 +0000 (09:34 -0500)] 
don't use mktemp.  We already have the "build" directory

6 years agothis now takes const, too
Alan T. DeKok [Tue, 5 Nov 2019 14:25:56 +0000 (09:25 -0500)] 
this now takes const, too

6 years agomake more dict functions take const
Alan T. DeKok [Tue, 5 Nov 2019 14:25:19 +0000 (09:25 -0500)] 
make more dict functions take const

the caller isn't supposed to modify them, but the dict code
can.

6 years agoPacket-Type is in the DHCPv4 dict, not in the RADIUS dict
Alan T. DeKok [Tue, 5 Nov 2019 14:07:08 +0000 (09:07 -0500)] 
Packet-Type is in the DHCPv4 dict, not in the RADIUS dict

6 years agoFix const issue
Arran Cudbard-Bell [Tue, 5 Nov 2019 14:27:54 +0000 (08:27 -0600)] 
Fix const issue

6 years agodon't allow "next" to alias "ref"
Alan T. DeKok [Tue, 5 Nov 2019 02:18:38 +0000 (21:18 -0500)] 
don't allow "next" to alias "ref"

so that group-type attributes can happily coexist with other ones

6 years agofree ctx on error
Alan T. DeKok [Tue, 5 Nov 2019 01:51:10 +0000 (20:51 -0500)] 
free ctx on error

6 years agoAdd support for test dictionaries in unit_test_attribute
Arran Cudbard-Bell [Tue, 5 Nov 2019 01:38:29 +0000 (19:38 -0600)] 
Add support for test dictionaries in unit_test_attribute

6 years agoSkip internal attributes. Non-protocol attributes must also be marked as internal
Arran Cudbard-Bell [Tue, 5 Nov 2019 01:37:29 +0000 (19:37 -0600)] 
Skip internal attributes.  Non-protocol attributes must also be marked as internal

6 years agoAllow dictionary root dir to be manipulated at runtime
Arran Cudbard-Bell [Tue, 5 Nov 2019 01:36:25 +0000 (19:36 -0600)] 
Allow dictionary root dir to be manipulated at runtime

This is to allow us to load test dictionaries

6 years agoAdd space to error message
Arran Cudbard-Bell [Tue, 5 Nov 2019 01:35:58 +0000 (19:35 -0600)] 
Add space to error message

6 years agoMove file manipulation functions into their own source file
Arran Cudbard-Bell [Tue, 5 Nov 2019 01:35:46 +0000 (19:35 -0600)] 
Move file manipulation functions into their own source file

6 years agoallow first member of STRUCT to be variable length
Alan T. DeKok [Tue, 5 Nov 2019 00:59:44 +0000 (19:59 -0500)] 
allow first member of STRUCT to be variable length

it's stupid, but it's what we need for keyed structures

6 years agodepend on the binary, too
Alan T. DeKok [Tue, 5 Nov 2019 00:26:57 +0000 (19:26 -0500)] 
depend on the binary, too

6 years agouse the new test framework
Alan T. DeKok [Mon, 4 Nov 2019 23:59:54 +0000 (18:59 -0500)] 
use the new test framework

and print out the goddamned error messages

6 years agomove RADIUS stubtype stuff to libfreeradius-radius
Alan T. DeKok [Mon, 4 Nov 2019 22:14:28 +0000 (17:14 -0500)] 
move RADIUS stubtype stuff to libfreeradius-radius

6 years agomove dlopen() to load by protocol
Alan T. DeKok [Mon, 4 Nov 2019 22:11:31 +0000 (17:11 -0500)] 
move dlopen() to load by protocol

6 years agomove lowercase to caller
Alan T. DeKok [Mon, 4 Nov 2019 22:01:00 +0000 (17:01 -0500)] 
move lowercase to caller

6 years agostart of autoload and validation for dictionaries.
Alan T. DeKok [Mon, 4 Nov 2019 21:07:56 +0000 (16:07 -0500)] 
start of autoload and validation for dictionaries.

if we load protocol FOO, we now look for libfreeradius-FOO
which *should* already be loaded.  i.e. when the application links
to libfreeradius-radius and calls fr_radius_init(), that function
loads the RADIUS dictionaries.  Which now link back to the library.

The dictionary code then looks for a symbol called

libfreeradius_FOO_dict_protocol

and saves a pointer to that structure in the dictionary.  We can
now have protocol-specific validation functions.

6 years agolowercase library names, and mash '-' to '_'
Alan T. DeKok [Mon, 4 Nov 2019 21:06:30 +0000 (16:06 -0500)] 
lowercase library names, and mash '-' to '_'

6 years agouse talloc_const_free
Alan T. DeKok [Mon, 4 Nov 2019 16:10:31 +0000 (11:10 -0500)] 
use talloc_const_free

6 years agoallow "eap-*" for now.
Alan T. DeKok [Mon, 4 Nov 2019 15:27:20 +0000 (10:27 -0500)] 
allow "eap-*" for now.

it's fugly, but means that we have good errors most of the time.

6 years agoAdd tests for DHCPv6 / rfc8415 (#3100)
Jorge Pereira [Mon, 4 Nov 2019 19:49:06 +0000 (16:49 -0300)] 
Add tests for DHCPv6 / rfc8415 (#3100)

* Add tests for DHCPv6 / rfc8415

* Because fd85:d2bb:92c:GARBAGE DATA HERE:74ae:2871:f56c:8d94 shouldn't match

* Fix file location

6 years agoRevert "All protocols have to have a dictionary." - Until Alan pushes another hack
Arran Cudbard-Bell [Mon, 4 Nov 2019 19:30:36 +0000 (13:30 -0600)] 
Revert "All protocols have to have a dictionary." - Until Alan pushes another hack

This reverts commit 5f90fef77a7f91a3853cb279b3809f5676bb9ba4.

# Conflicts:
# share/dictionary/control/dictionary

6 years agoClean up unit tests more
Arran Cudbard-Bell [Mon, 4 Nov 2019 17:14:06 +0000 (11:14 -0600)] 
Clean up unit tests more

6 years agoOnly one more bad use of vp_strvalue to go...
Arran Cudbard-Bell [Mon, 4 Nov 2019 14:23:27 +0000 (08:23 -0600)] 
Only one more bad use of vp_strvalue to go...

6 years agoalways end the dictionary with a CR / LF
Alan T. DeKok [Mon, 4 Nov 2019 13:56:09 +0000 (08:56 -0500)] 
always end the dictionary with a CR / LF

6 years agoTake a pass through and add MEM() where it should be used, and remove it from the...
Arran Cudbard-Bell [Mon, 4 Nov 2019 13:53:32 +0000 (07:53 -0600)] 
Take a pass through and add MEM() where it should be used, and remove it from the protocol encoder/decoders and utilities

It may be useful to set a size limit on the context we pass to the decoders to prevent an attacker exploiting a logic bug.  In this case we want the decoder to handle the memory allocation failure gracefully.

6 years agoAll protocols have to have a dictionary.
Alan T. DeKok [Mon, 4 Nov 2019 13:42:46 +0000 (08:42 -0500)] 
All protocols have to have a dictionary.

So we add an empty dictionary for the "control" space.

We can later add attributes for packets which are sent to workers.

6 years agoCID 1455235
Arran Cudbard-Bell [Sun, 3 Nov 2019 19:41:59 +0000 (13:41 -0600)] 
CID 1455235

6 years agoCID 1455236
Arran Cudbard-Bell [Sun, 3 Nov 2019 19:41:02 +0000 (13:41 -0600)] 
CID 1455236

6 years agoCID 1455238
Arran Cudbard-Bell [Sun, 3 Nov 2019 19:37:36 +0000 (13:37 -0600)] 
CID 1455238

6 years agoCID 1455239
Arran Cudbard-Bell [Sun, 3 Nov 2019 19:36:36 +0000 (13:36 -0600)] 
CID 1455239

6 years agoTypo
Arran Cudbard-Bell [Sun, 3 Nov 2019 19:34:54 +0000 (13:34 -0600)] 
Typo

6 years agoCID 1455245
Arran Cudbard-Bell [Sun, 3 Nov 2019 19:34:10 +0000 (13:34 -0600)] 
CID 1455245

6 years agoCID 1455246
Arran Cudbard-Bell [Sun, 3 Nov 2019 19:28:56 +0000 (13:28 -0600)] 
CID 1455246

6 years agoCID 1455229
Arran Cudbard-Bell [Sun, 3 Nov 2019 19:24:59 +0000 (13:24 -0600)] 
CID 1455229

6 years agoCID 1455232
Arran Cudbard-Bell [Sun, 3 Nov 2019 19:23:27 +0000 (13:23 -0600)] 
CID 1455232