[ASTPPCOM-248] IP MAP Settings - Bug. Created: 14/Oct/17  Updated: 01/Apr/21  Resolved: 01/Apr/21

Status: Done
Project: ASTPP Community
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature
Reporter: countrdd Assignee: Samir Doshi
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The system is not honoring an inactive prefix/ip combination.
The select statement is not checking for status =0. So if the IP Mapping Record is inactive it still allows the IPauthentication to pass.

Select statement (at line 129) should be changed to:

local query = "SELECT "..TBL_IP_MAP.."., (SELECT number FROM "..TBL_USERS.." where id=accountid AND status=0 AND deleted=0) AS account_code FROM "..TBL_IP_MAP.." WHERE ((INET_ATON(\"" .. from_ip.. "\") & (0xFFFFFFFF & (-1 << 32 - SUBSTRING_INDEX(ip, '/',-1)))) = ((0xFFFFFFFF & (-1 << 32 - SUBSTRING_INDEX(ip, '/',-1))) & INET_ATON(SUBSTRING_INDEX(ip,'/',1)))) __AND (status =0)* AND ((SUBSTRING( ip, 1, CHAR_LENGTH( ip ) -3 ) = \"" .. from_ip.. "\" AND prefix IN (NULL,'')) OR (SUBSTRING( ip, 1, CHAR_LENGTH( ip ) -3 ) = \"" .. from_ip.. "\" AND \"" .. destination_number .. "\" RLIKE prefix)) ORDER BY LENGTH(prefix) DESC LIMIT 1"



 Comments   
Comment by Samir Doshi [ 25/Oct/17 ]

Thanks [~countrdd]
Patch applied.

Generated at Sat Feb 10 07:15:28 CET 2024 using Jira 8.13.3#813003-sha1:22ebedbb75c99b147c66f14e031dd8a2d214753a.