Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed RAD_CONFIG entry in Perl #715

Merged
merged 1 commit into from Jun 27, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion raddb/mods-available/perl
Expand Up @@ -17,7 +17,7 @@ perl {
# The following hashes are given to the module and
# filled with value-pairs (Attribute names and values)
#
# %RAD_CHECK Check items
# %RAD_CONFIG Config items (was %RAD_CHECK)
# %RAD_REQUEST Attributes from the request
# %RAD_REPLY Attributes for the reply
# %RAD_REQUEST_PROXY Attributes from the proxied request
Expand Down
6 changes: 3 additions & 3 deletions raddb/mods-config/perl/example.pl
Expand Up @@ -34,14 +34,14 @@
use Data::Dumper;

# Bring the global hashes into the package scope
our (%RAD_REQUEST, %RAD_REPLY, %RAD_CHECK);
our (%RAD_REQUEST, %RAD_REPLY, %RAD_CONFIG);

# This is hash wich hold original request from radius
#my %RAD_REQUEST;
# In this hash you add values that will be returned to NAS.
#my %RAD_REPLY;
#This is for check items
#my %RAD_CHECK;
#This is for config items (was %RAD_CHECK in earlier versions)
#my %RAD_CONFIG;
# This is configuration items from "config" perl module configuration section
#my %RAD_PERLCONF;

Expand Down
9 changes: 3 additions & 6 deletions src/modules/rlm_perl/rlm_perl.c
Expand Up @@ -743,7 +743,7 @@ static int get_hv_content(TALLOC_CTX *ctx, REQUEST *request, HV *my_hv, VALUE_PA

/*
* Call the function_name inside the module
* Store all vps in hashes %RAD_CHECK %RAD_REPLY %RAD_REQUEST
* Store all vps in hashes %RAD_CONFIG %RAD_REPLY %RAD_REQUEST
*
*/
static int do_perl(void *instance, REQUEST *request, char const *function_name)
Expand All @@ -755,7 +755,6 @@ static int do_perl(void *instance, REQUEST *request, char const *function_name)
STRLEN n_a;

HV *rad_reply_hv;
HV *rad_check_hv;
HV *rad_config_hv;
HV *rad_request_hv;
#ifdef WITH_PROXY
Expand Down Expand Up @@ -792,12 +791,10 @@ static int do_perl(void *instance, REQUEST *request, char const *function_name)
SAVETMPS;

rad_reply_hv = get_hv("RAD_REPLY", 1);
rad_check_hv = get_hv("RAD_CHECK", 1);
rad_config_hv = get_hv("RAD_CONFIG", 1);
rad_request_hv = get_hv("RAD_REQUEST", 1);

perl_store_vps(request->reply, request, request->reply->vps, rad_reply_hv, "RAD_REPLY", "reply");
perl_store_vps(request, request, request->config_items, rad_check_hv, "RAD_CHECK", "control");
perl_store_vps(request->packet, request, request->packet->vps, rad_request_hv, "RAD_REQUEST", "request");
perl_store_vps(request, request, request->config_items, rad_config_hv, "RAD_CONFIG", "control");

Expand Down Expand Up @@ -825,7 +822,7 @@ static int do_perl(void *instance, REQUEST *request, char const *function_name)
* This way %RAD_xx can be pushed onto stack as sub parameters.
* XPUSHs( newRV_noinc((SV *)rad_request_hv) );
* XPUSHs( newRV_noinc((SV *)rad_reply_hv) );
* XPUSHs( newRV_noinc((SV *)rad_check_hv) );
* XPUSHs( newRV_noinc((SV *)rad_config_hv) );
* PUTBACK;
*/

Expand Down Expand Up @@ -873,7 +870,7 @@ static int do_perl(void *instance, REQUEST *request, char const *function_name)
vp = NULL;
}

if ((get_hv_content(request, request, rad_check_hv, &vp, "RAD_CHECK", "control")) == 0) {
if ((get_hv_content(request, request, rad_config_hv, &vp, "RAD_CONFIG", "control")) == 0) {
pairfree(&request->config_items);
request->config_items = vp;
vp = NULL;
Expand Down