* bug#18476: 24.3.93; ede-emacs-version: Searching for program: no such file or directory, egrep
@ 2014-09-14 18:11 Lars Ljung
2014-09-15 20:16 ` David Engster
0 siblings, 1 reply; 8+ messages in thread
From: Lars Ljung @ 2014-09-14 18:11 UTC (permalink / raw)
To: 18476
Hi,
Every time I open a file in the Emacs source tree I see the message
"ede-emacs-version: Searching for program: no such file or directory,
egrep". Also, Emacs does not switch to the newly created buffer so I
have to switch to it manually.
This only happens on Windows, where I don't have egrep installed. It is
caused by line 86 in lisp/cedet/ede/emacs.el:
(call-process "egrep" nil buff nil "-n" "-e" "AC_INIT" configure_ac)
I don't think this line is even necessary. The file content is inserted
and parsed further down.
Kind regards,
Lars Ljung
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#18476: 24.3.93; ede-emacs-version: Searching for program: no such file or directory, egrep
2014-09-14 18:11 bug#18476: 24.3.93; ede-emacs-version: Searching for program: no such file or directory, egrep Lars Ljung
@ 2014-09-15 20:16 ` David Engster
2014-09-16 0:17 ` Stefan Monnier
0 siblings, 1 reply; 8+ messages in thread
From: David Engster @ 2014-09-15 20:16 UTC (permalink / raw)
To: Lars Ljung; +Cc: 18476
[-- Attachment #1: Type: text/plain, Size: 818 bytes --]
Lars Ljung writes:
> Every time I open a file in the Emacs source tree I see the message
> "ede-emacs-version: Searching for program: no such file or directory,
> egrep". Also, Emacs does not switch to the newly created buffer so I
> have to switch to it manually.
>
> This only happens on Windows, where I don't have egrep installed. It is
> caused by line 86 in lisp/cedet/ede/emacs.el:
>
> (call-process "egrep" nil buff nil "-n" "-e" "AC_INIT" configure_ac)
>
> I don't think this line is even necessary. The file content is inserted
> and parsed further down.
Indeed. That call to egrep seems to be some relict from the old
days. Additionally, we should also make sure that configure.ac or
configure.in exist.
Stefan, would it be OK to install the attached patch to emacs-24, or
should it go to trunk?
-David
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: ede-emacs-patch.diff --]
[-- Type: text/x-diff, Size: 990 bytes --]
=== modified file 'lisp/cedet/ede/emacs.el'
--- lisp/cedet/ede/emacs.el 2014-04-02 15:14:50 +0000
+++ lisp/cedet/ede/emacs.el 2014-09-15 20:10:45 +0000
@@ -82,10 +82,6 @@
(setq default-directory (file-name-as-directory dir))
(or (file-exists-p configure_ac)
(setq configure_ac "configure.in"))
- ;(call-process "egrep" nil buff nil "-n" "-e" "^version=" "Makefile")
- (call-process "egrep" nil buff nil "-n" "-e" "AC_INIT" configure_ac)
- (goto-char (point-min))
- ;(re-search-forward "version=\\([0-9.]+\\)")
(cond
;; Maybe XEmacs?
((file-exists-p "version.sh")
@@ -113,7 +109,8 @@
;; Insert other Emacs here...
;; Vaguely recent version of GNU Emacs?
- (t
+ ((or (file-exists-p configure_ac)
+ (file-exists-p (setq configure_ac "configure.in")))
(insert-file-contents configure_ac)
(goto-char (point-min))
(re-search-forward "AC_INIT(\\(?:GNU \\)?[eE]macs,\\s-*\\([0-9.]+\\)\\s-*[,)]")
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#18476: 24.3.93; ede-emacs-version: Searching for program: no such file or directory, egrep
2014-09-15 20:16 ` David Engster
@ 2014-09-16 0:17 ` Stefan Monnier
2014-09-16 6:13 ` David Engster
0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2014-09-16 0:17 UTC (permalink / raw)
To: Lars Ljung; +Cc: 18476
> Indeed. That call to egrep seems to be some relict from the old
> days. Additionally, we should also make sure that configure.ac or
> configure.in exist.
> Stefan, would it be OK to install the attached patch to emacs-24, or
> should it go to trunk?
The patch looks safe-ish, but I'm not sure what is its impact. Can you
explain when it hits?
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#18476: 24.3.93; ede-emacs-version: Searching for program: no such file or directory, egrep
2014-09-16 0:17 ` Stefan Monnier
@ 2014-09-16 6:13 ` David Engster
2014-09-16 13:50 ` Stefan Monnier
0 siblings, 1 reply; 8+ messages in thread
From: David Engster @ 2014-09-16 6:13 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 18476, Lars Ljung
Stefan Monnier writes:
>> Indeed. That call to egrep seems to be some relict from the old
>> days. Additionally, we should also make sure that configure.ac or
>> configure.in exist.
>
>> Stefan, would it be OK to install the attached patch to emacs-24, or
>> should it go to trunk?
>
> The patch looks safe-ish, but I'm not sure what is its impact. Can you
> explain when it hits?
It hits when the user has any kind of S?X?Emacs source code checked out
and
- has enabled EDE mode,
- has the Emacs source in a directory which is considered 'safe'
(w.r.t. ede-project-directories), and
- loads any file from the Emacs source.
Then EDE will try to detect the Emacs project (S?X?Emacs and version).
-David
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#18476: 24.3.93; ede-emacs-version: Searching for program: no such file or directory, egrep
2014-09-16 6:13 ` David Engster
@ 2014-09-16 13:50 ` Stefan Monnier
2014-09-16 21:33 ` David Engster
0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2014-09-16 13:50 UTC (permalink / raw)
To: David Engster; +Cc: 18476, Lars Ljung
> It hits when the user has any kind of S?X?Emacs source code checked
> out and
> - has enabled EDE mode,
OK, we can expect users to enable that, indeed.
> - has the Emacs source in a directory which is considered 'safe'
> (w.r.t. ede-project-directories), and
I.e. either ede-project-directories explicitly accepts this particular
directory or it's set to t. If the dir is explicitly listed, then we
can say "the user gets what she asked for". But indeed if it's t we
don't have that defense.
You say "safe" but the docstring of ede-project-directories doesn't
mention anything about safety or lack thereof. Is it dangerous to set
it to t?
By the way, looking at the code of ede-emacs-version, we need to fix all
those "match-string without checking the success of the previous
re-search-forward".
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#18476: 24.3.93; ede-emacs-version: Searching for program: no such file or directory, egrep
2014-09-16 13:50 ` Stefan Monnier
@ 2014-09-16 21:33 ` David Engster
2014-09-17 1:05 ` Stefan Monnier
0 siblings, 1 reply; 8+ messages in thread
From: David Engster @ 2014-09-16 21:33 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 18476, Lars Ljung
Stefan Monnier writes:
>> - has the Emacs source in a directory which is considered 'safe'
>> (w.r.t. ede-project-directories), and
>
> I.e. either ede-project-directories explicitly accepts this particular
> directory or it's set to t. If the dir is explicitly listed, then we
> can say "the user gets what she asked for". But indeed if it's t we
> don't have that defense.
>
> You say "safe" but the docstring of ede-project-directories doesn't
> mention anything about safety or lack thereof. Is it dangerous to set
> it to t?
I don't think so.
The Long Answer:
This variable was part of the EDE security fix which lead to the 23.4
release. If you remember, EDE used to simply evaluate the "Project.ede"
files to load a project - code is data, after all - but that made it
easy for an attacker to let your Emacs execute arbitrary code.
The "real" fix was that EDE now parses the Project.ede files if it
actually contains a project definition. However, that code which does
the parsing isn't really trivial, so we also added
`ede-project-directories' with 'nil' as default. The idea was that when
people create their own projects, those should get added
semi-automatically, but if you wanted to load external ones, you'd have
to add those directories by hand.
> By the way, looking at the code of ede-emacs-version, we need to fix all
> those "match-string without checking the success of the previous
> re-search-forward".
Yes, definitely. I can do that, but at least for the emacs-24 branch I
wanted to keep the patch short.
-David
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#18476: 24.3.93; ede-emacs-version: Searching for program: no such file or directory, egrep
2014-09-16 21:33 ` David Engster
@ 2014-09-17 1:05 ` Stefan Monnier
2014-09-18 20:40 ` David Engster
0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2014-09-17 1:05 UTC (permalink / raw)
To: David Engster; +Cc: 18476, Lars Ljung
> The "real" fix was that EDE now parses the Project.ede files if it
> actually contains a project definition. However, that code which does
> the parsing isn't really trivial, so we also added
> `ede-project-directories' with 'nil' as default. The idea was that when
> people create their own projects, those should get added
> semi-automatically, but if you wanted to load external ones, you'd have
> to add those directories by hand.
OK, if it doesn't end up taking some of that data and passing it to
`eval' or pushing it onto a hook or somesuch, then it's OK.
>> By the way, looking at the code of ede-emacs-version, we need to fix all
>> those "match-string without checking the success of the previous
>> re-search-forward".
> Yes, definitely. I can do that, but at least for the emacs-24 branch I
> wanted to keep the patch short.
OK, sounds fair. Please install the patch.
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-09-18 20:40 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-14 18:11 bug#18476: 24.3.93; ede-emacs-version: Searching for program: no such file or directory, egrep Lars Ljung
2014-09-15 20:16 ` David Engster
2014-09-16 0:17 ` Stefan Monnier
2014-09-16 6:13 ` David Engster
2014-09-16 13:50 ` Stefan Monnier
2014-09-16 21:33 ` David Engster
2014-09-17 1:05 ` Stefan Monnier
2014-09-18 20:40 ` David Engster
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.