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

N A asteriskteam at digium.com
Fri Jan 14 10:18:23 CST 2022


Attention is currently required from: Sean Bright, 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 1:

(1 comment)

File main/pbx_variables.c:

https://gerrit.asterisk.org/c/asterisk/+/17792/comment/d5123f85_cec4573b 
PS1, Line 155: int ast_varname_reserved(const char *name)
             : {
             : 	char *tmp = (char*) name;
             : 	/* Asterisk broadly reserves all uppercase + underscore var names for use by Asterisk */
             : 	while (*tmp) {
             : 		if (tmp[0] != '_' && !isupper(tmp[0])) {
             : 			return 0;
             : 		}
             : 		tmp++;
             : 	}
             : 	return 1;
             : }
> Users are free to use whatever casing they choose with their variables and that will not be changing […]
Au contraire, that *has* been the longstanding precedent, and if users are truly free to do whatever now, that would be a change. Administrators and users trying to do it 'correctly' avoid uppercase variable names, whether that's codified or not.

However, as I pointed out, with registration, we can be more or less sure about the existence of conflicts though, so warnings about this may not really be necessary anymore as it is.



-- 
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: 1
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-Attention: Sean Bright <sean at seanbright.com>
Gerrit-Attention: Kevin Harwell <kharwell at digium.com>
Gerrit-Comment-Date: Fri, 14 Jan 2022 16:18:23 +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: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220114/aeae87da/attachment.html>


More information about the asterisk-code-review mailing list