GNU bug report logs -
#6784
24.0.50; cmdproxy incosistency with command pathnames
Previous Next
Reported by: Óscar Fuentes <ofv <at> wanadoo.es>
Date: Tue, 3 Aug 2010 15:57:01 UTC
Severity: normal
Found in version 24.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Sun, 09 Jan 2011 19:59:56 +0200
with message-id <83ipxyj6ub.fsf <at> gnu.org>
and subject line Re: bug#6784: bug#7785: rgrep is broken on woe32
has caused the GNU bug report #6784,
regarding 24.0.50; cmdproxy incosistency with command pathnames
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
6784: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6784
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
A command path name that contains slashes (instead of backslashes) will
work fine with cmdproxy as far as it doesn't require to be executed
through a shell. Otherwise only backslashes work. Example:
cmdproxy.exe -c "c:/foo/bar.exe"
which executes bar.exe through CreateProces, works fine, but
cmdproxy.exe -c "c:/foo/bar.exe | zoo.exe"
which invokes the shell for executing the command, fails with an error
message that comes from cmd.exe and that says "c:" is not recognized as
a command.
OTOH,
cmdproxy.exe -c "c:\foo\bar.exe | zoo.exe"
works fine.
cmd.exe has no problem with commands that uses the slash as directory
separator, as this works OK:
cmd /c c:/foo/bar.exe
so the problem must be in cmdproxy, which probably splits the command as
"c:" "/foo/bar.exe"
and passes it as separate arguments to the shell.
Although this bug possibly is not hard to fix, maybe we should consider
the larger scenario: is it worth the trouble having two separate
execution paths on cmdproxy? Inconsistencies like this among the two
separate ways of executing commands may arise on the future, confusing
the users. Maybe we should remove the CreateProcess method and do
everything through the underlying shell.
[Message part 3 (message/rfc822, inline)]
> From: Chong Yidong <cyd <at> stupidchicken.com>
> Cc: Sam Steingold <sds <at> gnu.org>, 7785 <at> debbugs.gnu.org, 6784 <at> debbugs.gnu.org
> Date: Sat, 08 Jan 2011 16:00:43 -0500
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > The discussions in that bug report concluded that the program file
> > name after the pipe needs to be quoted, in order for it to work with
> > file names that use forward- and back-slashes alike. I can solve that
> > problem for rgrep (and for other similar commands) by tweaking the
> > templates used by grep.el, so as to quote the %s after the pipe
> > character `|'. Would that be an okay solution?
>
> I think this is an acceptable solution, and agree that changing cmdproxy
> to handle this intelligently sounds like a nightmare.
Okay, fixed in grep.el (revno 100367 on the emacs-23 branch).
> > The disadvantage is, of course, that similar solutions will have to be
> > implemented for each Emacs command that launches a shell pipeline.
>
> Let's just fix these individually as the problems are reported.
I found only 2 more instances of this that need to be fixed. One of
them is in jka-compr.el, where it calls `dd' in a pipe. I fixed that
one. The other one is in tramp.el, which uses shell pipelines a lot;
however, the only ones that need to be fixed are those that invoke
_local_ programs, not remote programs, as the latter will not be on a
Windows machine. Michael, could you please take care of that (on the
emacs-23 branch)? I gather that you have your master repository, so
doing it from there would be less hassle for you, and you know the
semantics of each pipeline better than I do. Thanks.
This bug report was last modified 14 years and 198 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.