From owner-freebsd-standards@FreeBSD.ORG Fri Jun 10 05:33:07 2005 Return-Path: X-Original-To: freebsd-standards@FreeBSD.ORG Delivered-To: freebsd-standards@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 04C8C16A41C; Fri, 10 Jun 2005 05:33:07 +0000 (GMT) (envelope-from drosih@rpi.edu) Received: from smtp4.server.rpi.edu (smtp4.server.rpi.edu [128.113.2.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id A4A6843D1F; Fri, 10 Jun 2005 05:33:06 +0000 (GMT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp4.server.rpi.edu (8.13.0/8.13.0) with ESMTP id j5A5X3j1014927; Fri, 10 Jun 2005 01:33:05 -0400 Mime-Version: 1.0 Message-Id: Date: Fri, 10 Jun 2005 01:33:02 -0400 To: freebsd-arch@FreeBSD.ORG From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-CanItPRO-Stream: default X-RPI-SA-Score: undef - spam-scanning disabled X-Scanned-By: CanIt (www . canit . ca) on 128.113.2.4 Cc: freebsd-standards@FreeBSD.ORG Subject: Change the executing of a 0-byte file to be an error... X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2005 05:33:07 -0000 A few months ago, I had a system panic happen right in the middle of a 'installworld'. Right now I don't care about the panic itself (IIRC, it was a hardware problem), but there was one unexpected side-effect which caused me more trouble than the original panic. And all that trouble boils down to the following: If a file is empty and executable, that empty file can be executed without generating any error. The panic caused a few files in /usr/bin to end up as zero-byte executable files, but I didn't realize that. I ended up doing another buildworld, I think it was, and ended up digging myself into a deeper and deeper hole. The problem included things like makefile rules calling: somecmd | sort -blah | domore where the 'sort' command had turned into one of those zero-byte executable files. The basic result was that the more I tried to rebuild parts of the world, the more screwed up the system became. By the time I was done, I had to do a clean install from CD-ROM to get it back to working order. Can anyone think of a real-world problem that would come up if the system was changed so that executing a 0-byte file would cause an error? I read through a few likely pages in SUSv3, and it looked like the behavior for executing an 0-byte file is not explicitly defined. Of course, it might be that I was simply looking in the wrong part of the standard. It does seem like empty files are also executed without error on a few other OS's I tried, but I don't understand why that behavior would be desirable. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu