goerz / gc3pie

Automatically exported from code.google.com/p/gc3pie
0 stars 0 forks source link

Use argv-style arrays internally to represent commands #285

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
1) What part of the model would need changes:

The interfaces of backends and transport.

2) What is the reason why the changes is proposed:

Correct handling of arguments containing shell metacharacters.

3) What is the proposal:

All functions/methods that deal with "executing a command line" take
an "argv-array"[1] instead of a string.  An argv-array is defined as a
Python list `args` where `args[0]` is the command to run, and
`args[1:]` are the arguments to pass to it *verbatim*.

It responsibility of the backend/transport to convert the argv-array
to a string if that is needed (e.g., in SshTransport)

Original issue reported on code.google.com by riccardo.murri@gmail.com on 8 Aug 2012 at 6:48

GoogleCodeExporter commented 9 years ago

Original comment by riccardo.murri@gmail.com on 17 Aug 2012 at 11:46

GoogleCodeExporter commented 9 years ago
In addition, we should ensure that consistent quoting is applied to
all arguments. (The functions `sh_quote_safe` and `sh_quote_unsafe` in
`gc3libs.utils` were made for this purpose.)

In theory, `sh_quote_safe` is the way to go.  However, the ARC backend
does the equivalent of `sh_quote_unsafe` and some Application objects
depend on it, e.g., using an environment variable instead of the
path/name of a command.

So, apply `sh_quote_unsafe` to all argv-vectors in every backend
except ARC (the ARC middleware already does this on their own).

Original comment by riccardo.murri@gmail.com on 18 Jan 2013 at 9:54

GoogleCodeExporter commented 9 years ago
Also see issue 465 re: the quoting issue.

Original comment by riccardo.murri@gmail.com on 13 Oct 2014 at 3:35

GoogleCodeExporter commented 9 years ago

Original comment by riccardo.murri@gmail.com on 14 Oct 2014 at 10:04