2003-06-03 Roland McGrath <roland@redhat.com>
* strace.c (main): In PATH search, accept only a regular file with execute bits set. Fixes Debian bug #137103.
This commit is contained in:
parent
454a024a9b
commit
ed64516fa4
7
strace.c
7
strace.c
@ -439,7 +439,12 @@ char *argv[];
|
||||
if (len && pathname[len - 1] != '/')
|
||||
pathname[len++] = '/';
|
||||
strcpy(pathname + len, filename);
|
||||
if (stat(pathname, &statbuf) == 0)
|
||||
if (stat(pathname, &statbuf) == 0 &&
|
||||
/* Accept only regular files
|
||||
with some execute bits set.
|
||||
XXX not perfect, might still fail */
|
||||
S_ISREG(statbuf.st_mode) &&
|
||||
(statbuf.st_mode & 0111))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user