unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#2428: 23.0.90; sendmail-send-it not checking for call-process-region's return value properly
@ 2009-02-21 22:45 ` tcr
  2009-02-25  4:00   ` Glenn Morris
  2009-02-26  4:00   ` bug#2428: marked as done (23.0.90; sendmail-send-it not checking for call-process-region's return value properly) Emacs bug Tracking System
  0 siblings, 2 replies; 4+ messages in thread
From: tcr @ 2009-02-21 22:45 UTC (permalink / raw)
  To: emacs-pretest-bug


`sendmail-send-it' invokes `call-process-region' but doesn't check for
the case when the latter returns a string to indicate an error value.

This results in a backtrace like

  Debugger entered--Lisp error: (error "Format specifier doesn't match argument type")
    format("Sending...failed with exit value %d" "Broken pipe")
    apply(format ("Sending...failed with exit value %d" "Broken pipe"))
    error("Sending...failed with exit value %d" "Broken pipe")
    sendmail-send-it()
    mail-send()
    mail-send-and-exit(nil)
    call-interactively(mail-send-and-exit nil nil)

The following patch fixes that

--- lisp/mail/sendmail.el	2009-02-07 04:02:39.000000000 +0100
+++ lisp/mail/sendmail.el-hacked	2009-02-21 23:37:44.000000000 +0100
@@ -1168,8 +1168,13 @@
 			      )
 		      )
 		     (exit-value (apply 'call-process-region args)))
-		(or (null exit-value) (eq 0 exit-value)
-		    (error "Sending...failed with exit value %d" exit-value)))
+		(cond ((or (null exit-value) (eq 0 exit-value)))
+                      ((numberp exit-value)
+                       (error "Sending...failed with exit value %d" exit-value))
+                      ((stringp exit-value)
+                       (error "Sending...terminated by signal: %s" exit-value))
+                      (t 
+                       (error "SENDMAIL-SEND-IT -- fall through: %S" exit-value))))
 	    (or fcc-was-found
 		(error "No recipients")))
 	  (if mail-interactive


In GNU Emacs 23.0.90.4 (i686-pc-linux-gnu, GTK+ Version 2.12.9)
 of 2009-02-21 on thaleron
Windowing system distributor `The X.Org Foundation', version 11.0.10400090
configured using `configure  '--prefix=/home/tcr/software/emacs-cvs' '--with-x-toolkit=gtk' '--without-gpm' '--with-x' '--without-xpm' '--enable-asserts' 'CFLAGS=-g''

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: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Group

Minor modes in effect:
  gnus-topic-mode: t
  gnus-undo-mode: t
  diff-auto-refine-mode: t
  tooltip-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
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
L S-SPC T R H O U G H . <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> M-l M-l <left> <left> <left> <left> <left> <backspace> 
<right> r <right> <right> <right> <right> <right> <right> 
<right> <left> <left> <backspace> : SPC % S <right> 
<right> <left> SPC e x i t - v a l u e <switch-frame> 
<down-mouse-5> <mouse-5> <double-down-mouse-5> <double-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <down-mouse-4> 
<mouse-4> <down-mouse-1> <mouse-1> <double-down-mouse-1> 
<double-mouse-1> u <help-echo> <switch-frame> <down-mouse-1> 
<mouse-movement> <mouse-1> C-M-k <up> ( o r C-) C-M-f 
SPC C-y <down> C-a C-k C-k C-x C-s C-M-x <switch-frame> 
<down-mouse-1> <mouse-movement> <mouse-1> C-x b C-g 
C-x C-b C-x o <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <return> q <up> <up> <up> <up> 
<down> C-x o M-x r e p o r t - e m <tab> <return> f 
o o <return> y <up> <up> <up> <up> <right> <right> 
<right> <right> C-k t c r @ f r e e b i t s . d e C-c 
C-c y e s <return> <switch-frame> C-x C-s <switch-frame> 
<down-mouse-1> <mouse-movement> <mouse-1> M-x g n u 
s <return> y <help-echo> <switch-frame> <down-mouse-1> 
<mouse-1> C-x C-f <help-echo> <switch-frame> <down-mouse-1> 
<mouse-1> M-x <switch-frame> <down-mouse-1> <mouse-movement> 
<mouse-1> M-x r e p o r t - e m a c s - b u g s <return> 
<M-backspace> b <tab> <return> F o o <return> y <up> 
<up> <up> <right> <right> <right> <up> <right> C-k 
t c r @ f r e e b i t s d e <backspace> <backspace> 
. d e C-c C-c y e s <return> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <help-echo> 
<down> <down> <down> <down> <down> <down> C-a C-SPC 
M-> C-w C-y C-x b <return> M-x r e p r <backspace> 
o r t <tab> <return>

Recent messages:
gnus-all-windows-visible-p: Invalid buffer type: if
Auto-saving...
ffap-read-file-or-url: Command attempted to use minibuffer while in minibuffer
Unsent message being composed; erase it? (y or n) 
Auto save file for draft message exists; consider M-x mail-recover
Sending...
smtpmail-open-stream: Autoloading failed to define function starttls-any-program-available
Auto-saving...done
Mark set [2 times]
Auto-saving...

-- 
Diese Nachricht wurde auf Viren und andere gefaerliche Inhalte untersucht
und ist - aktuelle Virenscanner vorausgesetzt - sauber.
Freebits E-Mail Virus Scanner







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

* bug#2428: 23.0.90; sendmail-send-it not checking for call-process-region's return value properly
  2009-02-21 22:45 ` bug#2428: 23.0.90; sendmail-send-it not checking for call-process-region's return value properly tcr
@ 2009-02-25  4:00   ` Glenn Morris
  2009-02-25 11:08     ` Tobias C. Rittweiler
  2009-02-26  4:00   ` bug#2428: marked as done (23.0.90; sendmail-send-it not checking for call-process-region's return value properly) Emacs bug Tracking System
  1 sibling, 1 reply; 4+ messages in thread
From: Glenn Morris @ 2009-02-25  4:00 UTC (permalink / raw)
  To: tcr; +Cc: 2428

tcr@freebits.de wrote:

> The following patch fixes that

OK. Do you have a name for the ChangeLog entry?






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

* bug#2428: 23.0.90; sendmail-send-it not checking for call-process-region's return value properly
  2009-02-25  4:00   ` Glenn Morris
@ 2009-02-25 11:08     ` Tobias C. Rittweiler
  0 siblings, 0 replies; 4+ messages in thread
From: Tobias C. Rittweiler @ 2009-02-25 11:08 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 2428

Glenn Morris <rgm@gnu.org> writes:

> tcr@freebits.de wrote:
>
>> The following patch fixes that
>
> OK. Do you have a name for the ChangeLog entry?

Tobias C. Rittweiler.

-- 
Diese Nachricht wurde auf Viren und andere gefaerliche Inhalte untersucht
und ist - aktuelle Virenscanner vorausgesetzt - sauber.
Freebits E-Mail Virus Scanner







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

* bug#2428: marked as done (23.0.90; sendmail-send-it not checking  for call-process-region's return value properly)
  2009-02-21 22:45 ` bug#2428: 23.0.90; sendmail-send-it not checking for call-process-region's return value properly tcr
  2009-02-25  4:00   ` Glenn Morris
@ 2009-02-26  4:00   ` Emacs bug Tracking System
  1 sibling, 0 replies; 4+ messages in thread
From: Emacs bug Tracking System @ 2009-02-26  4:00 UTC (permalink / raw)
  To: Glenn Morris

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


Your message dated Wed, 25 Feb 2009 22:52:50 -0500
with message-id <y7skm1q2gd.fsf@fencepost.gnu.org>
and subject line Re: bug#2428: 23.0.90; sendmail-send-it not checking for call-process-region's return value properly
has caused the Emacs bug report #2428,
regarding 23.0.90; sendmail-send-it not checking for call-process-region's return value properly
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
2428: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=2428
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 7172 bytes --]

From: tcr@freebits.de
To: emacs-pretest-bug@gnu.org
Subject: 23.0.90; sendmail-send-it not checking for call-process-region's return value properly
Date: Sat, 21 Feb 2009 23:45:02 +0100
Message-ID: <87wsbjs93l.fsf@freebits.de>


`sendmail-send-it' invokes `call-process-region' but doesn't check for
the case when the latter returns a string to indicate an error value.

This results in a backtrace like

  Debugger entered--Lisp error: (error "Format specifier doesn't match argument type")
    format("Sending...failed with exit value %d" "Broken pipe")
    apply(format ("Sending...failed with exit value %d" "Broken pipe"))
    error("Sending...failed with exit value %d" "Broken pipe")
    sendmail-send-it()
    mail-send()
    mail-send-and-exit(nil)
    call-interactively(mail-send-and-exit nil nil)

The following patch fixes that

--- lisp/mail/sendmail.el	2009-02-07 04:02:39.000000000 +0100
+++ lisp/mail/sendmail.el-hacked	2009-02-21 23:37:44.000000000 +0100
@@ -1168,8 +1168,13 @@
 			      )
 		      )
 		     (exit-value (apply 'call-process-region args)))
-		(or (null exit-value) (eq 0 exit-value)
-		    (error "Sending...failed with exit value %d" exit-value)))
+		(cond ((or (null exit-value) (eq 0 exit-value)))
+                      ((numberp exit-value)
+                       (error "Sending...failed with exit value %d" exit-value))
+                      ((stringp exit-value)
+                       (error "Sending...terminated by signal: %s" exit-value))
+                      (t 
+                       (error "SENDMAIL-SEND-IT -- fall through: %S" exit-value))))
 	    (or fcc-was-found
 		(error "No recipients")))
 	  (if mail-interactive


In GNU Emacs 23.0.90.4 (i686-pc-linux-gnu, GTK+ Version 2.12.9)
 of 2009-02-21 on thaleron
Windowing system distributor `The X.Org Foundation', version 11.0.10400090
configured using `configure  '--prefix=/home/tcr/software/emacs-cvs' '--with-x-toolkit=gtk' '--without-gpm' '--with-x' '--without-xpm' '--enable-asserts' 'CFLAGS=-g''

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: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Group

Minor modes in effect:
  gnus-topic-mode: t
  gnus-undo-mode: t
  diff-auto-refine-mode: t
  tooltip-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
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
L S-SPC T R H O U G H . <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> M-l M-l <left> <left> <left> <left> <left> <backspace> 
<right> r <right> <right> <right> <right> <right> <right> 
<right> <left> <left> <backspace> : SPC % S <right> 
<right> <left> SPC e x i t - v a l u e <switch-frame> 
<down-mouse-5> <mouse-5> <double-down-mouse-5> <double-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <down-mouse-4> 
<mouse-4> <down-mouse-1> <mouse-1> <double-down-mouse-1> 
<double-mouse-1> u <help-echo> <switch-frame> <down-mouse-1> 
<mouse-movement> <mouse-1> C-M-k <up> ( o r C-) C-M-f 
SPC C-y <down> C-a C-k C-k C-x C-s C-M-x <switch-frame> 
<down-mouse-1> <mouse-movement> <mouse-1> C-x b C-g 
C-x C-b C-x o <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <return> q <up> <up> <up> <up> 
<down> C-x o M-x r e p o r t - e m <tab> <return> f 
o o <return> y <up> <up> <up> <up> <right> <right> 
<right> <right> C-k t c r @ f r e e b i t s . d e C-c 
C-c y e s <return> <switch-frame> C-x C-s <switch-frame> 
<down-mouse-1> <mouse-movement> <mouse-1> M-x g n u 
s <return> y <help-echo> <switch-frame> <down-mouse-1> 
<mouse-1> C-x C-f <help-echo> <switch-frame> <down-mouse-1> 
<mouse-1> M-x <switch-frame> <down-mouse-1> <mouse-movement> 
<mouse-1> M-x r e p o r t - e m a c s - b u g s <return> 
<M-backspace> b <tab> <return> F o o <return> y <up> 
<up> <up> <right> <right> <right> <up> <right> C-k 
t c r @ f r e e b i t s d e <backspace> <backspace> 
. d e C-c C-c y e s <return> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <help-echo> 
<down> <down> <down> <down> <down> <down> C-a C-SPC 
M-> C-w C-y C-x b <return> M-x r e p r <backspace> 
o r t <tab> <return>

Recent messages:
gnus-all-windows-visible-p: Invalid buffer type: if
Auto-saving...
ffap-read-file-or-url: Command attempted to use minibuffer while in minibuffer
Unsent message being composed; erase it? (y or n) 
Auto save file for draft message exists; consider M-x mail-recover
Sending...
smtpmail-open-stream: Autoloading failed to define function starttls-any-program-available
Auto-saving...done
Mark set [2 times]
Auto-saving...

-- 
Diese Nachricht wurde auf Viren und andere gefaerliche Inhalte untersucht
und ist - aktuelle Virenscanner vorausgesetzt - sauber.
Freebits E-Mail Virus Scanner




[-- Attachment #3: Type: message/rfc822, Size: 1542 bytes --]

From: Glenn Morris <rgm@gnu.org>
To: 2428-done@emacsbugs.donarmstrong.com
Subject: Re: bug#2428: 23.0.90; sendmail-send-it not checking for call-process-region's return value properly
Date: Wed, 25 Feb 2009 22:52:50 -0500
Message-ID: <y7skm1q2gd.fsf@fencepost.gnu.org>


Thank you; installed.


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

end of thread, other threads:[~2009-02-26  4:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <y7skm1q2gd.fsf@fencepost.gnu.org>
2009-02-21 22:45 ` bug#2428: 23.0.90; sendmail-send-it not checking for call-process-region's return value properly tcr
2009-02-25  4:00   ` Glenn Morris
2009-02-25 11:08     ` Tobias C. Rittweiler
2009-02-26  4:00   ` bug#2428: marked as done (23.0.90; sendmail-send-it not checking for call-process-region's return value properly) Emacs bug Tracking System

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).