Hi Troels,

The exec() function should only be used in an emergency.  This is the
same problem as execfile() - this is a security issue as mentioned at
http://thread.gmane.org/gmane.science.nmr.relax.devel/5000/focus=5019.
 However as relax no longer supports Python 2.4 or lower, the exec()
code should be deleted.

Regards,

Edward




On 14 February 2014 11:22,  <[email protected]> wrote:
> Author: tlinnet
> Date: Fri Feb 14 11:22:56 2014
> New Revision: 22183
>
> URL: http://svn.gna.org/viewcvs/relax?rev=22183&view=rev
> Log:
> Second
>
> Modified:
>     trunk/prompt/interpreter.py
>
> Modified: trunk/prompt/interpreter.py
> URL: 
> http://svn.gna.org/viewcvs/relax/trunk/prompt/interpreter.py?rev=22183&r1=22182&r2=22183&view=diff
> ==============================================================================
> --- trunk/prompt/interpreter.py (original)
> +++ trunk/prompt/interpreter.py Fri Feb 14 11:22:56 2014
> @@ -266,12 +266,16 @@
>              readline.parse_and_bind("tab: complete")
>
>          # Execute the script file if given.
> -        if script_file:
> +        if script_file and not status.prompt:
>              # Turn on the user function intro flag.
>              status.uf_intro = True
>
>              # Run the script.
>              return run_script(intro=self.__intro_string, local=locals(), 
> script_file=script_file, show_script=self.__show_script, 
> raise_relax_error=self.__raise_relax_error)
> +
> +        if script_file and status.prompt:
> +            run_script(intro=self.__intro_string, local=locals(), 
> script_file=script_file, show_script=self.__show_script, 
> raise_relax_error=self.__raise_relax_error)
> +            prompt(intro=None, local=locals())
>
>          # Go to the prompt.
>          else:
> @@ -333,12 +337,13 @@
>          sys.path.reverse()
>
>          # Execute the script as a module.
> -        if dep_check.runpy_module:
> -            runpy.run_module(module, globals)
> +        #if dep_check.runpy_module:
> +        #    runpy.run_module(module, globals)
>
>          # Allow scripts to run under Python <= 2.4.
> -        else:
> -            exec(compile(open(name).read(), name, 'exec'), globals)
> +        #else:
> +        #    exec(compile(open(name).read(), name, 'exec'), globals)
> +        exec(compile(open(name).read(), name, 'exec'), globals)
>
>      finally:
>          # Switch back to the original working directory.
>
>
> _______________________________________________
> relax (http://www.nmr-relax.com)
>
> This is the relax-commits mailing list
> [email protected]
>
> To unsubscribe from this list, get a password
> reminder, or change your subscription options,
> visit the list information page at
> https://mail.gna.org/listinfo/relax-commits

_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-devel mailing list
[email protected]

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel

Reply via email to