From: Dmitry Gutov <dmitry@gutov.dev>
To: Pengji Zhang <kunhtkun@gmail.com>, 68570@debbugs.gnu.org
Subject: bug#68570: 29.1; recompile might not re-use project-compile's buffer
Date: Sat, 20 Jan 2024 16:27:58 +0200 [thread overview]
Message-ID: <c40de7c4-b452-48d5-90ab-beb9e3bd32dc@gutov.dev> (raw)
In-Reply-To: <CANOCUixtWwwRR4S_uWsxd0n4u6t3aEx9tZhCe09y9cyByYX+xA@mail.gmail.com>
On 19/01/2024 22:19, Pengji Zhang wrote:
> I think you meant running `M-x recompile' not in a compilation buffer?
> While I agree that is convenient, I suppose it is better to only use
> `recompile' in a compilation buffer due to security reasons.
>
> `compile-command' is marked as a safe local variable assuming that the
> user would be prompted to check and confirm the command before running
> it. That is the behavior of `compile' but not `recompile'. For
> example, create a file '/tmp/test.c' with the following contents:
>
> /* Local Variables: */
> /* compile-command: "echo 1" */
> /* End: */
>
> Then:
> - emacs -Q --eval "(require 'compile)"
> - C-x C-f /tmp/test.c
> - M-x recompile
>
> So we could run arbitrary commands without any warning or confirmation.
It seems like you found a security issue in 'M-x recompile'. It's
orthogonal to this feature request, though.
> Instead of a `project-recompile' command, it might be better to make
> `recompile' find the existing compilation buffer for the current
> buffer, and refuse to run the command (or ask for confirmation) if
> there is no such buffer.
This sounds like a good plan for fixing the above issue.
But the step "find the existing compilation buffer for the current
buffer" requires compilation-buffer-name-function to be set to an
appropriate value. And project-compile only binds it temporarily.
next prev parent reply other threads:[~2024-01-20 14:27 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-18 16:17 bug#68570: 29.1; recompile might not re-use project-compile's buffer Jörg Bornemann
2024-01-19 20:19 ` Pengji Zhang
2024-01-20 14:27 ` Dmitry Gutov [this message]
2024-01-21 5:09 ` Dmitry Gutov
2024-01-21 18:18 ` Juri Linkov
2024-01-21 18:33 ` Dmitry Gutov
2024-01-22 7:31 ` Juri Linkov
2024-01-22 8:42 ` Jörg Bornemann
2024-01-22 18:20 ` Dmitry Gutov
2024-01-23 7:09 ` Juri Linkov
2024-01-23 12:21 ` Dmitry Gutov
2024-01-23 13:15 ` Jörg Bornemann
2024-01-23 17:31 ` Dmitry Gutov
2024-01-24 7:46 ` Juri Linkov
2024-01-24 12:06 ` Dmitry Gutov
2024-01-24 17:11 ` Juri Linkov
2024-01-26 0:44 ` Dmitry Gutov
2024-01-27 17:53 ` Juri Linkov
2024-01-28 13:42 ` Dmitry Gutov
2024-02-06 17:39 ` Juri Linkov
2024-02-07 18:43 ` Dmitry Gutov
2024-05-02 6:16 ` Juri Linkov
2024-05-02 7:11 ` Eli Zaretskii
2024-01-22 8:39 ` Jörg Bornemann
2024-01-22 18:20 ` Dmitry Gutov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c40de7c4-b452-48d5-90ab-beb9e3bd32dc@gutov.dev \
--to=dmitry@gutov.dev \
--cc=68570@debbugs.gnu.org \
--cc=kunhtkun@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.