🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: gmane.emacs.devel
8 messages
8 total messages Started by Joseph Turner Mon, 14 Aug 2023 22:40
[PATCH] Make ispell localwords safe local variable
#306719
Author: Joseph Turner
Date: Mon, 14 Aug 2023 22:40
49 lines
1428 bytes
--=-=-Content-Type: text/plain

Hello,

In this PR <https://github.com/alphapapa/makem.sh/pull/39>, we made it
possible for checkdoc/ispell to ignore localwords stored in a
.dir-locals.el when run in batch mode.

It seemed appropriate to upstream this fix.

Joseph


--=-=-Content-Type: text/x-diff
Content-Disposition: attachment;
 filename01-Make-ispell-localwords-safe-local-variable.patch

From 3af6882c316de7a551a0ce25cd7b6c35b93cd90b Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Mon, 14 Aug 2023 22:35:28 -0700
Subject: [PATCH] Make ispell localwords safe local variable

* lisp/textmodes/ispell.el (ispell-buffer-session-localwords):
Make safe local variable to so that checkdoc can ignore words in a
project in batch mode.
---
 lisp/textmodes/ispell.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 97c4ce9f32d..c73f92aa0b3 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1747,6 +1747,7 @@ Ispell is then restarted because the local words could conflict.")

 (defvar-local ispell-buffer-session-localwords nil
   "List of words accepted for session in this buffer.")
+(put 'ispell-buffer-session-localwords 'safe-local-variable #'list-of-strings-p)

 (defvar ispell-parser 'use-mode-name
   "Indicates whether ispell should parse the current buffer as TeX Code.
--
2.41.0


--=-=-=--

Re: [PATCH] Make ispell localwords safe local variable
#306726
Author: Eli Zaretskii
Date: Tue, 15 Aug 2023 14:56
13 lines
501 bytes
> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Date: Mon, 14 Aug 2023 22:40:24 -0700
>
> In this PR <https://github.com/alphapapa/makem.sh/pull/39>, we made it
> possible for checkdoc/ispell to ignore localwords stored in a
> .dir-locals.el when run in batch mode.
>
> It seemed appropriate to upstream this fix.

I'm not sure this is indeed safe enough.  We send these words to the
spell-checker; are we sure this couldn't be abused by malicious people
to perform some destructive actions?

Re: [PATCH] Make ispell localwords safe local variable
#306757
Author: Joseph Turner
Date: Tue, 15 Aug 2023 18:41
21 lines
700 bytes
Eli Zaretskii <eliz@gnu.org> writes:

>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> Date: Mon, 14 Aug 2023 22:40:24 -0700
>>
>> In this PR <https://github.com/alphapapa/makem.sh/pull/39>, we made it
>> possible for checkdoc/ispell to ignore localwords stored in a
>> .dir-locals.el when run in batch mode.
>>
>> It seemed appropriate to upstream this fix.
>
> I'm not sure this is indeed safe enough.  We send these words to the
> spell-checker; are we sure this couldn't be abused by malicious people
> to perform some destructive actions?

I am not sure. Unless someone can be certain that ispell can safely
handle arbitrary strings, I think it's prudent to discard this patch.

Joseph

Re: [PATCH] Make ispell localwords safe local variable
#306800
Author: Jim Porter
Date: Wed, 16 Aug 2023 10:12
14 lines
513 bytes
On 8/16/2023 5:20 AM, Eli Zaretskii wrote:
>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> Cc: emacs-devel@gnu.org
>> Date: Tue, 15 Aug 2023 18:41:18 -0700
>>
>> I am not sure. Unless someone can be certain that ispell can safely
>> handle arbitrary strings, I think it's prudent to discard this patch.
>
> Does anyone else have an opinion about this?

I'm not very familiar with how Emacs talks to ispell, but would the
proposed change here be any less safe than the buffer-local "LocalWords"
block?

Re: [PATCH] Make ispell localwords safe local variable
#306785
Author: Eli Zaretskii
Date: Wed, 16 Aug 2023 15:20
25 lines
895 bytes
> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Cc: emacs-devel@gnu.org
> Date: Tue, 15 Aug 2023 18:41:18 -0700
>
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> From: Joseph Turner <joseph@breatheoutbreathe.in>
> >> Date: Mon, 14 Aug 2023 22:40:24 -0700
> >>
> >> In this PR <https://github.com/alphapapa/makem.sh/pull/39>, we made it
> >> possible for checkdoc/ispell to ignore localwords stored in a
> >> .dir-locals.el when run in batch mode.
> >>
> >> It seemed appropriate to upstream this fix.
> >
> > I'm not sure this is indeed safe enough.  We send these words to the
> > spell-checker; are we sure this couldn't be abused by malicious people
> > to perform some destructive actions?
>
> I am not sure. Unless someone can be certain that ispell can safely
> handle arbitrary strings, I think it's prudent to discard this patch.

Does anyone else have an opinion about this?

Re: [PATCH] Make ispell localwords safe local variable
#306810
Author: Joseph Turner
Date: Wed, 16 Aug 2023 16:04
20 lines
677 bytes

On August 16, 2023 10:12:30 AM PDT, Jim Porter <jporterbugs@gmail.com> wrote:
>On 8/16/2023 5:20 AM, Eli Zaretskii wrote:
>>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>>> Cc: emacs-devel@gnu.org
>>> Date: Tue, 15 Aug 2023 18:41:18 -0700
>>> 
>>> I am not sure. Unless someone can be certain that ispell can safely
>>> handle arbitrary strings, I think it's prudent to discard this patch.
>> 
>> Does anyone else have an opinion about this?
>
>I'm not very familiar with how Emacs talks to ispell, but would the proposed change here be any less safe than the buffer-local "LocalWords" block?

(which are sent to ispell without user confirmation)

Re: [PATCH] Make ispell localwords safe local variable
#306812
Author: Richard Stallman
Date: Wed, 16 Aug 2023 22:00
32 lines
1308 bytes
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > >> In this PR <https://github.com/alphapapa/makem.sh/pull/39>, we made it
  > >> possible for checkdoc/ispell to ignore localwords stored in a
  > >> .dir-locals.el when run in batch mode.

  > > I'm not sure this is indeed safe enough.  We send these words to the
  > > spell-checker; are we sure this couldn't be abused by malicious people
  > > to perform some destructive actions?

  > I am not sure. Unless someone can be certain that ispell can safely
  > handle arbitrary strings, I think it's prudent to discard this patch.

Suppose it doesn't handle arbitrary strings -- what's the worst that
could happen?  Ispell would crash perhaps?

I think it would be ok to give users a chance to try using this and see

Another idea: scan the localwords for "reasonableness", perhaps if in
each word all the characters fit into certain classes of reasonable
characters for wrds.

--
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)



Re: [PATCH] Make ispell localwords safe local variable
#307208
Author: Eli Zaretskii
Date: Sat, 26 Aug 2023 11:10
26 lines
922 bytes
> Date: Wed, 16 Aug 2023 16:04:48 -0700
> From: Joseph Turner <joseph@breatheoutbreathe.in>
> CC: emacs-devel@gnu.org
>
>
>
> On August 16, 2023 10:12:30 AM PDT, Jim Porter <jporterbugs@gmail.com> wrote:
> >On 8/16/2023 5:20 AM, Eli Zaretskii wrote:
> >>> From: Joseph Turner <joseph@breatheoutbreathe.in>
> >>> Cc: emacs-devel@gnu.org
> >>> Date: Tue, 15 Aug 2023 18:41:18 -0700
> >>>
> >>> I am not sure. Unless someone can be certain that ispell can safely
> >>> handle arbitrary strings, I think it's prudent to discard this patch.
> >>
> >> Does anyone else have an opinion about this?
> >
> >I'm not very familiar with how Emacs talks to ispell, but would the proposed change here be any less safe than the buffer-local "LocalWords" block?
>
> (which are sent to ispell without user confirmation)

It sounds like no one sees a problem with this change, so I've now
installed it on the master branch.

Thanks.

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads