From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chris Moore Newsgroups: gmane.emacs.devel Subject: Re: C file recoginzed as image file Date: Fri, 05 Jan 2007 16:02:38 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1168178647 16013 80.91.229.12 (7 Jan 2007 14:04:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 7 Jan 2007 14:04:07 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 05 16:03:06 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H2qax-0000xu-I0 for ged-emacs-devel@m.gmane.org; Fri, 05 Jan 2007 16:02:59 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H2qax-0003zM-5f for ged-emacs-devel@m.gmane.org; Fri, 05 Jan 2007 10:02:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H2qak-0003xH-0A for emacs-devel@gnu.org; Fri, 05 Jan 2007 10:02:46 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H2qai-0003tP-D6 for emacs-devel@gnu.org; Fri, 05 Jan 2007 10:02:45 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H2qai-0003tB-4T for emacs-devel@gnu.org; Fri, 05 Jan 2007 10:02:44 -0500 Original-Received: from [66.249.92.170] (helo=ug-out-1314.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H2qah-0002dX-Is for emacs-devel@gnu.org; Fri, 05 Jan 2007 10:02:43 -0500 Original-Received: by ug-out-1314.google.com with SMTP id j3so6408241ugf for ; Fri, 05 Jan 2007 07:02:42 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:to:cc:references:from:date:in-reply-to:message-id:user-agent:mime-version:content-type:x-sa-exim-connect-ip:x-sa-exim-mail-from:x-spam-checker-version:x-spam-level:x-spam-status:subject:x-sa-exim-version:x-sa-exim-scanned:sender; b=XR9Px3hFwygzGIb+L7soXj4YUcUn4ro3VF7Xo3pVEGZ0iMFItUi82SpJtIFG1b9m9Svjz6uW2W2jzW/N1adfUsxgfkfQBInnpqNNZXye9f6AkWfTIrKXfRJ2K3uj1ciXWWXrZ2xcj95GKKuEBnJNTmFHSyz7cl4oA2aSIybK6FI= Original-Received: by 10.67.91.6 with SMTP id t6mr14741711ugl.1168009362677; Fri, 05 Jan 2007 07:02:42 -0800 (PST) Original-Received: from chrislap.local ( [89.176.28.156]) by mx.google.com with ESMTP id o24sm35429675ugd.2007.01.05.07.02.41; Fri, 05 Jan 2007 07:02:41 -0800 (PST) Original-Received: from localhost ([127.0.0.1] helo=chrislap.local) by chrislap.local with esmtp (Exim 4.63) (envelope-from ) id 1H2qac-0003by-SX; Fri, 05 Jan 2007 16:02:40 +0100 Original-To: Charles Rendleman In-Reply-To: (Chris Moore's message of "Fri\, 05 Jan 2007 15\:46\:27 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (gnu/linux) X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: dooglus@gmail.com X-SA-Exim-Version: 4.2.1 (built Sun, 03 Dec 2006 00:39:09 +0000) X-SA-Exim-Scanned: Yes (on chrislap.local) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:64911 Chris Moore writes: > so any file beginning with optional white space and then #define is > treated as an xbm image. I'm thinking it would be safer to use auto-mode-alist before magic-mode-alist. Treating files according to their content rather than according to their extension is something which has caused a lot of problems with virus spread on w32 platforms. I don't want this situation to be possible in Emacs: I receive a file foo.c in an email, save it to disk and open it in Emacs, knowing that the .c type is opened in cc-mode which is safe. To my horror, the file actually contains an evil .jpg file which causes a buffer overflow in the jpg library; when it's displayed it infects my machine with a virus. Emacs shouldn't open me up to that risk when I am simply trying to view a .c file.