lkml.org 
[lkml]   [1998]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: execve changes break execlp with 2.1.122


On Tue, 22 Sep 1998, Chris Wedgwood wrote:
>
> On Tue, Sep 22, 1998 at 12:53:33AM +0000, Linus Torvalds wrote:
>
> > and 2.1.123-1 will incorrectly return ENOTDIR (which while sensible is
> > definitely incorrect), while a correct kernel will return ENOENT.
>
> Both are equally correct - software that break on one or other is
> arguably broken.

No, POSIX (and before that just normal UNIX semantics) does clearly define
that ENOENT is the only correct thing to return. I certainly agree that
both make sense if you don't have any arbitrary rules, but we do have 25
years of UNIX.

And it's really easy for me to return the right error value, I just got an
simple ordering issue wrong (and to some degree ENOENT really is the
better return code anyway as it makes ENOTDIR tell you more - ENOTDIR
really means that the path component existed but wasn't valid as a
directory).

I do agree that this showed a instability in "execlp()", in that it only
accepted ENOENT as a return value, and if execlp() ever got ENOTDIR
instead it simply stopped searching the path. ENOTDIR is a valid return
value even from a fixed kernel if the path contains any components that
might not always be directories (and that is a valid thing to have: some
people I know have a "./bin" entry in their path, and sometimes "." might
have a file called "bin" in it).

Linus


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:44    [W:0.051 / U:0.980 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site