]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
2 years agoNo need for extra escaping now
Nick Porter [Fri, 22 Sep 2023 12:27:34 +0000 (13:27 +0100)] 
No need for extra escaping now

The `program` option is always parsed as T_BACK_QUOTED_STRING

2 years agoUse call_env for rlm_exec
Nick Porter [Wed, 13 Sep 2023 15:08:02 +0000 (16:08 +0100)] 
Use call_env for rlm_exec

2 years agoAllow call_env to force quoting when parsing tmpls
Nick Porter [Wed, 13 Sep 2023 15:06:43 +0000 (16:06 +0100)] 
Allow call_env to force quoting when parsing tmpls

2 years agoWhitespace
Nick Porter [Wed, 13 Sep 2023 12:59:59 +0000 (13:59 +0100)] 
Whitespace

2 years agotypo
Alan T. DeKok [Mon, 25 Sep 2023 13:30:23 +0000 (09:30 -0400)] 
typo

2 years agomore notes on what doesn't work in v4
Alan T. DeKok [Mon, 25 Sep 2023 13:29:01 +0000 (09:29 -0400)] 
more notes on what doesn't work in v4

2 years agodocument new dictionary section
Alan T. DeKok [Mon, 25 Sep 2023 12:29:17 +0000 (08:29 -0400)] 
document new dictionary section

2 years agoallow for values too
Alan T. DeKok [Mon, 25 Sep 2023 12:21:31 +0000 (08:21 -0400)] 
allow for values too

this isn't quite a duplicate of the dictionary code, as it allows
the "local" dictionaries to be included with the virtual server.

We can always define a new configuration entry:

filename = ...

which loads dictionary entries from the given filename.

However, that SHOULD have a number of limitations:

* only DEFINE is allowed.  No ATTRIBUTE or PROTO
  The user shouldn't be tracking numbers

* no struct / vendor / vsa data types

* allow VALUEs

At some point in the future, we may allow server-specific _protocol_
attributes.  But that would require updating the encoders to look
for dictionaries by number, and not by cached fr_dict_t

2 years agoPlacate clang scan
Nick Porter [Mon, 25 Sep 2023 08:18:18 +0000 (09:18 +0100)] 
Placate clang scan

2 years agodelete all matchine local variables
Alan T. DeKok [Mon, 25 Sep 2023 00:23:31 +0000 (20:23 -0400)] 
delete all matchine local variables

they can be created in any order, so we can't rely on just checking
the tail

2 years agodictionaries in virtual servers are internal, but not local
Alan T. DeKok [Mon, 25 Sep 2023 00:21:34 +0000 (20:21 -0400)] 
dictionaries in virtual servers are internal, but not local

2 years agostupid compiler
Alan T. DeKok [Mon, 25 Sep 2023 00:21:15 +0000 (20:21 -0400)] 
stupid compiler

2 years agoallow local dictionaries to define TLVs
Alan T. DeKok [Sun, 24 Sep 2023 23:49:09 +0000 (19:49 -0400)] 
allow local dictionaries to define TLVs

2 years agoallow TLVs for local dictionary definitions
Alan T. DeKok [Sun, 24 Sep 2023 23:48:01 +0000 (19:48 -0400)] 
allow TLVs for local dictionary definitions

2 years agoallow local varibles to be structured (e.g. tlv)
Alan T. DeKok [Sun, 24 Sep 2023 23:47:36 +0000 (19:47 -0400)] 
allow local varibles to be structured (e.g. tlv)

2 years agoallow local variables in case, but not in switch
Alan T. DeKok [Sun, 24 Sep 2023 14:31:46 +0000 (10:31 -0400)] 
allow local variables in case, but not in switch

2 years agostupid compiler doesn't catch issues
Alan T. DeKok [Sun, 24 Sep 2023 14:14:17 +0000 (10:14 -0400)] 
stupid compiler doesn't catch issues

2 years agowhitespace
Alan T. DeKok [Sun, 24 Sep 2023 13:59:15 +0000 (09:59 -0400)] 
whitespace

2 years agolocal dictionaries. too
Alan T. DeKok [Sun, 24 Sep 2023 13:58:53 +0000 (09:58 -0400)] 
local dictionaries. too

2 years agoif we have local dict, look up next by name, too
Alan T. DeKok [Sun, 24 Sep 2023 13:49:55 +0000 (09:49 -0400)] 
if we have local dict, look up next by name, too

2 years agomark up local dictionaries as local
Alan T. DeKok [Sun, 24 Sep 2023 13:49:24 +0000 (09:49 -0400)] 
mark up local dictionaries as local

and try harder to avoid number overlaps

2 years agotest that local variables can be expanded
Alan T. DeKok [Sun, 24 Sep 2023 13:45:45 +0000 (09:45 -0400)] 
test that local variables can be expanded

2 years agoadd fr_dict_t to the top-level CONF_SECTION
Alan T. DeKok [Sun, 24 Sep 2023 12:32:42 +0000 (08:32 -0400)] 
add fr_dict_t to the top-level CONF_SECTION

2 years agodon't use update, and do use local variables
Alan T. DeKok [Sun, 24 Sep 2023 12:04:51 +0000 (08:04 -0400)] 
don't use update, and do use local variables

2 years agoword smithing
Alan T. DeKok [Sat, 23 Sep 2023 13:30:53 +0000 (09:30 -0400)] 
word smithing

2 years agopretty much all of this is done
Alan T. DeKok [Sat, 23 Sep 2023 13:29:35 +0000 (09:29 -0400)] 
pretty much all of this is done

2 years agoFix Antora examples to not use update
Jorge Pereira [Sat, 23 Sep 2023 01:02:32 +0000 (22:02 -0300)] 
Fix Antora examples to not use update

2 years agooops. Let's delete typos
Alan T. DeKok [Sat, 23 Sep 2023 12:09:35 +0000 (08:09 -0400)] 
oops.  Let's delete typos

2 years agocreate local variable list, and put local variables into it
Alan T. DeKok [Sat, 23 Sep 2023 11:55:45 +0000 (07:55 -0400)] 
create local variable list, and put local variables into it

2 years agodocumentation for local variables
Alan T. DeKok [Mon, 28 Nov 2022 20:05:19 +0000 (15:05 -0500)] 
documentation for local variables

2 years agobrute-force delete local variables when leaving scope
Alan T. DeKok [Thu, 21 Sep 2023 21:51:00 +0000 (17:51 -0400)] 
brute-force delete local variables when leaving scope

we will later move them to their own list, which will help a lot.

2 years agoadd function to iterate over only the leaf nodes
Alan T. DeKok [Thu, 21 Sep 2023 18:06:12 +0000 (14:06 -0400)] 
add function to iterate over only the leaf nodes

so that python, perl, detail, etc. can still work with "flat"
things

2 years agoensure frame->retry doesn't leave a dangling pointer
Alan T. DeKok [Wed, 20 Sep 2023 21:07:37 +0000 (17:07 -0400)] 
ensure frame->retry doesn't leave a dangling pointer

2 years agomaps cannot have local variables
Alan T. DeKok [Wed, 20 Sep 2023 21:05:03 +0000 (17:05 -0400)] 
maps cannot have local variables

because the underlying map doesn't deal well with them :(

2 years agoenforce locations for local variables, and use correct t_rules
Alan T. DeKok [Wed, 20 Sep 2023 21:04:13 +0000 (17:04 -0400)] 
enforce locations for local variables, and use correct t_rules

2 years agoadd and use unlang_interpret_push_children()
Alan T. DeKok [Wed, 20 Sep 2023 20:51:14 +0000 (16:51 -0400)] 
add and use unlang_interpret_push_children()

which pushes the children of the current frame.  This wrapper
function simplifies a bunch of keyword code.

subrequest does not use this, as it pushes another frame
before pushing the children.  Perhaps that should instead be a
resume function?

2 years agomake sure that the section with local variables is run
Alan T. DeKok [Wed, 20 Sep 2023 20:46:04 +0000 (16:46 -0400)] 
make sure that the section with local variables is run

2 years agocannot delete local variables
Alan T. DeKok [Wed, 20 Sep 2023 19:45:44 +0000 (15:45 -0400)] 
cannot delete local variables

2 years agomove variables to unlang_group_t
Alan T. DeKok [Fri, 9 Dec 2022 19:30:44 +0000 (14:30 -0500)] 
move variables to unlang_group_t

so that they can all be defined when the group is entered, and
cleaned up when the group leaves.

This also allows the variables to be used in statements such as
"switch" or "load-balance"

2 years agoadd "local" flag to attributes and glue into tmpl parser
Alan T. DeKok [Mon, 28 Nov 2022 00:23:10 +0000 (19:23 -0500)] 
add "local" flag to attributes and glue into tmpl parser

they current are put into the request list, due to the tmpl
code not supporting PAIR_LIST_ROOT.  As the PAIR_LIST will be
going away soon

2 years agoDetermine number of workers if value is set to zero
Arran Cudbard-Bell [Sat, 23 Sep 2023 04:02:31 +0000 (00:02 -0400)] 
Determine number of workers if value is set to zero

2 years agoci: Check nested attributes are created correctly from LDAP attriubtes
Nick Porter [Fri, 22 Sep 2023 15:14:33 +0000 (16:14 +0100)] 
ci: Check nested attributes are created correctly from LDAP attriubtes

2 years agoUse map_to_request in place of map_to_vp to handle nested attributes
Nick Porter [Fri, 22 Sep 2023 15:13:40 +0000 (16:13 +0100)] 
Use map_to_request in place of map_to_vp to handle nested attributes

This allows for nested attributes to be handled in the rlm_ldap module
update map such that

update {
&control += "radiusControlAttribute"
}

with a directory entry containting

radiusControlAttribute: Vendor-Specific.Cisco.AVPair += 'foo=bar'

will result in the correct nested structure being built.

2 years agoHandle possilble snprintf value truncation
Nick Porter [Fri, 22 Sep 2023 14:44:59 +0000 (15:44 +0100)] 
Handle possilble snprintf value truncation

2 years agoci: Use different data in each LDAP user profile
Nick Porter [Fri, 22 Sep 2023 12:59:27 +0000 (13:59 +0100)] 
ci: Use different data in each LDAP user profile

So we are sure the right thing happened

2 years agoldap: Add debug level 3 summary of search results
Nick Porter [Fri, 22 Sep 2023 12:34:37 +0000 (13:34 +0100)] 
ldap: Add debug level 3 summary of search results

2 years agoTainted data doesn't work here
Nick Porter [Fri, 22 Sep 2023 09:19:36 +0000 (10:19 +0100)] 
Tainted data doesn't work here

- the escape function expects a URI, not just a DN
- escaping cn= makes cn\3d - so the DN becomes invalid

2 years agoPrint errors when LDAP URI fails to escape
Nick Porter [Fri, 22 Sep 2023 09:08:05 +0000 (10:08 +0100)] 
Print errors when LDAP URI fails to escape

2 years agoxlat: Switch base64 functions to final form
Arran Cudbard-Bell [Thu, 21 Sep 2023 20:31:37 +0000 (16:31 -0400)] 
xlat: Switch base64 functions to final form

2 years agoAdd exec test which uses xlat function in its arguments
Nick Porter [Thu, 21 Sep 2023 11:10:00 +0000 (12:10 +0100)] 
Add exec test which uses xlat function in its arguments

2 years agoBootstrap xlats produced when parsing TMPL_TYPE_EXEC tmpls
Nick Porter [Thu, 21 Sep 2023 11:07:48 +0000 (12:07 +0100)] 
Bootstrap xlats produced when parsing TMPL_TYPE_EXEC tmpls

2 years agoBetter comment for LDAP profile xlat
Nick Porter [Thu, 21 Sep 2023 16:30:39 +0000 (17:30 +0100)] 
Better comment for LDAP profile xlat

2 years agoRe-enable ldap_sync tests and improve error reporting
Nick Porter [Thu, 21 Sep 2023 09:33:02 +0000 (10:33 +0100)] 
Re-enable ldap_sync tests and improve error reporting

2 years agoCorrect expansion of LDAP attributes
Nick Porter [Thu, 21 Sep 2023 08:29:14 +0000 (09:29 +0100)] 
Correct expansion of LDAP attributes

2 years agoldap: Fix process the generic attribute in profiles
Arran Cudbard-Bell [Wed, 20 Sep 2023 23:17:45 +0000 (19:17 -0400)] 
ldap: Fix process the generic attribute in profiles

2 years agoAdd radiusProfileSuspendedDN
Arran Cudbard-Bell [Wed, 20 Sep 2023 19:06:26 +0000 (15:06 -0400)] 
Add radiusProfileSuspendedDN

2 years agouse the correct list
Alan T. DeKok [Wed, 20 Sep 2023 00:47:37 +0000 (20:47 -0400)] 
use the correct list

2 years agodon't write to buffer we're reading from
Alan T. DeKok [Wed, 20 Sep 2023 00:25:33 +0000 (20:25 -0400)] 
don't write to buffer we're reading from

2 years ago"original" CONF_PAIR always exists
Alan T. DeKok [Wed, 20 Sep 2023 00:19:45 +0000 (20:19 -0400)] 
"original" CONF_PAIR always exists

2 years agoaddress more corner cases as caught by the keyword tests
Alan T. DeKok [Tue, 19 Sep 2023 22:01:52 +0000 (18:01 -0400)] 
address more corner cases as caught by the keyword tests

2 years agofix rewrite_update and add debug
Alan T. DeKok [Tue, 19 Sep 2023 20:42:46 +0000 (16:42 -0400)] 
fix rewrite_update and add debug

we likely need more tests for rewrite_update.

But it now prints out in debug mode how to convert from an "update"
entry to an edit section.

2 years agonote that RHS of edits can now be expressions
Alan T. DeKok [Tue, 19 Sep 2023 20:42:08 +0000 (16:42 -0400)] 
note that RHS of edits can now be expressions

2 years agoword smithing
Alan T. DeKok [Tue, 19 Sep 2023 20:41:22 +0000 (16:41 -0400)] 
word smithing

2 years agocatch nested attributes accidentally being added to the top-level list
Alan T. DeKok [Tue, 19 Sep 2023 12:39:58 +0000 (08:39 -0400)] 
catch nested attributes accidentally being added to the top-level list

2 years agoenforce parent / child relationships for structural pairs
Alan T. DeKok [Tue, 19 Sep 2023 12:20:55 +0000 (08:20 -0400)] 
enforce parent / child relationships for structural pairs

so that if we have nested TLVs, the children have to go into the
parent, subject to some limitations.

This requirement helps to enforce correct structure.

Note that children can still go into "internal" group attributes,
which means that they can still go into the top-level request list.

This isn't ideal, but it's not clear how to fix that without also
breaking it for control and session-state

2 years agotypo
Alan T. DeKok [Mon, 18 Sep 2023 21:02:00 +0000 (17:02 -0400)] 
typo

2 years agoonce again remove tmpl_tokenize_all_nested
Alan T. DeKok [Mon, 18 Sep 2023 20:58:29 +0000 (16:58 -0400)] 
once again remove tmpl_tokenize_all_nested

2 years agoforce tmpl_tokenize_all_nested
Alan T. DeKok [Mon, 18 Sep 2023 16:59:20 +0000 (12:59 -0400)] 
force tmpl_tokenize_all_nested

2 years agoenable tmpl_tokenize_all_nested for all module tests
Alan T. DeKok [Mon, 18 Sep 2023 13:05:22 +0000 (09:05 -0400)] 
enable tmpl_tokenize_all_nested for all module tests

2 years agouse nesting when creating SQL pairs
Alan T. DeKok [Mon, 18 Sep 2023 12:32:24 +0000 (08:32 -0400)] 
use nesting when creating SQL pairs

2 years agomore migrations. Only SQL is left
Alan T. DeKok [Mon, 18 Sep 2023 11:46:17 +0000 (07:46 -0400)] 
more migrations. Only SQL is left

2 years agoadd more migrations
Alan T. DeKok [Mon, 18 Sep 2023 00:39:58 +0000 (20:39 -0400)] 
add more migrations

2 years agomore migration for modules
Alan T. DeKok [Mon, 18 Sep 2023 00:23:46 +0000 (20:23 -0400)] 
more migration for modules

2 years agoframework for per-module migration flags
Alan T. DeKok [Sun, 17 Sep 2023 21:55:57 +0000 (17:55 -0400)] 
framework for per-module migration flags

2 years agoRevert "force tmpl_tokenize_all_nested"
Alan T. DeKok [Sun, 17 Sep 2023 21:50:51 +0000 (17:50 -0400)] 
Revert "force tmpl_tokenize_all_nested"

This reverts commit 5dc2aac671c609dbfc36ec19cddbec357c5a4c5f.

Well, no.  Too late on a weekend.

2 years agoRevert "remove tmpl_tokenize_all_nested"
Alan T. DeKok [Sun, 17 Sep 2023 21:37:52 +0000 (17:37 -0400)] 
Revert "remove tmpl_tokenize_all_nested"

This reverts commit 861c6a07630b4b6c32bcbc4994b07803e0ed84a8.

let's see if this causes CI to pass?

2 years agotypo
Alan T. DeKok [Sun, 17 Sep 2023 21:13:35 +0000 (17:13 -0400)] 
typo

2 years agotry to created nested VPs
Alan T. DeKok [Sun, 17 Sep 2023 20:18:48 +0000 (16:18 -0400)] 
try to created nested VPs

This likely won't work perfectly due to the fact that converting
attrs to Perl doesn't do nesting properly.

2 years agodisable Perl tests until such time as it creates nested attrs
Alan T. DeKok [Sun, 17 Sep 2023 20:16:26 +0000 (16:16 -0400)] 
disable Perl tests until such time as it creates nested attrs

2 years agoremove tmpl_tokenize_all_nested
Alan T. DeKok [Sun, 17 Sep 2023 19:57:03 +0000 (15:57 -0400)] 
remove tmpl_tokenize_all_nested

2 years agoforce tmpl_tokenize_all_nested
Alan T. DeKok [Sun, 17 Sep 2023 16:55:47 +0000 (12:55 -0400)] 
force tmpl_tokenize_all_nested

2 years agoupdate to use correct syntax for -=
Alan T. DeKok [Sun, 17 Sep 2023 14:38:57 +0000 (10:38 -0400)] 
update to use correct syntax for -=

2 years agobe a bit smarter about it
Alan T. DeKok [Sun, 17 Sep 2023 14:29:13 +0000 (10:29 -0400)] 
be a bit smarter about it

2 years agorelax test a bit
Alan T. DeKok [Sun, 17 Sep 2023 14:23:11 +0000 (10:23 -0400)] 
relax test a bit

2 years agoremove assertion
Alan T. DeKok [Sun, 17 Sep 2023 13:57:38 +0000 (09:57 -0400)] 
remove assertion

memdup_shallow() is sometimes called with non-talloc'd memory

in some cases the calls are wrong, and this causes a later assert
in the verify functions.  In other cases, the calls are correct.

2 years agocatch corner case for -=
Alan T. DeKok [Sun, 17 Sep 2023 13:46:41 +0000 (09:46 -0400)] 
catch corner case for -=

&control -= {
&Password.Cleartext == 'oracle01' # ERROR
 }

the edit code doesn't do this correctly (yet).  Add a test case
which catches it and complains, instead of dogn the wrong thing.
It's also not clear what is meant by the above.  Do we need to
delete &Password, too?

2 years agouse correct escaping
Alan T. DeKok [Sun, 17 Sep 2023 13:26:26 +0000 (09:26 -0400)] 
use correct escaping

now that we've fixed fr_asprint() in commit b10640, and the
escaping in 41193841eb, this test also needs fixing.  In order to
pass \' to a shell which takes a string in ' quotes, the config
file string must use one layer of escaping for FR, and a second
layer of escaping for the shell.

this issue highlights the fact that we likely need a "q" operator
ala Perl.

2 years agotemporarily stop ldap_sync until the failing test is fixed
Alan T. DeKok [Sun, 17 Sep 2023 12:59:36 +0000 (08:59 -0400)] 
temporarily stop ldap_sync until the failing test is fixed

2 years agomanually redo commit 0c6d48394867e2d2
Alan T. DeKok [Sat, 16 Sep 2023 19:40:16 +0000 (15:40 -0400)] 
manually redo commit 0c6d48394867e2d2

gettoken() parses the RHS of a CONF_PAIR, but that function only
unescapes the \", and doesn't unescape anything else.  Therefore
we do the unescaping here.

2 years agofr_asprint() takes a quotation 'char', not a fr_token_t
Alan T. DeKok [Sat, 16 Sep 2023 17:55:57 +0000 (13:55 -0400)] 
fr_asprint() takes a quotation 'char', not a fr_token_t

2 years agoallow T_HASH for edit sections. See map_afrom_cp()
Alan T. DeKok [Sat, 16 Sep 2023 15:15:04 +0000 (11:15 -0400)] 
allow T_HASH for edit sections.  See map_afrom_cp()

2 years agoAnnotate fr_nbo_to_uint{16,24}() at function level
James Jones [Fri, 15 Sep 2023 19:21:05 +0000 (14:21 -0500)] 
Annotate fr_nbo_to_uint{16,24}() at function level

CIDs: #1419883, #1520415, #1503954, #14516665, #1519002

This should keep coverity from tainting the pointer to data
being converted to host order.

2 years agocheck return codes to quiet static analyzer
Alan T. DeKok [Sat, 16 Sep 2023 01:25:39 +0000 (21:25 -0400)] 
check return codes to quiet static analyzer

2 years agoforce tmpl_tokenize_all_nested here, too
Alan T. DeKok [Fri, 15 Sep 2023 17:51:14 +0000 (13:51 -0400)] 
force tmpl_tokenize_all_nested here, too

2 years agoensure that the buffers are talloc'd
Alan T. DeKok [Fri, 15 Sep 2023 17:36:45 +0000 (13:36 -0400)] 
ensure that the buffers are talloc'd

the memdup_shallow() call will just assign the ptr to the
value-box.  But the added talloc_get_name() fails, because the
ptr isn't talloced.

2 years agomove legacy function to the only place which uses it
Alan T. DeKok [Fri, 15 Sep 2023 16:41:36 +0000 (12:41 -0400)] 
move legacy function to the only place which uses it

2 years agoremove legacy print nested, and old "unflatten" code
Alan T. DeKok [Fri, 15 Sep 2023 16:37:29 +0000 (12:37 -0400)] 
remove legacy print nested, and old "unflatten" code

2 years agoAttempt to ignore spurios LeakSanitizer fatal errors
Nick Porter [Fri, 15 Sep 2023 13:20:24 +0000 (14:20 +0100)] 
Attempt to ignore spurios LeakSanitizer fatal errors

2 years agoPlacate coverity with excessive buffer_len (CID #1503922, #1503986)
James Jones [Thu, 14 Sep 2023 19:06:59 +0000 (14:06 -0500)] 
Placate coverity with excessive buffer_len (CID #1503922, #1503986)

open_buffer_as_file() is a wrapper aound the fmemopen() function.
The example shown on fmemopen()'s man page passes a string as buffer
and strlen(<string>) as length, and open_buffer_as_file() calls did the
same thing--but coverity gives it an alloc_strlen defect with the
comment "allocating insufficient memory for the terminating null of
the string".

At least one other project using coverity and calling fmemopen()
in conformity with "man fmemopen" also gets this defect and ended
up passing strlen(<string>) + 1 to deal with it. Making the analogous
change here passes tests and should quiet coverity.

2 years agostart removing "update"
Alan T. DeKok [Fri, 15 Sep 2023 12:52:01 +0000 (08:52 -0400)] 
start removing "update"