[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#648271: [debian-policy] 11.8.3 "Packages providing a terminal emulator" says xterm passes -e option straight to exec



Le 2011-12-25 03:28, Russ Allbery a écrit :
There's some mail client that seems to mangle messages that contain words
inside angle brackets.  Apparently Mozilla?  It's doing weird things to
the whitespace when you quote.

Hum, Icedove may be doing that indeed... sorry.
Filipus Klutiero<chealer@gmail.com>  writes:

I would simply suggest as a replacement:
      Support the command-line option "-e<command>", which creates a
      new terminal window and runs the specified simple command.
      <command>  may be multiple arguments, all of which are part of the
      simple command.  All arguments are passed directly to exec,
      bypassing the shell.  (xterm's behavior of falling back on using
      the shell if -e had a single argument and exec failed is
      permissible but not required.)
(<command>  could be replaced by<simple command>, but I think that will
be clear enough already.)
I'm not sure that simple command is going to be any more intuitive to
people for whom the mention of exec doesn't get it across.  Maybe we
should say something like "...specified simple command, by default not
using the shell"?  I can't tell if your main concern is clarifying that&&
or | or the like don't work, or something else.

I'm not sure what the main problem is. The problem which made me mention the ambiguity is the confusion between command name and shell command which was shown in #563352.

Again, about the suggestion of "by default not using the shell", I would avoid going into implementation. One formulation which could be both easier to understand and more exact than "simple command" would be "command name and an optional list of arguments".
But that matters for interoperability.  The point of this section is to be
able to issue the command:
      x-terminal-emulator -e vi 'some file'
and know that it works.  If you don't use exec, it won't.
I don't see why exec would be necessary. As long as the emulator
supports being given any simple command as its -e option, such commands
should work.
x-terminal-emulator -e vi 'some file' is required to edit the single file
named 'some file' (with a space), not two files, one named some and one
named file, which is the behavior you get if you pass the command to the
shell by using something like system().

It depends what command is given to system(). The command needs to be well-formed (quoted and escaped) to work and work as expected.

By the way, the command you give makes me realize that current policy not only specifies what values of -e should be supported, but how -e should be given ("interpreting the entirety of the rest of the command line as [...].") If we want

x-terminal-emulator -e vi 'some file'

to keep working as you say, policy shouldn't drop that requirement.



Reply to: