]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
2 years agoadd %{interpreter:...} for virtual attributes
Alan T. DeKok [Tue, 29 Aug 2023 21:47:14 +0000 (17:47 -0400)] 
add %{interpreter:...} for virtual attributes

Module-Return-Code
Virtual-Server
Request-Processing-Stage

the processing stage _should_ be things like "recv Access-Request".
Due to various re-architecture issues, it's now hard-coded by the
src/process functions to be the name of the protocol.

We probably want to fix that

2 years agotypos
Alan T. DeKok [Tue, 29 Aug 2023 21:37:47 +0000 (17:37 -0400)] 
typos

2 years agoremove extraneous "break"
Alan T. DeKok [Tue, 29 Aug 2023 21:32:26 +0000 (17:32 -0400)] 
remove extraneous "break"

2 years agoFixup Doxygen comments
Jorge Pereira [Tue, 29 Aug 2023 18:03:07 +0000 (15:03 -0300)] 
Fixup Doxygen comments

2 years agoremove migration use_new_conditions
Alan T. DeKok [Tue, 29 Aug 2023 15:41:53 +0000 (11:41 -0400)] 
remove migration use_new_conditions

2 years agoDictionaries prefix are not longer used (#5163)
Jorge Pereira [Tue, 29 Aug 2023 15:06:56 +0000 (12:06 -0300)] 
Dictionaries prefix are not longer used (#5163)

2 years agoUse call env to evaluate password for LDAP bind
Nick Porter [Fri, 25 Aug 2023 11:34:06 +0000 (12:34 +0100)] 
Use call env to evaluate password for LDAP bind

Makes module protocol agnostic for LDAP binds

2 years agoSASL user binds do not need to look up the user DN
Nick Porter [Mon, 28 Aug 2023 16:12:34 +0000 (17:12 +0100)] 
SASL user binds do not need to look up the user DN

This means that if user binds use SASL, and the LDAP module has not
already been called to retrieve the user object, there is no need to
perform the initial lookup of the DN.

So, in the case that LDAP's sole purpose is to perform authentication
this reduces the number of LDAP calls made.

2 years ago&User-Name is not actually used in LDAP bind auth
Nick Porter [Fri, 25 Aug 2023 10:52:23 +0000 (11:52 +0100)] 
&User-Name is not actually used in LDAP bind auth

What actually happens is the user DN is looked up using the base and
filter, then the bind is performed as that DN.

Therefore, User-Name is not strictly needed - something else could be
identifying the user.

2 years agoSet bind_pool start = 0 to reduce noise in LDAP test logs
Nick Porter [Fri, 25 Aug 2023 17:15:50 +0000 (18:15 +0100)] 
Set bind_pool start = 0 to reduce noise in LDAP test logs

2 years agoUse ldap_url_desc2str for building referral host uris
Nick Porter [Tue, 29 Aug 2023 10:02:45 +0000 (11:02 +0100)] 
Use ldap_url_desc2str for building referral host uris

To be consistent with other construction of host URIs

2 years agoAssess LDAP map to set expect_password if a password is being retrieved
Nick Porter [Tue, 29 Aug 2023 09:30:46 +0000 (10:30 +0100)] 
Assess LDAP map to set expect_password if a password is being retrieved

Original setting of this got lost in move of ldap map code in 2017...

2 years agoSASL bind doesn't use the DN
Nick Porter [Fri, 25 Aug 2023 14:13:27 +0000 (15:13 +0100)] 
SASL bind doesn't use the DN

2 years agoAdd notes on LDAP group membership xlat to upgrade doc
Nick Porter [Fri, 25 Aug 2023 16:52:12 +0000 (17:52 +0100)] 
Add notes on LDAP group membership xlat to upgrade doc

2 years agoEnsure we print the log entry with either error or fmt populated
Nick Porter [Fri, 25 Aug 2023 13:52:34 +0000 (14:52 +0100)] 
Ensure we print the log entry with either error or fmt populated

2 years agoBetter error message
Nick Porter [Fri, 25 Aug 2023 13:51:25 +0000 (14:51 +0100)] 
Better error message

2 years agoand again "shut the heck up"
Alan T. DeKok [Tue, 29 Aug 2023 00:53:17 +0000 (20:53 -0400)] 
and again "shut the heck up"

2 years agomore "shut up static analysis"
Alan T. DeKok [Tue, 29 Aug 2023 00:38:13 +0000 (20:38 -0400)] 
more "shut up static analysis"

2 years agoupdate doc notes
Alan T. DeKok [Mon, 28 Aug 2023 21:53:51 +0000 (17:53 -0400)] 
update doc notes

2 years agowho killed the dinosaurs?
Alan T. DeKok [Mon, 28 Aug 2023 21:50:47 +0000 (17:50 -0400)] 
who killed the dinosaurs?

We did!

The only paircmp() API is finally gone.  Good riddance to bad rubbish.

2 years agore-enable regex tests for files module
Alan T. DeKok [Mon, 28 Aug 2023 21:49:58 +0000 (17:49 -0400)] 
re-enable regex tests for files module

and fix code to match

2 years agotypo
Alan T. DeKok [Mon, 28 Aug 2023 21:49:34 +0000 (17:49 -0400)] 
typo

2 years agoshut up static analyzer
Alan T. DeKok [Mon, 28 Aug 2023 21:46:04 +0000 (17:46 -0400)] 
shut up static analyzer

2 years agoshut up static analyzer
Alan T. DeKok [Mon, 28 Aug 2023 21:18:48 +0000 (17:18 -0400)] 
shut up static analyzer

2 years agoallow and handled regexes
Alan T. DeKok [Mon, 28 Aug 2023 21:10:14 +0000 (17:10 -0400)] 
allow and handled regexes

2 years agoRevert "Attempt to keep fr_nbo_to_foo() from tainting the pointer (#5156)"
Alan T. DeKok [Mon, 28 Aug 2023 21:05:36 +0000 (17:05 -0400)] 
Revert "Attempt to keep fr_nbo_to_foo() from tainting the pointer (#5156)"

This reverts commit 6bcdb8a7200cab4d185a9e73a823944983c15a8f.

this made no difference to Coverity

2 years agoRevert "Skip fr_assert() for static analysis (CID #1414423)"
Alan T. DeKok [Mon, 28 Aug 2023 21:02:19 +0000 (17:02 -0400)] 
Revert "Skip fr_assert() for static analysis (CID #1414423)"

This reverts commit 28aae6fc257004cb24473934657436466d59dd22.

2 years agoremove note that regexes aren't supported.
Alan T. DeKok [Mon, 28 Aug 2023 21:01:52 +0000 (17:01 -0400)] 
remove note that regexes aren't supported.

2 years agoadd fr_regex_cmp_op()
Alan T. DeKok [Mon, 28 Aug 2023 20:59:05 +0000 (16:59 -0400)] 
add fr_regex_cmp_op()

as a mirror to fr_value_box_cmp_op(), and which is called from
that function.

If the LHS isn't a string / octets, the LHS is printed to an
intermediate buffer, and that is used for the regex.

2 years agoSkip fr_assert() for static analysis (CID #1414423)
James Jones [Mon, 28 Aug 2023 15:44:37 +0000 (10:44 -0500)] 
Skip fr_assert() for static analysis (CID #1414423)

For static analysis, fr_assert() is plain assert...but otherwise,
for non-debugging versions, it just logs. That means that to
coverity, the mutex won't be unlocked, while in production it
will always be unlocked.

2 years agoAruba(dictionary): Update dicto from ClearPass 6.11.4
Alexis La Goutte [Mon, 28 Aug 2023 14:32:25 +0000 (14:32 +0000)] 
Aruba(dictionary): Update dicto from ClearPass 6.11.4

2 years agomake the files module work (mostly)
Alan T. DeKok [Mon, 28 Aug 2023 17:51:11 +0000 (13:51 -0400)] 
make the files module work (mostly)

Regular expressions are not supported.

Arguably the module actually supported inter-attribute comparisons,
we just never tried that?

2 years agoremove old condition code
Alan T. DeKok [Mon, 28 Aug 2023 14:20:26 +0000 (10:20 -0400)] 
remove old condition code

2 years agoremove last potential call to cond_tokenize
Alan T. DeKok [Mon, 28 Aug 2023 13:16:01 +0000 (09:16 -0400)] 
remove last potential call to cond_tokenize

We can then remove all of the old condition code

2 years agoupdate unit tests to only use new conditions
Alan T. DeKok [Mon, 28 Aug 2023 12:44:09 +0000 (08:44 -0400)] 
update unit tests to only use new conditions

which resulted in a number of changes

* the xlats need to be instantiated (and they're not), so we can't
  print regexes.  As a reuslt, regex parsing tests are omitted

* escape tests are omitted, as the old code automatically purifies
  them, and the new ones don't do that

* the only code purifies a lot of things automatically.  The new
  code doesn't, so many tests changed

* the old code reordered conditions to put the attribute on the LHS
  the new code doesn't.

* the old code printed many casts, which are suppressed in the
  new code

* the old code printed rcodes and existence checks as-is.  The new
  code printes them as functions.  If we care to fix this, we can
  add a "print" callback which just prints them in the correct
  format.  However, because the xlats aren't instantiated, the
  print routine won't really work the way we expect.

* the output files have a bunch of "@todo" sprinkled through them
  these are things which could likely be fixed without too much
  work, but which aren't critical, and don't affect behavior

2 years agothere's no longer any cond_t in the "if" block
Alan T. DeKok [Mon, 28 Aug 2023 12:43:52 +0000 (08:43 -0400)] 
there's no longer any cond_t in the "if" block

2 years agoinst->xlat may not exist in some circumstances
Alan T. DeKok [Mon, 28 Aug 2023 00:51:25 +0000 (20:51 -0400)] 
inst->xlat may not exist in some circumstances

2 years agoremove use_new_conditions flag, and start hard-coding it
Alan T. DeKok [Sun, 27 Aug 2023 21:46:51 +0000 (17:46 -0400)] 
remove use_new_conditions flag, and start hard-coding it

the command-line parameter is still accepted for compatibility,
but it is ignored.

2 years agodon't force use_new_conditions = false
Alan T. DeKok [Sun, 27 Aug 2023 20:05:18 +0000 (16:05 -0400)] 
don't force use_new_conditions = false

2 years agodict_def can be NULL for unit tests
Alan T. DeKok [Sun, 27 Aug 2023 19:48:38 +0000 (15:48 -0400)] 
dict_def can be NULL for unit tests

2 years agoset dict for functions we alloc
Alan T. DeKok [Sun, 27 Aug 2023 19:32:55 +0000 (15:32 -0400)] 
set dict for functions we alloc

2 years agocopy dict when copying functions
Alan T. DeKok [Sun, 27 Aug 2023 19:32:33 +0000 (15:32 -0400)] 
copy dict when copying functions

2 years agomake error message clearer.
Alan T. DeKok [Sun, 27 Aug 2023 19:31:06 +0000 (15:31 -0400)] 
make error message clearer.

We also have an issue where 'cp' may be NULL, and it still calls
cf_log_err(cp, ...).  But that will be another fix

2 years agocan't be passing NULL parameters, including dict_def
Alan T. DeKok [Sun, 27 Aug 2023 19:27:09 +0000 (15:27 -0400)] 
can't be passing NULL parameters, including dict_def

2 years agowe don't need !!!!!!!!
Alan T. DeKok [Sun, 27 Aug 2023 18:57:19 +0000 (14:57 -0400)] 
we don't need !!!!!!!!

2 years agolet's set the configuration flag
Alan T. DeKok [Sun, 27 Aug 2023 18:37:12 +0000 (14:37 -0400)] 
let's set the configuration flag

2 years agoalways use new conditions
Alan T. DeKok [Sun, 27 Aug 2023 14:57:22 +0000 (10:57 -0400)] 
always use new conditions

Let's set a simple flag to see if anything breaks.  That way if
something bad does happen, we only have to revert one line of code.

If everything works. we can then start on the longer process of
removing all of the old condition code.

2 years agoforce new conditions
Alan T. DeKok [Sun, 27 Aug 2023 13:57:13 +0000 (09:57 -0400)] 
force new conditions

2 years agoit helps to check the correct return code
Alan T. DeKok [Sun, 27 Aug 2023 13:32:44 +0000 (09:32 -0400)] 
it helps to check the correct return code

2 years agoRevert "just call value_box_cmp_op()"
Alan T. DeKok [Sun, 27 Aug 2023 13:17:50 +0000 (09:17 -0400)] 
Revert "just call value_box_cmp_op()"

This reverts commit 922064282139d6d30b60e108ee68cf81d55bf156.

seems to result in talloc failures?  It's not clear why, but in
the interest of moving forward in other places, we'll just revert
this

2 years agotypos
Alan T. DeKok [Sun, 27 Aug 2023 12:45:42 +0000 (08:45 -0400)] 
typos

2 years agopaircmp works with new conditions
Alan T. DeKok [Sun, 27 Aug 2023 12:43:35 +0000 (08:43 -0400)] 
paircmp works with new conditions

2 years agomerge paircmp tests
Alan T. DeKok [Sun, 27 Aug 2023 12:42:08 +0000 (08:42 -0400)] 
merge paircmp tests

2 years agomove paircmp() to rlm_sql
Alan T. DeKok [Sun, 27 Aug 2023 12:34:11 +0000 (08:34 -0400)] 
move paircmp() to rlm_sql

and drastically simplify it.  The behavior is similar enough for
most cases, except:

* regular expression operators are no longer supported.  It's not
  hard to re-add them.  As they're not needed right now, they can
  be temporarily removed

* virtual attributes like Packet-Src-IP-Address are not supported
  Again, this isn't terribly difficult to re-add.  But once the
  Packet-* attributes are moved to Net.* attributes, then any
  virtual attribute comparisons become much less useful.

  The remainder are Virtual-Server, Request-Processing-Stage,
  and Module-Return-Code.  Those could arguably all be moved to
  realized attributes in the control list.  And be made immutable,
  so that "unlang" can't change them.

2 years agojust call value_box_cmp_op()
Alan T. DeKok [Sun, 27 Aug 2023 12:04:05 +0000 (08:04 -0400)] 
just call value_box_cmp_op()

2 years agoadded RFC 9445 dictionary
Alan T. DeKok [Sat, 26 Aug 2023 20:20:09 +0000 (16:20 -0400)] 
added RFC 9445 dictionary

2 years agoremove Client-Shortname and replace with %{client:shortname}
Alan T. DeKok [Sat, 26 Aug 2023 20:02:04 +0000 (16:02 -0400)] 
remove Client-Shortname and replace with %{client:shortname}

2 years agoPacket-Type is no longer virtual
Alan T. DeKok [Sat, 26 Aug 2023 19:53:26 +0000 (15:53 -0400)] 
Packet-Type is no longer virtual

2 years agoPacket-Type is a real attribute here, too
Alan T. DeKok [Sat, 26 Aug 2023 19:48:20 +0000 (15:48 -0400)] 
Packet-Type is a real attribute here, too

2 years agowe now always use one function: generic_cmp()
Alan T. DeKok [Sat, 26 Aug 2023 19:44:43 +0000 (15:44 -0400)] 
we now always use one function: generic_cmp()

2 years agoPacket-Type is now always a real attribute
Alan T. DeKok [Sat, 26 Aug 2023 19:41:24 +0000 (15:41 -0400)] 
Packet-Type is now always a real attribute

which means that we don't need a virtual attribute callback for it.

2 years agoremove xlat wrapper for paircmp
Alan T. DeKok [Sat, 26 Aug 2023 19:22:38 +0000 (15:22 -0400)] 
remove xlat wrapper for paircmp

2 years agominro cleanups
Alan T. DeKok [Sat, 26 Aug 2023 19:20:26 +0000 (15:20 -0400)] 
minro cleanups

2 years agoremove "firstonly"
Alan T. DeKok [Sat, 26 Aug 2023 19:17:31 +0000 (15:17 -0400)] 
remove "firstonly"

2 years agoremove "from" parameter
Alan T. DeKok [Sat, 26 Aug 2023 19:14:56 +0000 (15:14 -0400)] 
remove "from" parameter

2 years agoremove instance from paircmp()
Alan T. DeKok [Sat, 26 Aug 2023 19:08:45 +0000 (15:08 -0400)] 
remove instance from paircmp()

2 years agowe no longer need paircmp_unregister_instance()
Alan T. DeKok [Sat, 26 Aug 2023 19:02:04 +0000 (15:02 -0400)] 
we no longer need paircmp_unregister_instance()

no modules have registered paircmp() functions

2 years agoclarifications
Alan T. DeKok [Sat, 26 Aug 2023 18:43:43 +0000 (14:43 -0400)] 
clarifications

2 years agoAttempt to keep fr_nbo_to_foo() from tainting the pointer (#5156)
James Jones [Fri, 25 Aug 2023 15:43:24 +0000 (10:43 -0500)] 
Attempt to keep fr_nbo_to_foo() from tainting the pointer (#5156)

Related CIDs: #12433443, #1448182, #1520415, #1503937, #1503914

Coverity claims the fr_nbo_to_foo() functions taint the pointer
passed to it. Thereafter, any data accessed via that pointer is
considered tainted, and any copy of the pointer has the same
issue.

Something like this (copying the passed pointer to a local--with
any optimization, register coalescence will mean this has zero
overhead, BTW--is the only thing that comes to mind to work around
the issue.

2 years agoremove test paircmp, and this paircmp_register_by_name
Alan T. DeKok [Fri, 25 Aug 2023 14:59:18 +0000 (10:59 -0400)] 
remove test paircmp, and this paircmp_register_by_name

2 years agoremove Client-IP-Address, and replace with Packet-Src-IP-Address
Alan T. DeKok [Fri, 25 Aug 2023 14:51:09 +0000 (10:51 -0400)] 
remove Client-IP-Address, and replace with Packet-Src-IP-Address

this is made more problematic by the fact that DHCPv4 defines its
own Client-IP-Address, which is something different.

And there are also FreeRADIUS-Client-IP-Address for dynamic clients,
and FreeRADIUS-Stats-Client-IP-Address for statistics.  Both of
those should be replaced with better names, and nested TLVs

2 years agoregenerate from updated source
Alan T. DeKok [Fri, 25 Aug 2023 14:50:46 +0000 (10:50 -0400)] 
regenerate from updated source

2 years agotypo
Alan T. DeKok [Fri, 25 Aug 2023 14:50:24 +0000 (10:50 -0400)] 
typo

2 years agomove winbind to %{winbind.group:...}
Alan T. DeKok [Fri, 25 Aug 2023 13:44:28 +0000 (09:44 -0400)] 
move winbind to %{winbind.group:...}

2 years agotry to shut up scanner
Alan T. DeKok [Fri, 25 Aug 2023 11:59:15 +0000 (07:59 -0400)] 
try to shut up scanner

2 years agotypos and word smithing
Alan T. DeKok [Fri, 25 Aug 2023 11:55:39 +0000 (07:55 -0400)] 
typos and word smithing

2 years agobe nice to people
Alan T. DeKok [Fri, 25 Aug 2023 11:55:28 +0000 (07:55 -0400)] 
be nice to people

2 years agocreate proper nested ctx
Alan T. DeKok [Fri, 25 Aug 2023 11:44:28 +0000 (07:44 -0400)] 
create proper nested ctx

2 years agoNo need for an intermediary variable
Nick Porter [Fri, 25 Aug 2023 08:47:35 +0000 (09:47 +0100)] 
No need for an intermediary variable

2 years agoAlways use expanded "if" condition
Nick Porter [Thu, 24 Aug 2023 18:54:07 +0000 (19:54 +0100)] 
Always use expanded "if" condition

Makes debug output correct when variables are referenced in conditions.

2 years agoadd missing return
Alan T. DeKok [Thu, 24 Aug 2023 21:09:38 +0000 (17:09 -0400)] 
add missing return

I wish to write an "Ode to C compilers".  It will be composed
moslty of curse words.

2 years agoit helps to define the group attribute
Alan T. DeKok [Thu, 24 Aug 2023 20:28:47 +0000 (16:28 -0400)] 
it helps to define the group attribute

as paircmp no longer does that for us

2 years agoconvert Unix-Group to xlat
Alan T. DeKok [Thu, 24 Aug 2023 20:20:35 +0000 (16:20 -0400)] 
convert Unix-Group to xlat

2 years agopass in correct value
Alan T. DeKok [Thu, 24 Aug 2023 19:57:55 +0000 (15:57 -0400)] 
pass in correct value

Why won't the local compiler complain?

2 years agoremove old paircmp, and update docs to match
Alan T. DeKok [Thu, 24 Aug 2023 19:06:34 +0000 (15:06 -0400)] 
remove old paircmp, and update docs to match

2 years agouse real names for counter start / end
Alan T. DeKok [Thu, 24 Aug 2023 18:57:37 +0000 (14:57 -0400)] 
use real names for counter start / end

2 years agoconvert horrific %b and %e to real attributes
Alan T. DeKok [Thu, 24 Aug 2023 18:46:24 +0000 (14:46 -0400)] 
convert horrific %b and %e to real attributes

2 years agotypo
Alan T. DeKok [Thu, 24 Aug 2023 18:33:24 +0000 (14:33 -0400)] 
typo

2 years agoadd and document cache_groups
Alan T. DeKok [Thu, 24 Aug 2023 15:25:55 +0000 (11:25 -0400)] 
add and document cache_groups

2 years agoremove paircmp() callback for SQL-Group
Alan T. DeKok [Thu, 24 Aug 2023 14:35:12 +0000 (10:35 -0400)] 
remove paircmp() callback for SQL-Group

2 years agoFix remaining uninitialized scalar values (CID #1503958, #1504020) (#5150)
James Jones [Thu, 24 Aug 2023 15:26:25 +0000 (10:26 -0500)] 
Fix remaining uninitialized scalar values (CID #1503958, #1504020) (#5150)

The latter issue was interesting; the dbuff is set to use ether.addr,
but fr_value_box_ethernet_addr() is passed &ether, which looks like
it will put random garbage in the value box until you notice that
the address is the only member of the type. We'll see whether coverity
considers (fr_ethernet_t * const) fr_dbuff_start(&dbuff) a dangerous
downcast (whatever that means in C) and still complains. I hope not,
because the only reason that comes to mind for it is alignment issues,
which shouldn't happen here.

2 years agoChange fr_vlog_perror() behavior in what might be an edge case (#5153)
James Jones [Thu, 24 Aug 2023 15:25:42 +0000 (10:25 -0500)] 
Change fr_vlog_perror() behavior in what might be an edge case (#5153)

As things stand, if the error stack is non-empty and fmt is null,
the copy of f_rules->first_prefix to sbuff won't make any
difference.

2 years agoTest LDAP xlat and map using ldapi:// scheme
Nick Porter [Thu, 24 Aug 2023 13:50:56 +0000 (14:50 +0100)] 
Test LDAP xlat and map using ldapi:// scheme

2 years agoUse ldap_url_desc2str to canonify LDAP host URI
Nick Porter [Thu, 24 Aug 2023 13:42:57 +0000 (14:42 +0100)] 
Use ldap_url_desc2str to canonify LDAP host URI

Gives consistent host URI strings for looking up trunk connections.

Also appears to catch some invalid URIs which ldap_url_parse does not -
e.g. ldap://%2Ftmp%2fldap/...

2 years agoAdd LDAP test using ldapi:// scheme
Nick Porter [Thu, 24 Aug 2023 13:22:19 +0000 (14:22 +0100)] 
Add LDAP test using ldapi:// scheme

2 years agoSet LDAP servers start to 0 in tests
Nick Porter [Thu, 24 Aug 2023 13:04:38 +0000 (14:04 +0100)] 
Set LDAP servers start to 0 in tests

Reduces noise in logs as only the relevant server connection starts

2 years agoAdd LDAP test using SASL for user auth binds
Nick Porter [Thu, 24 Aug 2023 12:57:48 +0000 (13:57 +0100)] 
Add LDAP test using SASL for user auth binds

2 years agoldap_debug is no longer in module config
Nick Porter [Thu, 24 Aug 2023 10:54:03 +0000 (11:54 +0100)] 
ldap_debug is no longer in module config

2 years agoCorrectly parent value boxes when concatenating
Nick Porter [Thu, 24 Aug 2023 10:53:30 +0000 (11:53 +0100)] 
Correctly parent value boxes when concatenating

2 years agoCorrectly escape LDAP uri in map
Nick Porter [Thu, 24 Aug 2023 10:44:53 +0000 (11:44 +0100)] 
Correctly escape LDAP uri in map