From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10809 invoked from network); 15 Oct 2001 11:33:22 -0000 Received: from unknown (HELO sunsite.dk) (130.225.247.90) by ns1.primenet.com.au with SMTP; 15 Oct 2001 11:33:22 -0000 Received: (qmail 21280 invoked by alias); 15 Oct 2001 11:33:16 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16043 Received: (qmail 21263 invoked from network); 15 Oct 2001 11:33:13 -0000 Date: Mon, 15 Oct 2001 13:32:42 +0200 From: Stefan Dalibor To: zsh-workers@sunsite.dk Subject: Buglette & Fix for checkrmall in 4.0.2 Message-ID: <20011015133242.A2458@caldera.de> Reply-To: dalibor@caldera.de Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="2fHTh5uZTiUOsy+g" Content-Disposition: inline User-Agent: Mutt/1.2.5i --2fHTh5uZTiUOsy+g Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, just in case nobody else has been stumbled into this: 4.0.2 segfaults in checkrmall() (under OpenLinux 3.1, i.e. Linux 2.4.* with glibc 2.2.1 and 2.2.4) when executing the following function: function www { typeset netscapefiles="{lock,plugin-list*,history*,*cache/*,archive/*,*.db,abook.nab,registry,summary*,custom.dic}" \ nsmaildir=$HOME/nsmail ( if [ -z "$DISPLAY" -a "$KPSYSTYPE" = 'i86linux' ]; then # Fire up X and start Mozilla from Linux text console: startx netscape "$@" else netscape "$@" fi # This crashes zsh-4.0.2 if unpatched: eval command rm -fr $HOME/.netscape/$netscapefiles /tmp/ndebug [ -d $nsmaildir ] && rmdir $nsmaildir ) & } This is due to checkrmall() calling fprintf() with a NULL file ptr in shout. Please find attached the dumbest possible patch... it prevents the crash, but I didn't investigate on wether it is the appropriate place for a fix (should Zsh recognize that it's useless to call checkrmall() when running in the background in the first place? Is the NULL file ptr a bug in itself?). Cheers, Stefan P.S.: If you have any further questions, please set me on CC (I'm only on the Zsh announce list) -- Dr.Ing. Stefan Dalibor --2fHTh5uZTiUOsy+g Content-Type: application/x-patch Content-Disposition: attachment; filename="zsh-4.0.2-nostderrfix.patch" --- zsh-4.0.2/Src/utils.c Tue May 29 17:09:06 2001 +++ zsh-4.0.2/Src/utils.c-noshoutfix Fri Oct 12 18:08:17 2001 @@ -1407,4 +1407,11 @@ checkrmall(char *s) { + if (!shout) { + /* + * This shells runs w/o access to a terminal, we can't query the + * user... + */ + return (1); + } fprintf(shout, "zsh: sure you want to delete all the files in "); if (*s != '/') { --2fHTh5uZTiUOsy+g--