On 3 Dec 1999, Jean-Marc Lasgouttes wrote:
> >>>>> "Jules" == Jules Bean <[EMAIL PROTECTED]> writes:
>
> Jules> Do you mean you're passing the arguments as one big string, not
> Jules> as separate arguments? This is dangerous, it relies on the
> Jules> quoting characteristics of the user's SHELL.
>
> Well, we use system() and this invokes sh, right? So on unix, the
> problems should be rare.
Yeah. system() will be OK if you trust the /bin/sh to do what you expect
on all systems. However, it's really hard to quote things properly (and,
IIRC, it is sometimes not possible, with some versions of bourne shell, to
quote something correctly)
>
> Jules> It's better to use functions like execl or execv.
>
> Yes, but some command lines are parameterized in lyxrc and some of
> them need stuff like redirection.
Redirection isn't too hard with fork() and exec().
Parameterised command lines shouldn't be a disaster, either.
Jules
/----------------+-------------------------------+---------------------\
| Jelibean aka | [EMAIL PROTECTED] | 6 Evelyn Rd |
| Jules aka | [EMAIL PROTECTED] | Richmond, Surrey |
| Julian Bean | [EMAIL PROTECTED] | TW9 2TF *UK* |
+----------------+-------------------------------+---------------------+
| War doesn't demonstrate who's right... just who's left. |
| When privacy is outlawed... only the outlaws have privacy. |
\----------------------------------------------------------------------/