Ticket #1963 (closed bug: fixed)

Opened 2 months ago

Last modified 2 months ago

execvp() Tries to Execute Directories

Reported by: bonefish Assigned to: bonefish
Priority: critical Milestone: R1/alpha1
Component: System/libroot.so Version: R1 development
Cc: Platform: All

Description (Last modified by bonefish)

r24582, VMware

When execvp() finds a matching entry in the PATH, it doesn't make sure that it is a regular file. E.g. create a "cp" directory in the cwd and make it executable. execvp("cp",...) will try to execute it.

Change History

03/26/08 18:02:24 changed by bonefish

  • owner changed from axeld to bonefish.
  • status changed from new to assigned.
  • component changed from File Systems/BFS to System/libroot.so.
  • description changed.
  • summary changed from BFS Finds Spurious File to execvp() Tries to Execute Directories.

Never write bug reports when too tired. There actually is an entry "cp", I just missed it; it's a directory. This is just another execvp() bug. I thought I was really clever replacing the stat() in the code copied from my APR code by access(), but we obviously also need to make sure that the entry is a regular file.

03/26/08 18:44:03 changed by bonefish

  • status changed from assigned to closed.
  • resolution set to fixed.

Fixed in r24599.