diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-10-09 08:56:09 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-10-09 08:56:09 +0000 |
commit | 4e88323ba05a8667c86fe50686a68322b3eaa779 (patch) | |
tree | 5f1325c9ccea59fcdcb4ac7b0d6f09428e69ed05 | |
parent | 3ae5cb32c50f08ef3cda12f36da12a7e926f705e (diff) | |
download | cygnal-4e88323ba05a8667c86fe50686a68322b3eaa779.tar.gz cygnal-4e88323ba05a8667c86fe50686a68322b3eaa779.tar.bz2 cygnal-4e88323ba05a8667c86fe50686a68322b3eaa779.zip |
* path.cc (symlink_info::check_shortcut): Don't check for executability
here.
(symlink_info::check_sysfile): Ditto.
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 21 |
2 files changed, 9 insertions, 18 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 2d2396a48..0c8e76ee3 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -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> * path.cc (path_conv::path_conv): Only assume executability by suffix diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 3b5163eca..47513ae88 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -1877,12 +1877,12 @@ symlink_info::check_shortcut (HANDLE in_h) file_header = (win_shortcut_hdr *) buf; if (io.Information != fsi.EndOfFile.LowPart || !cmp_shortcut_header (file_header)) - goto file_not_symlink; + goto out; cp = buf + sizeof (win_shortcut_hdr); if (file_header->flags & WSH_FLAG_IDLIST) /* Skip ITEMIDLIST */ cp += *(unsigned short *) cp + 2; if (!(len = *(unsigned short *) cp)) - goto file_not_symlink; + goto out; cp += 2; /* Check if this is a device file - these start with the sequence :\\ */ if (strncmp (cp, ":\\", 2) == 0) @@ -1898,7 +1898,7 @@ symlink_info::check_shortcut (HANDLE in_h) cp += 2; } if (len > SYMLINK_MAX) - goto file_not_symlink; + goto out; cp[len] = '\0'; res = posixify (cp); } @@ -1906,11 +1906,6 @@ symlink_info::check_shortcut (HANDLE in_h) pflags = PATH_SYMLINK | PATH_LNK; 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: NtClose (h); return 0; @@ -1965,16 +1960,6 @@ symlink_info::check_sysfile (HANDLE in_h) else if (io.Information == sizeof (cookie_buf) && memcmp (cookie_buf, SOCKET_COOKIE, sizeof (cookie_buf)) == 0) 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); return res; } |