]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
2 years agoldap: Return the result code from the LDAP operation in rlm_ldap_map_profile instead...
Arran Cudbard-Bell [Wed, 6 Sep 2023 03:57:16 +0000 (21:57 -0600)] 
ldap: Return the result code from the LDAP operation in rlm_ldap_map_profile instead of messing with the rcode

2 years agoldap: Make type names more explicit
Arran Cudbard-Bell [Wed, 6 Sep 2023 03:42:54 +0000 (21:42 -0600)] 
ldap: Make type names more explicit

2 years agoldap: Replace confusing macro with static inline
Arran Cudbard-Bell [Wed, 6 Sep 2023 03:40:55 +0000 (21:40 -0600)] 
ldap: Replace confusing macro with static inline

2 years agoSplit out and abstract ldap profile code
Arran Cudbard-Bell [Tue, 5 Sep 2023 22:08:42 +0000 (16:08 -0600)] 
Split out and abstract ldap profile code

2 years agoalso use local libraries for unit tests
Alan T. DeKok [Tue, 5 Sep 2023 22:09:50 +0000 (18:09 -0400)] 
also use local libraries for unit tests

2 years agoInitialise more boxes correctly
Arran Cudbard-Bell [Tue, 5 Sep 2023 21:19:12 +0000 (15:19 -0600)] 
Initialise more boxes correctly

2 years agoRevert "always call fr_pair_tlvs_from_network() as nested"
Alan T. DeKok [Tue, 5 Sep 2023 19:48:43 +0000 (15:48 -0400)] 
Revert "always call fr_pair_tlvs_from_network() as nested"

This reverts commit 53d37c2b16802920a6d6ebcba568859e48dc5789.

2 years agoupdate tests, too
Alan T. DeKok [Tue, 5 Sep 2023 19:29:39 +0000 (15:29 -0400)] 
update tests, too

2 years agothis is now nested
Alan T. DeKok [Tue, 5 Sep 2023 18:59:28 +0000 (14:59 -0400)] 
this is now nested

2 years agoalways call fr_pair_tlvs_from_network() as nested
Alan T. DeKok [Tue, 5 Sep 2023 17:59:27 +0000 (13:59 -0400)] 
always call fr_pair_tlvs_from_network() as nested

2 years agoalways call fr_pair_tlvs_from_network() as nested
Alan T. DeKok [Tue, 5 Sep 2023 17:56:19 +0000 (13:56 -0400)] 
always call fr_pair_tlvs_from_network() as nested

2 years agomore peephole optimizations for logical operations
Alan T. DeKok [Tue, 5 Sep 2023 17:38:34 +0000 (13:38 -0400)] 
more peephole optimizations for logical operations

2 years agomark up "@todo" with more comments and classifications
Alan T. DeKok [Tue, 5 Sep 2023 17:35:20 +0000 (13:35 -0400)] 
mark up "@todo" with more comments and classifications

2 years agodecode DHCPv6 structs as nested
Alan T. DeKok [Tue, 5 Sep 2023 17:18:29 +0000 (13:18 -0400)] 
decode DHCPv6 structs as nested

2 years agoset mutable recursively
Alan T. DeKok [Tue, 5 Sep 2023 16:55:56 +0000 (12:55 -0400)] 
set mutable recursively

2 years agotypo
Alan T. DeKok [Tue, 5 Sep 2023 16:55:41 +0000 (12:55 -0400)] 
typo

2 years agoRemove unused variable
Nick Porter [Tue, 5 Sep 2023 16:00:18 +0000 (17:00 +0100)] 
Remove unused variable

2 years agoReconnect trunk connection if the error is FR_LDAP_BAD_CONN
Nick Porter [Tue, 5 Sep 2023 13:10:35 +0000 (14:10 +0100)] 
Reconnect trunk connection if the error is FR_LDAP_BAD_CONN

2 years agoCorrect passing of fr_ldap_connection_t in async functions
Nick Porter [Tue, 5 Sep 2023 11:22:09 +0000 (12:22 +0100)] 
Correct passing of fr_ldap_connection_t in async functions

The comment about changing the connection due to auto re-connect is
wrong - that was the old sync code behaviour.

2 years agoUse standard routine to proces LDAP errors
Nick Porter [Tue, 5 Sep 2023 11:02:29 +0000 (12:02 +0100)] 
Use standard routine to proces LDAP errors

Allows distinguishing between e.g. syntax errors and connection errors.

2 years agoHandle LDAP query result codes correctly
Nick Porter [Tue, 5 Sep 2023 09:53:32 +0000 (10:53 +0100)] 
Handle LDAP query result codes correctly

2 years agoAdd callback to tidy up if LDAP trunk requests fail
Nick Porter [Tue, 5 Sep 2023 15:40:04 +0000 (16:40 +0100)] 
Add callback to tidy up if LDAP trunk requests fail

2 years agonotes on future peephole optimization
Alan T. DeKok [Tue, 5 Sep 2023 14:19:50 +0000 (10:19 -0400)] 
notes on future peephole optimization

2 years agopass in the correct operator
Alan T. DeKok [Tue, 5 Sep 2023 14:18:53 +0000 (10:18 -0400)] 
pass in the correct operator

2 years agoif aavailable, check the enum name at parse time
Alan T. DeKok [Tue, 5 Sep 2023 13:37:04 +0000 (09:37 -0400)] 
if aavailable, check the enum name at parse time

2 years agoonly set fixed length for leaf types which have fixed length
Alan T. DeKok [Tue, 5 Sep 2023 13:36:39 +0000 (09:36 -0400)] 
only set fixed length for leaf types which have fixed length

2 years agomake sure the value-box is initialized
Alan T. DeKok [Tue, 5 Sep 2023 13:30:22 +0000 (09:30 -0400)] 
make sure the value-box is initialized

2 years agoIf we have a LHS leaf, pass it to the RHS tmpl parser
Alan T. DeKok [Mon, 4 Sep 2023 19:54:14 +0000 (15:54 -0400)] 
If we have a LHS leaf, pass it to the RHS tmpl parser

which means that we catch more load-time errors for typos in
the configuration files.

and add test case.

The RHS resolution is done in pass2, so there's no issue with an
enum name being defined after the configuration files have been read.

2 years agoadd unknown only if the LHS is unknown
Alan T. DeKok [Mon, 4 Sep 2023 19:50:10 +0000 (15:50 -0400)] 
add unknown only if the LHS is unknown

and assert that the LHS is an attribute, which it should be for
being a bare word

2 years agouse attr_net_*, and suppress Net.* if they exist in the list
Alan T. DeKok [Mon, 4 Sep 2023 17:23:33 +0000 (13:23 -0400)] 
use attr_net_*, and suppress Net.* if they exist in the list

2 years agoAdd ldap test using SASL proxy authorization for admin bind
Nick Porter [Tue, 5 Sep 2023 08:11:52 +0000 (09:11 +0100)] 
Add ldap test using SASL proxy authorization for admin bind

2 years agoPacify coverity
Nick Porter [Tue, 5 Sep 2023 07:17:48 +0000 (08:17 +0100)] 
Pacify coverity

2 years agoInitialise box in rest.c
Arran Cudbard-Bell [Mon, 4 Sep 2023 22:15:10 +0000 (16:15 -0600)] 
Initialise box in rest.c

2 years agoInitialise output sbuff in unit_test_module
Arran Cudbard-Bell [Mon, 4 Sep 2023 22:14:37 +0000 (16:14 -0600)] 
Initialise output sbuff in unit_test_module

2 years agoExplicitly initialise all value boxes with a magic constant
Arran Cudbard-Bell [Mon, 4 Sep 2023 20:42:25 +0000 (14:42 -0600)] 
Explicitly initialise all value boxes with a magic constant

This lets all the assignment tests assume boxes are in an initialised and sane state, and NOT blindly overwrite all the flags

2 years agoPrint _WHICH_ initialiser failed
Arran Cudbard-Bell [Mon, 4 Sep 2023 20:34:38 +0000 (14:34 -0600)] 
Print _WHICH_ initialiser failed

2 years agoRemaining Packet-* -> Net.*
Nick Porter [Mon, 4 Sep 2023 18:39:00 +0000 (19:39 +0100)] 
Remaining Packet-* -> Net.*

2 years agoclean ups
Alan T. DeKok [Mon, 4 Sep 2023 16:50:46 +0000 (12:50 -0400)] 
clean ups

add nonnull for parameters.  Don't use "vpt" for value-boxes,
as that variable name is used elsewhere for tmpls

2 years agomake static analysis happy by initializing fields
Alan T. DeKok [Mon, 4 Sep 2023 16:50:32 +0000 (12:50 -0400)] 
make static analysis happy by initializing fields

2 years agoTMPL_TYPE_UNRESOLVED -> TMPL_TYPE_DATA_UNRESOLVED
Alan T. DeKok [Mon, 4 Sep 2023 15:14:16 +0000 (11:14 -0400)] 
TMPL_TYPE_UNRESOLVED -> TMPL_TYPE_DATA_UNRESOLVED

just to make it clear that the tmpl contains something which will
be resolved to data, and not to an xlat, exec, attr, etc.

This is part of the enum cleanups, where we will allow the following
as enum names:

::Foo
'Foo'
"Foo"

but not

Foo

Which will eventually be interpreted as an attribute reference.

2 years agoPacket-* -> Net.* in rlm_detail
Nick Porter [Mon, 4 Sep 2023 15:32:23 +0000 (16:32 +0100)] 
Packet-* -> Net.* in rlm_detail

2 years agoto_cast is not always talloced
Nick Porter [Mon, 4 Sep 2023 15:02:18 +0000 (16:02 +0100)] 
to_cast is not always talloced

2 years agoattribute tmpls can only be bare words
Alan T. DeKok [Mon, 4 Sep 2023 14:57:15 +0000 (10:57 -0400)] 
attribute tmpls can only be bare words

2 years agomove enum parsing to it's own function (mostly)
Alan T. DeKok [Mon, 4 Sep 2023 13:25:36 +0000 (09:25 -0400)] 
move enum parsing to it's own function (mostly)

There are still corner cases to resolve, as noted in the comments

2 years agoCorrect return value
Nick Porter [Mon, 4 Sep 2023 13:39:03 +0000 (14:39 +0100)] 
Correct return value

2 years agowe have talloc destructors, so fewer explicit free()s are necessary
Alan T. DeKok [Mon, 4 Sep 2023 12:17:39 +0000 (08:17 -0400)] 
we have talloc destructors, so fewer explicit free()s are necessary

and rearrange some of the code in the unlang initialization
routines, so that everything is cleaned up on error, or on clean
exit.

2 years agominimize scope of "to_free" variable
Alan T. DeKok [Mon, 4 Sep 2023 11:48:46 +0000 (07:48 -0400)] 
minimize scope of "to_free" variable

2 years agoremove unused label
Alan T. DeKok [Mon, 4 Sep 2023 11:28:26 +0000 (07:28 -0400)] 
remove unused label

2 years agoldap: Missing at runtime flag
Arran Cudbard-Bell [Mon, 4 Sep 2023 10:00:19 +0000 (04:00 -0600)] 
ldap: Missing at runtime flag

2 years agoTypo
Arran Cudbard-Bell [Mon, 4 Sep 2023 09:30:43 +0000 (03:30 -0600)] 
Typo

2 years agoldap: Make profile search scope configurable
Arran Cudbard-Bell [Mon, 4 Sep 2023 09:00:06 +0000 (03:00 -0600)] 
ldap: Make profile search scope configurable

... because reasons.

2 years agoldap: Add regression test for filter that was causing crash
Arran Cudbard-Bell [Mon, 4 Sep 2023 05:33:07 +0000 (23:33 -0600)] 
ldap: Add regression test for filter that was causing crash

...but has mysteriously fixed itself

2 years agovalue: Check talloc buffers are the right length
Arran Cudbard-Bell [Mon, 4 Sep 2023 05:32:35 +0000 (23:32 -0600)] 
value: Check talloc buffers are the right length

2 years agomark up unused variable
Alan T. DeKok [Mon, 4 Sep 2023 01:51:47 +0000 (21:51 -0400)] 
mark up unused variable

2 years ago"out" is a C data type, not a value-box
Alan T. DeKok [Mon, 4 Sep 2023 01:30:26 +0000 (21:30 -0400)] 
"out" is a C data type, not a value-box

2 years agoremove flags.virtual from the dictionaries
Alan T. DeKok [Mon, 4 Sep 2023 01:10:02 +0000 (21:10 -0400)] 
remove flags.virtual from the dictionaries

all attributes are now realized.

2 years agoremove Packet-*, these are no longer used anywhere
Alan T. DeKok [Sun, 3 Sep 2023 16:45:28 +0000 (12:45 -0400)] 
remove Packet-*, these are no longer used anywhere

2 years agoShould still pass ctx to fr_value_box_bstrndup
Arran Cudbard-Bell [Sun, 3 Sep 2023 21:53:32 +0000 (15:53 -0600)] 
Should still pass ctx to fr_value_box_bstrndup

2 years agoMark boxes up as talloced
Arran Cudbard-Bell [Sun, 3 Sep 2023 21:47:01 +0000 (15:47 -0600)] 
Mark boxes up as talloced

2 years agoVerify output of expr functions
Arran Cudbard-Bell [Sun, 3 Sep 2023 17:12:42 +0000 (11:12 -0600)] 
Verify output of expr functions

2 years agoxlat: Verify output of select xlat functions
Arran Cudbard-Bell [Sun, 3 Sep 2023 17:12:29 +0000 (11:12 -0600)] 
xlat: Verify output of select xlat functions

2 years agotmpl: Verify output of all tmpl functions
Arran Cudbard-Bell [Sun, 3 Sep 2023 17:12:10 +0000 (11:12 -0600)] 
tmpl: Verify output of all tmpl functions

2 years agoFormatting
Arran Cudbard-Bell [Sun, 3 Sep 2023 17:11:04 +0000 (11:11 -0600)] 
Formatting

2 years agoxlat: Alternate doesn't have format strings anymore
Arran Cudbard-Bell [Sun, 3 Sep 2023 17:10:50 +0000 (11:10 -0600)] 
xlat: Alternate doesn't have format strings anymore

2 years agovalue_box: Record where the boxes were allocated or initialised in debug builds
Arran Cudbard-Bell [Sun, 3 Sep 2023 17:09:57 +0000 (11:09 -0600)] 
value_box: Record where the boxes were allocated or initialised in debug builds

2 years agoFix a large number of invalid ctx uses in fr_value_box* functions
Arran Cudbard-Bell [Sun, 3 Sep 2023 17:09:28 +0000 (11:09 -0600)] 
Fix a large number of invalid ctx uses in fr_value_box* functions

2 years agoRemove virtual attribute callbacks for Packet-*
Jorge Pereira [Fri, 1 Sep 2023 04:01:54 +0000 (01:01 -0300)] 
Remove virtual attribute callbacks for Packet-*

As the tmpl_eval_pair_virtual() is only for the deprecated Packet-*
attribtues. then, it should be fine drop the entire statement.

2 years agothere's overlap between ::1 and ::Framed-User
Alan T. DeKok [Sun, 3 Sep 2023 13:49:25 +0000 (09:49 -0400)] 
there's overlap between ::1 and ::Framed-User

We'll have to think about that a bit more, but "::" is still
fairly reasonable

2 years agoMove more Packet-* to Net.*
Alan T. DeKok [Sun, 3 Sep 2023 13:03:55 +0000 (09:03 -0400)] 
Move more Packet-* to Net.*

2 years agoallow ::name for enum names
Alan T. DeKok [Sun, 3 Sep 2023 12:59:36 +0000 (08:59 -0400)] 
allow ::name for enum names

2 years agodon't do stupid things on error
Alan T. DeKok [Sat, 2 Sep 2023 17:12:55 +0000 (13:12 -0400)] 
don't do stupid things on error

return how many attributes we moved.  Ignore attributes we
didn't create.  Don't add up error codes (???)

Note that the Perl module does NOT do nested attributes.  And it
does NOT do nested attributes, or even flat attributes which have
parents such as Vendor-Specific.AVPair.  Instead, it puts the tail
attribute into its hash, and then can't find that attribute in the
root dictionary

2 years agoRevert "as a temporary hack, just skip the LDAP tests"
Arran Cudbard-Bell [Sat, 2 Sep 2023 16:39:31 +0000 (10:39 -0600)] 
Revert "as a temporary hack, just skip the LDAP tests"

This reverts commit 031246dbe0235f462f1b0d11a02a10c27474f111.

2 years agoldap: More fixes
Arran Cudbard-Bell [Sat, 2 Sep 2023 16:22:33 +0000 (10:22 -0600)] 
ldap: More fixes

Seems like we hang on an improperly configured LDAP instance with SSL

2 years agomake Net.* mutable for tests, and delete them in json.encode
Alan T. DeKok [Sat, 2 Sep 2023 14:14:40 +0000 (10:14 -0400)] 
make Net.* mutable for tests, and delete them in json.encode

2 years agoas a temporary hack, just skip the LDAP tests
Alan T. DeKok [Sat, 2 Sep 2023 13:48:40 +0000 (09:48 -0400)] 
as a temporary hack, just skip the LDAP tests

this lets us move forward verifying that the other changes
don't break CI

2 years agoremove old paircmp() tests
Alan T. DeKok [Sat, 2 Sep 2023 13:46:49 +0000 (09:46 -0400)] 
remove old paircmp() tests

2 years agoremove unused references to port
Alan T. DeKok [Sat, 2 Sep 2023 13:41:37 +0000 (09:41 -0400)] 
remove unused references to port

2 years agoPacket-Dst-IP-Address --> Net.Dst.IP
Alan T. DeKok [Sat, 2 Sep 2023 13:39:36 +0000 (09:39 -0400)] 
Packet-Dst-IP-Address --> Net.Dst.IP

2 years agothis should be nested, too
Alan T. DeKok [Sat, 2 Sep 2023 13:37:55 +0000 (09:37 -0400)] 
this should be nested, too

2 years agoforce it
Alan T. DeKok [Sat, 2 Sep 2023 13:22:59 +0000 (09:22 -0400)] 
force it

2 years ago!* is so v3. We do v4 now.
Alan T. DeKok [Sat, 2 Sep 2023 13:17:44 +0000 (09:17 -0400)] 
!* is so v3.  We do v4 now.

2 years agomove to Net.*
Alan T. DeKok [Sat, 2 Sep 2023 13:05:39 +0000 (09:05 -0400)] 
move to Net.*

2 years agomove to using Net.* instead of Packet-*
Alan T. DeKok [Sat, 2 Sep 2023 12:57:31 +0000 (08:57 -0400)] 
move to using Net.* instead of Packet-*

2 years agoremove Packet-* from module configuration
Alan T. DeKok [Sat, 2 Sep 2023 12:44:17 +0000 (08:44 -0400)] 
remove Packet-* from module configuration

2 years agoallow for per-module dictionaries
Alan T. DeKok [Sat, 2 Sep 2023 12:44:00 +0000 (08:44 -0400)] 
allow for per-module dictionaries

2 years agore-realize Net.*
Alan T. DeKok [Sat, 2 Sep 2023 12:41:01 +0000 (08:41 -0400)] 
re-realize Net.*

and update the pairs test so we don't need to look at Net.*

2 years agoFix 'join' keyword test
Jorge Pereira [Fri, 1 Sep 2023 19:20:38 +0000 (16:20 -0300)] 
Fix 'join' keyword test

now that unit_test_module creates Net.*. the test output has
changed.  So we update the test.

2 years agoFix 'concat' keyword test
Jorge Pereira [Fri, 1 Sep 2023 19:13:51 +0000 (16:13 -0300)] 
Fix 'concat' keyword test

2 years agoldap: Setup script fixes
Arran Cudbard-Bell [Fri, 1 Sep 2023 23:33:12 +0000 (17:33 -0600)] 
ldap: Setup script fixes

Don't duplicate the ENTIRE script just to start a second LDAP instance.  Add paths for homebrew on ARM.  Kill existing slapd instances so we don't get errors about the database already existing.

ff

2 years agoldap: Just because there's a problem with group membership DOES NOT mean we should...
Arran Cudbard-Bell [Fri, 1 Sep 2023 23:31:53 +0000 (17:31 -0600)] 
ldap: Just because there's a problem with group membership DOES NOT mean we should return notfound

2 years agoldap: Add support for custom access attribute negation values
Arran Cudbard-Bell [Fri, 1 Sep 2023 01:04:03 +0000 (19:04 -0600)] 
ldap: Add support for custom access attribute negation values

Add support for using different profiles when the user is suspended, which is extremely common where suspension will place a user in a walled garden state.

2 years agoremove unused label
Alan T. DeKok [Fri, 1 Sep 2023 19:32:50 +0000 (15:32 -0400)] 
remove unused label

2 years agowe don't test detail here
Alan T. DeKok [Fri, 1 Sep 2023 17:09:58 +0000 (13:09 -0400)] 
we don't test detail here

2 years agowe don't test the detail module here
Alan T. DeKok [Fri, 1 Sep 2023 17:08:33 +0000 (13:08 -0400)] 
we don't test the detail module here

2 years agothis test doesn't need EAP
Alan T. DeKok [Fri, 1 Sep 2023 15:14:35 +0000 (11:14 -0400)] 
this test doesn't need EAP

2 years agothis test doesn't need accounting
Alan T. DeKok [Fri, 1 Sep 2023 15:14:06 +0000 (11:14 -0400)] 
this test doesn't need accounting

2 years agothese tests don't have to be Packet-Src-*
Alan T. DeKok [Fri, 1 Sep 2023 15:10:05 +0000 (11:10 -0400)] 
these tests don't have to be Packet-Src-*

2 years agomake unit_test_module use Net.*
Alan T. DeKok [Fri, 1 Sep 2023 15:09:53 +0000 (11:09 -0400)] 
make unit_test_module use Net.*

and update the xlat tests to match

2 years agomake radclient use Net.*
Alan T. DeKok [Fri, 1 Sep 2023 14:03:52 +0000 (10:03 -0400)] 
make radclient use Net.*

2 years agomake dhcpclient use Net.*
Alan T. DeKok [Fri, 1 Sep 2023 14:08:57 +0000 (10:08 -0400)] 
make dhcpclient use Net.*