unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* ses-mode runs unsafe functions even if you say "n" when prompted
@ 2007-09-20 20:43 Michael Schierl
  2007-09-22 18:42 ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Schierl @ 2007-09-20 20:43 UTC (permalink / raw)
  To: bug-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:
----------


- Start Emacs -Q
- load the attached bug.ses file
- Replace the number 42 by another number
- Answer "n" to the message that appears

Formula (progn A1 (kill-emacs) 11)
might be unsafe (function kill-emacs).  Process it? (y or n)

- Watch emacs to close anyway

Expected result: Emacs should not run the function when you say "n".


----------
In GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600)
 of 2007-06-02 on RELEASE
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --cflags -Ic:/gnuwin32/include'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: DEU
  locale-coding-system: cp1252
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  encoded-kbd-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent input:
M-x r e p o r t <tab> <return>

Recent messages:
("D:\\Progs\\emacs\\bin\\emacs.exe" "-q")
Loading encoded-kb...done
For information about the GNU Project and its goals, type C-h C-p. [2 times]
Loading emacsbug...
Loading regexp-opt...done
Loading emacsbug...done

[-- Attachment #2: bug.ses --]
[-- Type: text/plain, Size: 360 bytes --]

     42
     11

\f
(ses-cell A1 42 (progn (kill-emacs) A2 42) nil (A2))

(ses-cell A2 11 (progn A1 (kill-emacs) 11) nil (A1))

(ses-column-widths [7])
(ses-column-printers [nil])
(ses-default-printer "%.7g")
(ses-header-row 0)

( ;Global parameters (these are read first)
 2 ;SES file-format
 2 ;numrows
 1 ;numcols
)

;; Local Variables:
;; mode: ses
;; End:

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ses-mode runs unsafe functions even if you say "n" when prompted
  2007-09-20 20:43 ses-mode runs unsafe functions even if you say "n" when prompted Michael Schierl
@ 2007-09-22 18:42 ` Glenn Morris
  2007-09-22 22:00   ` Michael Schierl
  0 siblings, 1 reply; 3+ messages in thread
From: Glenn Morris @ 2007-09-22 18:42 UTC (permalink / raw)
  To: Michael Schierl; +Cc: bug-gnu-emacs

Michael Schierl wrote:

> Formula (progn A1 (kill-emacs) 11)
> might be unsafe (function kill-emacs).  Process it? (y or n)
>
> - Watch emacs to close anyway

Thanks. Can you try this patch please (apply to ses.el, then
byte-compile the file).


*** lisp/ses.el 25 Jul 2007 04:47:03 -0000      1.30.2.3
--- lisp/ses.el 22 Sep 2007 02:47:02 -0000
***************
*** 628,635 ****
      (let ((oldval  (ses-cell-value   cell))
          (formula (ses-cell-formula cell))
          newval)
!       (if (eq (car-safe formula) 'ses-safe-formula)
!         (ses-set-cell row col 'formula (ses-safe-formula (cadr formula))))
        (condition-case sig
          (setq newval (eval formula))
        (error
--- 628,636 ----
      (let ((oldval  (ses-cell-value   cell))
          (formula (ses-cell-formula cell))
          newval)
!       (when (eq (car-safe formula) 'ses-safe-formula)
!       (setq formula (ses-safe-formula (cadr formula)))
!       (ses-set-cell row col 'formula formula))
        (condition-case sig
          (setq newval (eval formula))
        (error




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ses-mode runs unsafe functions even if you say "n" when prompted
  2007-09-22 18:42 ` Glenn Morris
@ 2007-09-22 22:00   ` Michael Schierl
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Schierl @ 2007-09-22 22:00 UTC (permalink / raw)
  To: Glenn Morris; +Cc: bug-gnu-emacs

Glenn Morris schrieb:
> Michael Schierl wrote:
> 
>> Formula (progn A1 (kill-emacs) 11)
>> might be unsafe (function kill-emacs).  Process it? (y or n)
>>
>> - Watch emacs to close anyway
> 
> Thanks. Can you try this patch please (apply to ses.el, then
> byte-compile the file).

The indentation of your patch is a bit unusual, but it works fine (after
applying it with -l).

Michael




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-09-22 22:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-20 20:43 ses-mode runs unsafe functions even if you say "n" when prompted Michael Schierl
2007-09-22 18:42 ` Glenn Morris
2007-09-22 22:00   ` Michael Schierl

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).