Skip to content

Commit

Permalink
Check multiple instances of an attribute appear as an array
Browse files Browse the repository at this point in the history
  • Loading branch information
ndptech committed Sep 23, 2024
1 parent 793d9d9 commit db4ef54
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/tests/modules/perl/auth.attrs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
Packet-Type = Access-Request
User-Name = "baduser"
User-Password = "hello"
Vendor-Specific.Cisco.AVPair = "cisco=madness"
Vendor-Specific.Cisco.AVPair = "is=crazy"

#
# Expected answer
Expand Down
4 changes: 4 additions & 0 deletions src/tests/modules/perl/test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ sub authenticate {
# $RAD_REPLY{'Vendor-Specific.Cisco.h323-credit-amount'} = "1000000";
$RAD_REPLY{'Filter-Id'} = 'Everything'
} else {
# Check we received two values for Cisco.AVPair
if ($RAD_REQUEST{'Vendor-Specific'}{'Cisco'}{'AVPair'}[1] ne 'is=crazy') {
return RLM_MODULE_DISALLOW;
}
# $RAD_REPLY{'Vendor-Specific.Cisco.h323-credit-amount'} = "100";
$RAD_REPLY{'Filter-Id'} = 'Hello';
$RAD_REQUEST{'User-Name'} = 'tim';
Expand Down

0 comments on commit db4ef54

Please sign in to comment.