* path.cc (symlink_info::check_shortcut): Don't check for executability
here. (symlink_info::check_sysfile): Ditto.
This commit is contained in:
parent
3ae5cb32c5
commit
4e88323ba0
@ -1,3 +1,9 @@
|
|||||||
|
2008-10-09 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* path.cc (symlink_info::check_shortcut): Don't check for executability
|
||||||
|
here.
|
||||||
|
(symlink_info::check_sysfile): Ditto.
|
||||||
|
|
||||||
2008-10-08 Corinna Vinschen <corinna@vinschen.de>
|
2008-10-08 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* path.cc (path_conv::path_conv): Only assume executability by suffix
|
* path.cc (path_conv::path_conv): Only assume executability by suffix
|
||||||
|
@ -1877,12 +1877,12 @@ symlink_info::check_shortcut (HANDLE in_h)
|
|||||||
file_header = (win_shortcut_hdr *) buf;
|
file_header = (win_shortcut_hdr *) buf;
|
||||||
if (io.Information != fsi.EndOfFile.LowPart
|
if (io.Information != fsi.EndOfFile.LowPart
|
||||||
|| !cmp_shortcut_header (file_header))
|
|| !cmp_shortcut_header (file_header))
|
||||||
goto file_not_symlink;
|
goto out;
|
||||||
cp = buf + sizeof (win_shortcut_hdr);
|
cp = buf + sizeof (win_shortcut_hdr);
|
||||||
if (file_header->flags & WSH_FLAG_IDLIST) /* Skip ITEMIDLIST */
|
if (file_header->flags & WSH_FLAG_IDLIST) /* Skip ITEMIDLIST */
|
||||||
cp += *(unsigned short *) cp + 2;
|
cp += *(unsigned short *) cp + 2;
|
||||||
if (!(len = *(unsigned short *) cp))
|
if (!(len = *(unsigned short *) cp))
|
||||||
goto file_not_symlink;
|
goto out;
|
||||||
cp += 2;
|
cp += 2;
|
||||||
/* Check if this is a device file - these start with the sequence :\\ */
|
/* Check if this is a device file - these start with the sequence :\\ */
|
||||||
if (strncmp (cp, ":\\", 2) == 0)
|
if (strncmp (cp, ":\\", 2) == 0)
|
||||||
@ -1898,7 +1898,7 @@ symlink_info::check_shortcut (HANDLE in_h)
|
|||||||
cp += 2;
|
cp += 2;
|
||||||
}
|
}
|
||||||
if (len > SYMLINK_MAX)
|
if (len > SYMLINK_MAX)
|
||||||
goto file_not_symlink;
|
goto out;
|
||||||
cp[len] = '\0';
|
cp[len] = '\0';
|
||||||
res = posixify (cp);
|
res = posixify (cp);
|
||||||
}
|
}
|
||||||
@ -1906,11 +1906,6 @@ symlink_info::check_shortcut (HANDLE in_h)
|
|||||||
pflags = PATH_SYMLINK | PATH_LNK;
|
pflags = PATH_SYMLINK | PATH_LNK;
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
file_not_symlink:
|
|
||||||
/* Not a symlink, see if executable. */
|
|
||||||
if (!(pflags & PATH_ALL_EXEC) && has_exec_chars ((const char *) &file_header, io.Information))
|
|
||||||
pflags |= PATH_EXEC;
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
NtClose (h);
|
NtClose (h);
|
||||||
return 0;
|
return 0;
|
||||||
@ -1965,16 +1960,6 @@ symlink_info::check_sysfile (HANDLE in_h)
|
|||||||
else if (io.Information == sizeof (cookie_buf)
|
else if (io.Information == sizeof (cookie_buf)
|
||||||
&& memcmp (cookie_buf, SOCKET_COOKIE, sizeof (cookie_buf)) == 0)
|
&& memcmp (cookie_buf, SOCKET_COOKIE, sizeof (cookie_buf)) == 0)
|
||||||
pflags |= PATH_SOCKET;
|
pflags |= PATH_SOCKET;
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Not a symlink, see if executable. */
|
|
||||||
if (pflags & PATH_ALL_EXEC)
|
|
||||||
/* Nothing to do */;
|
|
||||||
else if (has_exec_chars (cookie_buf, io.Information))
|
|
||||||
pflags |= PATH_EXEC;
|
|
||||||
else
|
|
||||||
pflags |= PATH_NOTEXEC;
|
|
||||||
}
|
|
||||||
NtClose (h);
|
NtClose (h);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user