[Asterisk-code-review] pbx_variables: Add variable registration and validation (asterisk[master])

N A asteriskteam at digium.com
Mon May 9 08:24:17 CDT 2022


Attention is currently required from: Sean Bright, Joshua Colp, George Joseph, Kevin Harwell.
N A has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/17792 )

Change subject: pbx_variables: Add variable registration and validation
......................................................................


Patch Set 4:

(1 comment)

Patchset:

PS4: 
> > I removed the idea of "reserved" in patch set 4. […]
Are you referring to this bit here? https://gerrit.asterisk.org/c/asterisk/+/17792/4/main/pbx_variables.c#220

"Special" variable here means trying to see a variable Asterisk is already using, like EXTEN or UNIQUEID or something like that (NOT merely a variable in all caps), that the user can't actually legitimately set, or something that isn't supposed to get set. So that's kind of the idea here. Variables are registered into the core, partly so that users can be prevented from trying to set variables they can't or shouldn't.

If the time to find a variable before was C, the actual time should not be any more than 2C, so this essentially comes for free. Additionally, if a user isn't using all-caps variables, the list never gets iterated since there's no way it would be registered. It would literally have no impact at all. That's the bit I think was getting confused as "preventing users from setting all-caps variables". It does not. That is merely an optimization technique.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/17792
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Iad3b8d9833c7d9debe04aca59260d7316c3ad28c
Gerrit-Change-Number: 17792
Gerrit-PatchSet: 4
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-CC: Joshua Colp <jcolp at sangoma.com>
Gerrit-Attention: Sean Bright <sean at seanbright.com>
Gerrit-Attention: Joshua Colp <jcolp at sangoma.com>
Gerrit-Attention: George Joseph <gjoseph at digium.com>
Gerrit-Attention: Kevin Harwell <kharwell at digium.com>
Gerrit-Comment-Date: Mon, 09 May 2022 13:24:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Sean Bright <sean at seanbright.com>
Comment-In-Reply-To: N A <mail at interlinked.x10host.com>
Comment-In-Reply-To: George Joseph <gjoseph at digium.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220509/bb92a8f4/attachment.html>


More information about the asterisk-code-review mailing list