OSDN Git Service

* path.cc (symlink_info::check_shortcut): Don't check for executability
authorcorinna <corinna>
Thu, 9 Oct 2008 08:56:09 +0000 (08:56 +0000)
committercorinna <corinna>
Thu, 9 Oct 2008 08:56:09 +0000 (08:56 +0000)
here.
(symlink_info::check_sysfile): Ditto.

winsup/cygwin/ChangeLog
winsup/cygwin/path.cc

index 2d2396a..0c8e76e 100644 (file)
@@ -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
index 3b5163e..47513ae 100644 (file)
@@ -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;
 }