From owner-freebsd-standards@FreeBSD.ORG Fri Jun 10 11:37:28 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 6553116A41C for ; Fri, 10 Jun 2005 11:37:28 +0000 (GMT) (envelope-from Hartmut.Brandt@dlr.de) Received: from smtp-1.dlr.de (smtp-1.dlr.de [195.37.61.185]) by mx1.FreeBSD.org (Postfix) with ESMTP id E0E0943D48 for ; Fri, 10 Jun 2005 11:37:27 +0000 (GMT) (envelope-from Hartmut.Brandt@dlr.de) Received: from beagle.kn.op.dlr.de ([129.247.173.6]) by smtp-1.dlr.de over TLS secured channel with Microsoft SMTPSVC(6.0.3790.211); Fri, 10 Jun 2005 13:37:26 +0200 Date: Fri, 10 Jun 2005 13:37:28 +0200 (CEST) From: Harti Brandt X-X-Sender: brandt_h@beagle.kn.op.dlr.de To: Wartan Hachaturow In-Reply-To: <4aaa2e1c0506100432117ea3b8@mail.gmail.com> Message-ID: <20050610133505.U646@beagle.kn.op.dlr.de> References: <4aaa2e1c0506100432117ea3b8@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-OriginalArrivalTime: 10 Jun 2005 11:37:26.0199 (UTC) FILETIME=[C681BC70:01C56DB0] Cc: freebsd-standards@freebsd.org, Garance A Drosihn Subject: Re: 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 Reply-To: Harti Brandt List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2005 11:37:28 -0000 On Fri, 10 Jun 2005, Wartan Hachaturow wrote: WH>On 6/10/05, Garance A Drosihn wrote: WH> WH>> error? I read through a few likely pages in SUSv3, and it looked WH>> like the behavior for executing an 0-byte file is not explicitly WH>> defined. Of course, it might be that I was simply looking in the WH>> wrong part of the standard. WH> WH>To quote SUSv3's Shell and Utilities: WH>"If the execve() function fails due to an error equivalent to the WH>[ENOEXEC] error defined in the System Interfaces volume of IEEE Std WH>1003.1-2001, the shell shall execute a command equivalent to having a WH>shell invoked with the command name as its first operand, with any WH>remaining arguments passed to the new shell. If the executable file is WH>not a text file, the shell may bypass this command execution. In this WH>case, it shall write an error message, and shall return an exit status WH>of 126." WH> WH>So it is merely an empty script execution. The kernel reports a failure, as it WH>should. Well, according to Posix an empty file is not a text file ('A file that contains characters organized in one or more lines.'). The 'may' above allows both behaviours for this case. harti