ietf-mta-filters
[Top] [All Lists]

scoping and variables yet again

2005-09-16 05:45:16

I'm sorry, I don't think we have a clear consensus on this point yet.
so allow me to bring your attention to two suggestions for change in the
variables extension:

the text in -06:

        All variables have global scope: they are visible until
        processing stops.

this was deemed to be too risky security wise and allows too many feet
to be shot by accident when combined with "include".

before we discuss the wording, we should make sure we have consensus on
what the behaviour should be.

        a) an included script should not be allowed to change the
        variables in the parent script unless the parent script
        explicitly allows it.

        b) an included script should not be allowed to view the
        variables in the parent script unless the parent script
        explicitly allows it.

        c) the behaviour of a script should not change if it is included
        by a parent script rather than run standalone.

are everyone with me on this?


my suggestion is (text A), a complete reversal of behaviour:

    Variables are only visible to the currently running script.

the possibility of a different extension allowing a different scope is
implicit -- everything not forbidden can be overridden :-).  the usage
of the word "script" to mean a single fragment is consistent with other
Sieve documents.  e.g., an extension needs to be declared via "require"
in each script which uses it according to the base spec.

Aaron Stone's suggestion is similar in effect, I think (text B):

        All variables have global scope within a script. Future
        specifications may allow for a script to be composed of more
        than one file [part?], or for running more than one script per
        message [delivery?]. Such specifications may provide for
        different variable scoping rules.

it attempts to be more explicit, but I think it muddies more than it
clarifies, to be honest.

what is "global scope within a script"?  does this mean included scripts
are affected?  what is a "script"?  it may be unfortunate that we have
no established term for the collection of scripts into a bigger whole,
but as it is, I think "script" _is_ a single part (or file, or
fragment).

but before we discuss the wording, we should make sure we have consensus
on what the behaviour should be.


-- 
Kjetil T.

<Prev in Thread] Current Thread [Next in Thread>