Changeset 24599

Show
Ignore:
Timestamp:
03/26/08 18:43:35 (2 months ago)
Author:
bonefish
Message:
execvp() also needs to verify that an entry it found in the path is a
file. It would try to execute directories before (#1963).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • haiku/trunk/src/system/libroot/posix/unistd/exec.cpp

    r24569 r24599  
    165165                strcat(path, file); 
    166166 
     167                // check whether it is a file 
     168                struct stat st; 
     169                if (stat(path, &st) != 0 || !S_ISREG(st.st_mode)) 
     170                        continue; 
     171 
    167172                // if executable, execute it 
    168173                if (access(path, X_OK) == 0)