* fhandler_disk_file.cc (fhandler_base::fstat_helper): Check
for executable suffixes here in case we're on a file system not supporting permission. * path.cc (path_conv::check): Drop check for executable suffixes.
This commit is contained in:
parent
3059d18288
commit
079db16bf7
@ -1,3 +1,10 @@
|
|||||||
|
2008-10-09 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler_disk_file.cc (fhandler_base::fstat_helper): Check
|
||||||
|
for executable suffixes here in case we're on a file system
|
||||||
|
not supporting permission.
|
||||||
|
* path.cc (path_conv::check): Drop check for executable suffixes.
|
||||||
|
|
||||||
2008-10-09 Corinna Vinschen <corinna@vinschen.de>
|
2008-10-09 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Keep track of
|
* fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Keep track of
|
||||||
|
@ -609,6 +609,18 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
buf->st_mode |= S_IFREG;
|
buf->st_mode |= S_IFREG;
|
||||||
|
/* Check suffix for executable file. */
|
||||||
|
if (pc.exec_state () == dont_know_if_executable)
|
||||||
|
{
|
||||||
|
PUNICODE_STRING path = pc.get_nt_native_path ();
|
||||||
|
|
||||||
|
if (RtlEqualUnicodePathSuffix (path, L".exe", TRUE)
|
||||||
|
|| RtlEqualUnicodePathSuffix (path, L".bat", TRUE)
|
||||||
|
|| RtlEqualUnicodePathSuffix (path, L".com", TRUE))
|
||||||
|
pc.set_exec ();
|
||||||
|
}
|
||||||
|
/* No known sufix, check file header. This catches binaries and
|
||||||
|
shebang scripts. */
|
||||||
if (pc.exec_state () == dont_know_if_executable)
|
if (pc.exec_state () == dont_know_if_executable)
|
||||||
{
|
{
|
||||||
UNICODE_STRING same;
|
UNICODE_STRING same;
|
||||||
|
@ -1248,17 +1248,6 @@ out:
|
|||||||
if (saw_symlinks)
|
if (saw_symlinks)
|
||||||
set_has_symlinks ();
|
set_has_symlinks ();
|
||||||
|
|
||||||
if (!error && !isdir () && !(path_flags & PATH_ALL_EXEC)
|
|
||||||
&& !fs.has_acls () && !fs.is_nfs ())
|
|
||||||
{
|
|
||||||
const char *p = strchr (path, '\0') - 4;
|
|
||||||
if (p >= path &&
|
|
||||||
(ascii_strcasematch (".exe", p) ||
|
|
||||||
ascii_strcasematch (".bat", p) ||
|
|
||||||
ascii_strcasematch (".com", p)))
|
|
||||||
path_flags |= PATH_EXEC;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(opt & PC_POSIX))
|
if (!(opt & PC_POSIX))
|
||||||
normalized_path_size = 0;
|
normalized_path_size = 0;
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user