delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/08/24/23:17:26

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Wed, 24 Aug 2005 23:17:17 -0400
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: please try latest snapshot
Message-ID: <20050825031717.GB16840@trixie.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
References: <082420051805 DOT 10982 DOT 430CB6EB0002BBE400002AE622064246130A050E040D0C079D0A AT comcast DOT net>
Mime-Version: 1.0
In-Reply-To: <082420051805.10982.430CB6EB0002BBE400002AE622064246130A050E040D0C079D0A@comcast.net>
User-Agent: Mutt/1.5.8i

On Wed, Aug 24, 2005 at 06:05:31PM +0000, Eric Blake wrote:
>I'm having a problem with the 20050824 snapshot.  execl() and friends
>are in violation of POSIX, which requires EACCESS (pathname is not
>regular file and cannot be executed) or ENOEXEC (pathname is not
>executable image, although it has execute permissions), rather than
>ENOENT, when passed a directory.  ENOENT is only allowed for path
>resolution failures.  Solaris 8 returns EACCESS on directories.
>
>The invalid errno from exec*() breaks, among others, xargs(1), which
>mistakenly exits with 127 instead of 126 (caught by the findutils
>testsuite, since I am waiting to package findutils-4.2.25 once it
>is released upstream).
>
>$ cat foo.c
>#include <unistd.h>
>#include <stdio.h>
>#include <string.h>
>#include <errno.h>
>
>int
>main (int argc, char** argv)
>{
>   int err;
>   if (argc != 2)
>   {
>      printf("Usage: foo <name>\n");
>      return 1;
>   }
>   err = execl(argv[1], argv[1], NULL);
>   printf("execl failed with %d, errno %d:%s\n", err, errno, strerror(errno));
>   return 0;
>}
>$ ./foo /
>execl failed with -1, errno 2:No such file or directory
>$ ./foo .
>execl failed with -1, errno 2:No such file or directory
>$ ./foo ''
>execl failed with -1, errno 2:No such file or directory
>$ xargs / < /dev/null; echo $?
>xargs: /: No such file or directory
>127
>
># on solaris 8:
>% ./foo /
>execl failed with -1, errno 13:Permission denied
>% ./foo .
>execl failed with -1, errno 13:Permission denied
>% ./foo ''
>execl failed with -1, errno 2:No such file or directory
>% xargs / < /dev/null; echo $?
>xargs: /: Permission denied
>126

This isn't really a snapshot regression.  1.5.18 works the same way, AFAICT.
The latest snapshot should rectify this behavior, however.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019