Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Dec 1996 05:33:45 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs@freefall.freebsd.org, wollman@freefall.freebsd.org, zgabor@code.hu
Subject:   Re: kern/1487
Message-ID:  <199612171833.FAA00022@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>Synopsis: bug in exec(2)
>
>State-Changed-From-To: feedback-open
>State-Changed-By: wollman
>State-Changed-When: Tue Dec 17 08:16:21 PST 1996
>State-Changed-Why: 
>Not sure what the systus of this is, but there doesn't appear to
>be any feedback.

This seems to be a simple bug in execvp().  Please review this fix.
It handles ENOTDIR essentially the same as /bin/sh.

Oops.  I already see some bugs:
- if the ENOTDIR occurs for every try, then the final errno should
  be ENOTDIR, just like it would be for execv().  ENOTDIR errors
  should be handled something like EACCES errors.
- the handling of EACCES errors is probably wrong.  EACCES is
  returned if an EACCES occurs for _at least_ one try.  This is
  probably best if there are only EACCES and ENOENT errors.  However,
  if there are EACCES and ENOTDIR and possibly ENOENT errors, then the
  final errno should probably be ENOTDIR, just like it would be for
  attempts to execv() (or read) a file in an inaccessible non-directory
  (rm -rf /tmp/notdir; touch /tmp/notdir; chmod 0 /tmp/notdir;
  /tmp/notdir/nonesuch gives ENOTDIR).

Bruce

diff -c2 exec.c~ exec.c
*** exec.c~	Wed Nov 20 02:07:18 1996
--- exec.c	Wed Dec 18 04:54:36 1996
***************
*** 259,262 ****
--- 259,264 ----
  			free(memp);
  			goto done;
+ 		case ENOTDIR:
+ 			break;
  		case ETXTBSY:
  			if (etxtbsy < 3)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199612171833.FAA00022>