GNU bug report logs - #18476
24.3.93; ede-emacs-version: Searching for program: no such file or directory, egrep

Previous Next

Package: emacs;

Reported by: Lars Ljung <lars <at> matholka.se>

Date: Sun, 14 Sep 2014 18:12:01 UTC

Severity: normal

Found in version 24.3.93

Done: David Engster <david <at> engster.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 18476 in the body.
You can then email your comments to 18476 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#18476; Package emacs. (Sun, 14 Sep 2014 18:12:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lars Ljung <lars <at> matholka.se>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 14 Sep 2014 18:12:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lars Ljung <lars <at> matholka.se>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.93; ede-emacs-version: Searching for program: no such file or
 directory, egrep
Date: Sun, 14 Sep 2014 20:11:03 +0200
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18476; Package emacs. (Mon, 15 Sep 2014 20:17:01 GMT) Full text and rfc822 format available.

Message #8 received at 18476 <at> debbugs.gnu.org (full text, mbox):

From: David Engster <deng <at> randomsample.de>
To: Lars Ljung <lars <at> matholka.se>
Cc: 18476 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#18476: 24.3.93;
 ede-emacs-version: Searching for program: no such file or directory,
 egrep
Date: Mon, 15 Sep 2014 22:16:10 +0200
[Message part 1 (text/plain, inline)]
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

[ede-emacs-patch.diff (text/x-diff, inline)]
=== 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-*[,)]")


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18476; Package emacs. (Tue, 16 Sep 2014 00:19:01 GMT) Full text and rfc822 format available.

Message #11 received at 18476 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Ljung <lars <at> matholka.se>
Cc: 18476 <at> debbugs.gnu.org
Subject: Re: bug#18476: 24.3.93;
 ede-emacs-version: Searching for program: no such file or directory,
 egrep
Date: Mon, 15 Sep 2014 20:17:52 -0400
> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18476; Package emacs. (Tue, 16 Sep 2014 06:14:02 GMT) Full text and rfc822 format available.

Message #14 received at 18476 <at> debbugs.gnu.org (full text, mbox):

From: David Engster <deng <at> randomsample.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 18476 <at> debbugs.gnu.org, Lars Ljung <lars <at> matholka.se>
Subject: Re: bug#18476: 24.3.93;
 ede-emacs-version: Searching for program: no such file or directory,
 egrep
Date: Tue, 16 Sep 2014 08:13:05 +0200
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18476; Package emacs. (Tue, 16 Sep 2014 13:52:02 GMT) Full text and rfc822 format available.

Message #17 received at 18476 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: David Engster <deng <at> randomsample.de>
Cc: 18476 <at> debbugs.gnu.org, Lars Ljung <lars <at> matholka.se>
Subject: Re: bug#18476: 24.3.93;
 ede-emacs-version: Searching for program: no such file or directory,
 egrep
Date: Tue, 16 Sep 2014 09:50:26 -0400
> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18476; Package emacs. (Tue, 16 Sep 2014 21:34:02 GMT) Full text and rfc822 format available.

Message #20 received at 18476 <at> debbugs.gnu.org (full text, mbox):

From: David Engster <deng <at> randomsample.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 18476 <at> debbugs.gnu.org, Lars Ljung <lars <at> matholka.se>
Subject: Re: bug#18476: 24.3.93;
 ede-emacs-version: Searching for program: no such file or directory,
 egrep
Date: Tue, 16 Sep 2014 23:33:22 +0200
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18476; Package emacs. (Wed, 17 Sep 2014 01:06:02 GMT) Full text and rfc822 format available.

Message #23 received at 18476 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: David Engster <deng <at> randomsample.de>
Cc: 18476 <at> debbugs.gnu.org, Lars Ljung <lars <at> matholka.se>
Subject: Re: bug#18476: 24.3.93;
 ede-emacs-version: Searching for program: no such file or directory,
 egrep
Date: Tue, 16 Sep 2014 21:05:40 -0400
> 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




Reply sent to David Engster <david <at> engster.org>:
You have taken responsibility. (Thu, 18 Sep 2014 20:41:02 GMT) Full text and rfc822 format available.

Notification sent to Lars Ljung <lars <at> matholka.se>:
bug acknowledged by developer. (Thu, 18 Sep 2014 20:41:03 GMT) Full text and rfc822 format available.

Message #28 received at 18476-done <at> debbugs.gnu.org (full text, mbox):

From: David Engster <david <at> engster.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Lars Ljung <lars <at> matholka.se>, 18476-done <at> debbugs.gnu.org
Subject: Re: bug#18476: 24.3.93;
 ede-emacs-version: Searching for program: no such file or directory,
 egrep
Date: Thu, 18 Sep 2014 22:40:01 +0200
Stefan Monnier writes:
> OK, sounds fair.  Please install the patch.

Done.

-David




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 17 Oct 2014 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 306 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.