freeradius.git
9 years agoFix OpenSSL version check issues
Arran Cudbard-Bell [Thu, 16 Oct 2014 15:16:57 +0000 (11:16 -0400)]
Fix OpenSSL version check issues

9 years agoGotta catch em all (SIGILL)
Arran Cudbard-Bell [Mon, 13 Oct 2014 20:01:32 +0000 (16:01 -0400)]
Gotta catch em all (SIGILL)

9 years agodoxygen
Alan T. DeKok [Thu, 16 Oct 2014 11:53:23 +0000 (07:53 -0400)]
doxygen

9 years agoraddb: Use appropriate module names in traps
Nikolai Kondrashov [Thu, 16 Oct 2014 10:59:51 +0000 (13:59 +0300)]
raddb: Use appropriate module names in traps

Specify appropriate module names for all module traps in trigger.conf,
instead of using "ldap" for all.

9 years agoraddb: Remove extra apostrophe from trigger.conf
Nikolai Kondrashov [Thu, 16 Oct 2014 10:48:32 +0000 (13:48 +0300)]
raddb: Remove extra apostrophe from trigger.conf

Remove a spurious apostrophe from trigger.conf's trigger.modules.args.

This fixes module triggers, otherwise producing this error:

    rad_expand_xlat: Invalid string passed as argument

9 years agoexec: Don't assume request presence when logging
Nikolai Kondrashov [Wed, 15 Oct 2014 17:03:11 +0000 (20:03 +0300)]
exec: Don't assume request presence when logging

Use DEBUG* macros for logging, instead of RDEBUG* macros in
radius_start_program and radius_readfrom_program as these are not
guaranteed to be invoked with a valid request.

For example, not from most of the exec_trigger invocations.

9 years agoAssign cp
Alan T. DeKok [Tue, 14 Oct 2014 16:36:37 +0000 (12:36 -0400)]
Assign cp

9 years agoFix error message
Alan T. DeKok [Tue, 14 Oct 2014 15:06:19 +0000 (11:06 -0400)]
Fix error message

9 years agoMy attempt to fix ldap:
Alan T. DeKok [Tue, 14 Oct 2014 13:57:26 +0000 (09:57 -0400)]
My attempt to fix ldap:

reply: += 'ldapAttrName'

It should work, but it's untested

9 years agoClearer error messages
Alan T. DeKok [Tue, 14 Oct 2014 13:07:45 +0000 (09:07 -0400)]
Clearer error messages

9 years agoDon't duplicate code
Alan T. DeKok [Sat, 11 Oct 2014 17:04:56 +0000 (13:04 -0400)]
Don't duplicate code

9 years agoClean up sanitize function
Alan T. DeKok [Sat, 11 Oct 2014 17:01:23 +0000 (13:01 -0400)]
Clean up sanitize function

9 years agoRemove realm_home_server_add()
Alan T. DeKok [Sat, 11 Oct 2014 16:58:13 +0000 (12:58 -0400)]
Remove realm_home_server_add()

It's not needed

9 years agodn needs wider scope
Arran Cudbard-Bell [Mon, 13 Oct 2014 14:38:32 +0000 (10:38 -0400)]
dn needs wider scope

9 years agoFixup LDAP client config
Arran Cudbard-Bell [Mon, 13 Oct 2014 14:37:14 +0000 (10:37 -0400)]
Fixup LDAP client config

9 years agoDoxygen
Arran Cudbard-Bell [Mon, 13 Oct 2014 14:25:11 +0000 (10:25 -0400)]
Doxygen

9 years agoAllow arbitrary attributes for LDAP clients
Arran Cudbard-Bell [Mon, 13 Oct 2014 14:18:20 +0000 (10:18 -0400)]
Allow arbitrary attributes for LDAP clients

9 years agoFormatting
Arran Cudbard-Bell [Mon, 13 Oct 2014 13:48:36 +0000 (09:48 -0400)]
Formatting

9 years agoMove some functions around in clients.c and expose client_afrom_cs so it can be used...
Arran Cudbard-Bell [Fri, 10 Oct 2014 20:17:25 +0000 (16:17 -0400)]
Move some functions around in clients.c and expose client_afrom_cs so it can be used to parse dynamically generated client sections

9 years agoFix typo
Alan T. DeKok [Sat, 11 Oct 2014 13:13:28 +0000 (09:13 -0400)]
Fix typo

9 years agoDocument 'track = yes' in the correct place
Alan T. DeKok [Sat, 11 Oct 2014 13:00:58 +0000 (09:00 -0400)]
Document 'track = yes' in the correct place

9 years agoFix compiler warning
Alan T. DeKok [Fri, 10 Oct 2014 19:44:06 +0000 (15:44 -0400)]
Fix compiler warning

9 years agoAllow CoA packets to be proxied via Packet-Dst-IP-Address
Alan T. DeKok [Fri, 10 Oct 2014 19:38:41 +0000 (15:38 -0400)]
Allow CoA packets to be proxied via Packet-Dst-IP-Address

9 years agoAllow CoA packets to be read from the detail file
Alan T. DeKok [Fri, 10 Oct 2014 19:08:14 +0000 (15:08 -0400)]
Allow CoA packets to be read from the detail file

9 years agoExpose rad_coa_recv
Alan T. DeKok [Fri, 10 Oct 2014 19:06:35 +0000 (15:06 -0400)]
Expose rad_coa_recv

9 years agoSet packet->code from Packet-Type in detail file
Alan T. DeKok [Fri, 10 Oct 2014 19:04:12 +0000 (15:04 -0400)]
Set packet->code from Packet-Type in detail file

but still force everything to be accounting packets.

We'll need a separate rad_coa() function to handle reading
coa packets from the detail file reader

9 years agoAdd tracking when reading detail files.
Alan T. DeKok [Fri, 10 Oct 2014 18:58:03 +0000 (14:58 -0400)]
Add tracking when reading detail files.

So that we process each packet once, and only once

9 years agoWrite timestamps even in non-compat mode
Alan T. DeKok [Fri, 10 Oct 2014 18:48:31 +0000 (14:48 -0400)]
Write timestamps even in non-compat mode

9 years agoRename vpt_types to tmpl_types
Arran Cudbard-Bell [Fri, 10 Oct 2014 02:12:33 +0000 (22:12 -0400)]
Rename vpt_types to tmpl_types

9 years agocf_item_add defined too many times...
Arran Cudbard-Bell [Thu, 9 Oct 2014 19:01:06 +0000 (15:01 -0400)]
cf_item_add defined too many times...

9 years agoSupport adding arbitrary attributes for dynamic clients
Arran Cudbard-Bell [Thu, 9 Oct 2014 18:18:29 +0000 (14:18 -0400)]
Support adding arbitrary attributes for dynamic clients

9 years agoExpose cf_item_add and cf_pair_alloc
Arran Cudbard-Bell [Thu, 9 Oct 2014 14:53:43 +0000 (10:53 -0400)]
Expose cf_item_add and cf_pair_alloc

9 years agoStill need the loop
Arran Cudbard-Bell [Thu, 9 Oct 2014 14:51:04 +0000 (10:51 -0400)]
Still need the loop

9 years agoAdding the same VP twice is bad mm'k Fixes #809
Arran Cudbard-Bell [Thu, 9 Oct 2014 14:32:01 +0000 (10:32 -0400)]
Adding the same VP twice is bad mm'k Fixes #809

9 years agoTypo
Arran Cudbard-Bell [Thu, 9 Oct 2014 14:26:43 +0000 (10:26 -0400)]
Typo

9 years agopairadd: Don't add a VP if it's already present
Julius Plenz [Thu, 9 Oct 2014 10:48:37 +0000 (12:48 +0200)]
pairadd: Don't add a VP if it's already present

In the 3.0 code base, pairmake() will already do a pairadd()
automatically. If an old code base (e.g. modules originally written for
FreeRADIUS 2.x) uses pairmake() and then pairadd() explicitly, this will
add the VP *twice*, thus creating a cyclic list structure, e.g.:

    A->next == B;
    B->next == B;
    B->next == B;
    B->next == B;
    ...

This makes any function that walks all value pairs end up eating 100%
CPU.

Since VPs are added at the end of the list, we can simply stop
traversing the list and return silently in case the VP is already
present.

Signed-off-by: Julius Plenz <plenz@cis.fu-berlin.de>
9 years agoMore verbose error messages about VALUE_PAIRs with bad dictionary entries
Arran Cudbard-Bell [Thu, 9 Oct 2014 11:17:44 +0000 (07:17 -0400)]
More verbose error messages about VALUE_PAIRs with bad dictionary entries

9 years agoFormatting
Arran Cudbard-Bell [Wed, 8 Oct 2014 17:54:32 +0000 (18:54 +0100)]
Formatting

9 years agoBetter error message for invalid LHS
Arran Cudbard-Bell [Wed, 8 Oct 2014 17:54:02 +0000 (18:54 +0100)]
Better error message for invalid LHS

9 years agoFixes for detail file reader
Alan T. DeKok [Wed, 8 Oct 2014 20:31:00 +0000 (16:31 -0400)]
Fixes for detail file reader

9 years agoClean up debug message
Alan T. DeKok [Wed, 8 Oct 2014 19:24:51 +0000 (15:24 -0400)]
Clean up debug message

9 years agoDon't send packets with code 0
Alan T. DeKok [Wed, 8 Oct 2014 19:18:21 +0000 (15:18 -0400)]
Don't send packets with code 0

9 years agoFix assertion to only check for TCP sockets
Alan T. DeKok [Wed, 8 Oct 2014 19:00:12 +0000 (15:00 -0400)]
Fix assertion to only check for TCP sockets

9 years agoFix TRUSTROUTER -> TRUST_ROUTER
Kevin Wasserman [Mon, 22 Sep 2014 20:31:09 +0000 (16:31 -0400)]
Fix TRUSTROUTER -> TRUST_ROUTER

9 years agoTry this... helps with #806
Alan T. DeKok [Mon, 6 Oct 2014 18:38:44 +0000 (14:38 -0400)]
Try this... helps with #806

9 years agoCorrect fix for #808
Arran Cudbard-Bell [Tue, 7 Oct 2014 21:42:25 +0000 (22:42 +0100)]
Correct fix for #808

9 years agoMerge pull request #808 from qnet-herwin/rlm_rest_json_from_server
Alan DeKok [Tue, 7 Oct 2014 20:43:04 +0000 (16:43 -0400)]
Merge pull request #808 from qnet-herwin/rlm_rest_json_from_server

Prevent assert(0) in rlm_rest

9 years agoEven when there's no response, poke the detail file reader
Alan T. DeKok [Tue, 7 Oct 2014 20:27:39 +0000 (16:27 -0400)]
Even when there's no response, poke the detail file reader

So that it retranmits.

9 years agoHandle failures for internally proxied requests.
Alan T. DeKok [Tue, 7 Oct 2014 17:02:21 +0000 (13:02 -0400)]
Handle failures for internally proxied requests.

If there's no reply, deal with that case, rather than
assuming that everything's OK

9 years agoDon't check synchronous / nodup for detail sockets
Alan T. DeKok [Tue, 7 Oct 2014 16:01:46 +0000 (12:01 -0400)]
Don't check synchronous / nodup for detail sockets

9 years agoPrevent assert(0) in rlm_rest
Herwin Weststrate [Tue, 7 Oct 2014 15:59:54 +0000 (17:59 +0200)]
Prevent assert(0) in rlm_rest

If the RADIUS server is compiled without JSON support, it is still possible that the other end of the rlm_rest module returns JSON. This triggered an "assert(0)" and crashed the server. This fixes this by printing an error message to indicate that the reply of the REST server couldn't be parsed, and failing the module gracefully.

9 years agoUse correct definition
Alan T. DeKok [Tue, 7 Oct 2014 15:53:13 +0000 (11:53 -0400)]
Use correct definition

9 years agoBetter checks for regex
Alan T. DeKok [Tue, 7 Oct 2014 14:35:48 +0000 (10:35 -0400)]
Better checks for regex

9 years agoi_flag is only known if HAVE_REGEX is defined
Julius Plenz [Tue, 7 Oct 2014 14:17:51 +0000 (16:17 +0200)]
i_flag is only known if HAVE_REGEX is defined

Signed-off-by: Julius Plenz <plenz@cis.fu-berlin.de>
9 years ago"do_octets" label is needed independently of Ascend binary
Julius Plenz [Tue, 7 Oct 2014 14:16:40 +0000 (16:16 +0200)]
"do_octets" label is needed independently of Ascend binary

Signed-off-by: Julius Plenz <plenz@cis.fu-berlin.de>
9 years agodhcpclient: Load dictionary.dhcp from DICTDIR.
Nikolai Kondrashov [Mon, 6 Oct 2014 14:00:25 +0000 (17:00 +0300)]
dhcpclient: Load dictionary.dhcp from DICTDIR.

Load dictionary.dhcp from DICTDIR instead of RADDBDIR in dhcpclient.c,
as it is found only in the former.

This fixes the following error printed when invoking dhcpclient:

    Failed reading dictionary.dhcp: dict_init: Couldn't open dictionary
    "/etc/raddb/dictionary.dhcp": No such file or directory

9 years agoClean up fr_pow()
Alan T. DeKok [Mon, 6 Oct 2014 13:21:32 +0000 (09:21 -0400)]
Clean up fr_pow()

9 years agoParse perlconf before running the initialization subroutine
Alan T. DeKok [Mon, 6 Oct 2014 13:12:42 +0000 (09:12 -0400)]
Parse perlconf before running the initialization subroutine

9 years agomove fr_pow to rlm_expr. No one else uses it.
Alan T. DeKok [Mon, 6 Oct 2014 00:45:33 +0000 (20:45 -0400)]
move fr_pow to rlm_expr.  No one else uses it.

9 years agoChange ! to ~, as that's what it really is.
Alan T. DeKok [Mon, 6 Oct 2014 00:41:04 +0000 (20:41 -0400)]
Change ! to ~, as that's what it really is.

9 years agoAllow cast of ifid to integer64
Alan T. DeKok [Mon, 6 Oct 2014 00:32:42 +0000 (20:32 -0400)]
Allow cast of ifid to integer64

9 years agoUse attribute references instead of string expansions.
Alan T. DeKok [Sun, 5 Oct 2014 22:06:46 +0000 (18:06 -0400)]
Use attribute references instead of string expansions.

Which skips a few steps of xlat.

If the attribute doesn't exist, it's value defaults to zero

9 years agoMore descriptive error message
Alan T. DeKok [Sun, 5 Oct 2014 22:05:56 +0000 (18:05 -0400)]
More descriptive error message

9 years agoUse shift and OR instead of multiplication by magic number
Alan T. DeKok [Sun, 5 Oct 2014 22:04:09 +0000 (18:04 -0400)]
Use shift and OR instead of multiplication by magic number

9 years agoRemove unused variable
Alan T. DeKok [Sun, 5 Oct 2014 21:47:11 +0000 (17:47 -0400)]
Remove unused variable

9 years agoFix checks for PW_TYPE_FILE_INPUT
Alan T. DeKok [Sun, 5 Oct 2014 21:31:34 +0000 (17:31 -0400)]
Fix checks for PW_TYPE_FILE_INPUT

9 years agoUnlock, not lock
Alan T. DeKok [Sun, 5 Oct 2014 21:25:03 +0000 (17:25 -0400)]
Unlock, not lock

9 years agoMaximum length on EAP identity
Alan T. DeKok [Sun, 5 Oct 2014 21:23:59 +0000 (17:23 -0400)]
Maximum length on EAP identity

9 years agoMake grp tallo'c, too
Alan T. DeKok [Sun, 5 Oct 2014 21:22:26 +0000 (17:22 -0400)]
Make grp tallo'c, too

9 years agoTypo
Alan T. DeKok [Sun, 5 Oct 2014 21:16:40 +0000 (17:16 -0400)]
Typo

9 years agoAdd left / right shift to expressions
Alan T. DeKok [Sun, 5 Oct 2014 16:37:25 +0000 (12:37 -0400)]
Add left / right shift to expressions

9 years agoFix rlm_expr to use correct operator precedence.
Alan T. DeKok [Sun, 5 Oct 2014 14:02:27 +0000 (10:02 -0400)]
Fix rlm_expr to use correct operator precedence.

Along with attribute references.  And !1 and -1.
And attribute references.  And documentation.

9 years agoFix tmpl_from_attr_substr()
Alan T. DeKok [Sun, 5 Oct 2014 12:37:09 +0000 (08:37 -0400)]
Fix tmpl_from_attr_substr()

So that it stops at the first non-attribute character,
instead of erroring out.

Issues found by the new expression parser

9 years agoChange map function signatures to return errors and write alloced tmpl to out
Arran Cudbard-Bell [Sun, 5 Oct 2014 01:23:10 +0000 (02:23 +0100)]
Change map function signatures to return errors and write alloced tmpl to out

9 years agoFix typo
Arran Cudbard-Bell [Fri, 3 Oct 2014 00:57:14 +0000 (01:57 +0100)]
Fix typo

9 years agoRename map functions to be consistent with tmpl functions
Arran Cudbard-Bell [Fri, 3 Oct 2014 00:30:46 +0000 (01:30 +0100)]
Rename map functions to be consistent with tmpl functions

9 years agoFix editor error
Arran Cudbard-Bell [Fri, 3 Oct 2014 00:21:15 +0000 (01:21 +0100)]
Fix editor error

9 years agoFix argument order so ctx is always first
Arran Cudbard-Bell [Fri, 3 Oct 2014 00:19:08 +0000 (01:19 +0100)]
Fix argument order so ctx is always first

9 years agoReorder radius_exec_program arguments to be consistent with the rest of the server
Arran Cudbard-Bell [Thu, 2 Oct 2014 23:58:54 +0000 (00:58 +0100)]
Reorder radius_exec_program arguments to be consistent with the rest of the server

9 years agoUn-tagged attributes can *never* have tags
Alan T. DeKok [Thu, 2 Oct 2014 21:24:51 +0000 (17:24 -0400)]
Un-tagged attributes can *never* have tags

9 years agoFix typo
Arran Cudbard-Bell [Thu, 2 Oct 2014 20:00:46 +0000 (21:00 +0100)]
Fix typo

9 years agoWe should use strtol to parse tag and array indexes as strtoul still parses negative...
Arran Cudbard-Bell [Thu, 2 Oct 2014 19:59:52 +0000 (20:59 +0100)]
We should use strtol to parse tag and array indexes as strtoul still parses negative numbers into very large ones (which is confusing for users)

9 years agoThey're indexes not references...
Arran Cudbard-Bell [Thu, 2 Oct 2014 19:58:44 +0000 (20:58 +0100)]
They're indexes not references...

9 years agoFormatting
Arran Cudbard-Bell [Thu, 2 Oct 2014 19:33:11 +0000 (20:33 +0100)]
Formatting

9 years agoFix invalid request/list errors
Arran Cudbard-Bell [Thu, 2 Oct 2014 19:33:03 +0000 (20:33 +0100)]
Fix invalid request/list errors

9 years agoIndent condition error markers
Arran Cudbard-Bell [Thu, 2 Oct 2014 19:32:30 +0000 (20:32 +0100)]
Indent condition error markers

9 years agoI hate doxygen
Arran Cudbard-Bell [Thu, 2 Oct 2014 18:59:45 +0000 (19:59 +0100)]
I hate doxygen

9 years agoConvert the majority of tmpl functions to use a similar signature as the parse functions
Arran Cudbard-Bell [Thu, 2 Oct 2014 18:48:39 +0000 (19:48 +0100)]
Convert the majority of tmpl functions to use a similar signature as the parse functions

This means condition parsing error markers now extend into attribute references

9 years agoMove fr_canonicalize_error to log.c
Arran Cudbard-Bell [Thu, 2 Oct 2014 18:40:05 +0000 (19:40 +0100)]
Move fr_canonicalize_error to log.c

I still don't like the name, partly because now I have to remember how to spell canonicalize, and it seems like it should have double n's to me

9 years agoConvert tmpl_afrom_attr_substr to use a similar signature as other parsing functions
Arran Cudbard-Bell [Thu, 2 Oct 2014 13:51:48 +0000 (14:51 +0100)]
Convert tmpl_afrom_attr_substr to use a similar signature as other parsing functions

9 years agoAdd comment for fr_canonicalize_error
Arran Cudbard-Bell [Thu, 2 Oct 2014 13:43:24 +0000 (14:43 +0100)]
Add comment for fr_canonicalize_error

9 years agoOutput variables come first
Arran Cudbard-Bell [Thu, 2 Oct 2014 13:24:25 +0000 (14:24 +0100)]
Output variables come first

9 years agoTests for commas, too
Alan T. DeKok [Thu, 2 Oct 2014 13:35:38 +0000 (09:35 -0400)]
Tests for commas, too

9 years agoStop on comma and EOL, too
Alan T. DeKok [Thu, 2 Oct 2014 13:34:35 +0000 (09:34 -0400)]
Stop on comma and EOL, too

9 years agoFix comments after module reference.
Alan T. DeKok [Thu, 2 Oct 2014 13:32:30 +0000 (09:32 -0400)]
Fix comments after module reference.

ok # foo!

9 years agoAdd test for comments
Arran Cudbard-Bell [Thu, 2 Oct 2014 11:54:15 +0000 (12:54 +0100)]
Add test for comments

9 years agoFixup rlm_sqlcounter warnings
Arran Cudbard-Bell [Thu, 2 Oct 2014 11:38:11 +0000 (12:38 +0100)]
Fixup rlm_sqlcounter warnings

9 years agoHint that request and cmd should never be NULL in radius_exec_program
Arran Cudbard-Bell [Thu, 2 Oct 2014 09:47:28 +0000 (10:47 +0100)]
Hint that request and cmd should never be NULL in radius_exec_program

9 years agoChange logging in radius_exec_program to use R* macros
Arran Cudbard-Bell [Thu, 2 Oct 2014 09:44:07 +0000 (10:44 +0100)]
Change logging in radius_exec_program to use R* macros

RERROR should always be used where an error may indicate a failure of an external resource like a script, or database and we have the REQUEST available.

It outputs to the main server log like ERROR but also includes the request number, so multiple errors can be tied together when inspecting the log.

9 years agoChange eap_vp2packet to use fr_strerror_printf to output its errors
Arran Cudbard-Bell [Thu, 2 Oct 2014 09:40:25 +0000 (10:40 +0100)]
Change eap_vp2packet to use fr_strerror_printf to output its errors

Because "Malformed EAP message" as an error without any more detail is not useful