1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00
freebsd/lib/libc
Bruce Evans 1df595f25d Fixed searching of $PATH in execvp(). Do what sh(1) should do according
to POSIX.2.  In particular:

- don't retry for ETXTBSY.  This matches what sh(1) does.  The retry code
  was broken anyway.  It only slept for several seconds for the first few
  retries.  Then it retried without sleeping.
- don't abort the search for errors related to the path prefix, in
  particular for ENAMETOOLONG, ENOTDIR, ELOOP.  This fixes PR1487.  sh(1)
  gets this wrong in the opposite direction by never aborting the search.
- don't confuse EACCES for errors related to the path prefix with EACCES
  for errors related to the file.  sh(1) gets this wrong.
- don't return a stale errno when the search terminates normally without
  finding anything.  The errno for the last unsuccessful execve() was
  usually returned.  This gave too much precedence to pathologies in the
  last component of $PATH.  This bug is irrelevant for sh(1).

The implementation still uses the optimization/race-inhibitor of trying
to execve() things first.  POSIX.2 seems to require looking at file
permissions using stat().  We now use stat() after execve() if execve()
fails with an ambiguous error.  Trying execve() first may actually be a
pessimization, since failing execve()s are fundamentally a little slower
than stat(), and are significantly slower when a file is found but has
unsuitable permissions or points to an unsuitable interpreter.

PR:		1487
1997-10-14 07:23:16 +00:00
..
amd64 Changed all paths to be relative to src/lib instead of src/lib/libc 1997-05-03 03:50:06 +00:00
compat-43 kill the undead 1997-07-13 14:26:00 +00:00
db Submitted by: Sin'ichiro MIYATANI / Phase One, Inc <siu@phaseone.co.jp> 1997-09-24 20:38:12 +00:00
gen Fixed searching of $PATH in execvp(). Do what sh(1) should do according 1997-10-14 07:23:16 +00:00
gmon Changed all paths to be relative to src/lib instead of src/lib/libc 1997-05-03 03:50:06 +00:00
i386 kill the undead 1997-07-13 14:26:00 +00:00
locale Use revived __maskrune for digittoint 1997-09-27 04:34:35 +00:00
net Some adjustments for the resolver use of poll(). For some reason I thought 1997-09-16 06:03:54 +00:00
nls Plug even more failure memory leaks 1997-05-10 04:40:40 +00:00
quad Changed all paths to be relative to src/lib instead of src/lib/libc 1997-05-03 03:50:06 +00:00
regex Changed all paths to be relative to src/lib instead of src/lib/libc 1997-05-03 03:50:06 +00:00
rpc Make selection logic more strict. Only select AF_INET loopback interfaces 1997-09-21 23:04:51 +00:00
stdio Rework previous commit.. I was confused by the number of diffs in the PR 1997-07-06 08:42:37 +00:00
stdlib environmental -> environment. 1997-09-18 06:55:21 +00:00
stdtime Merged in better support of ISO 8601 from elsie.nci.nih.gov. 1997-10-03 19:06:57 +00:00
string Added bounds checking to the example after chasing down someone's 1997-07-26 00:47:06 +00:00
sys Add the AIO/LIO to libc. They aren't fully done yet, but have been in the 1997-10-10 05:48:16 +00:00
xdr Restore Id. 1997-05-28 16:29:12 +00:00
yp Use ${DESTDIR} correctly in front of absolute paths. 1997-05-23 08:24:00 +00:00
Makefile Use ${DESTDIR} correctly in front of absolute paths. 1997-05-23 08:24:00 +00:00
Makefile.inc Changed all paths to be relative to src/lib instead of src/lib/libc 1997-05-03 03:50:06 +00:00