native symlink

Jeffrey Altman jaltman@openafs.org
Wed Apr 3 21:35:00 GMT 2013


I will add testing this to my to-do list.
It may be a few days.


On 4/3/2013 4:46 PM, Corinna Vinschen wrote:

> I think I know what the problem is here.  Even though Cygwin didn't
> recognize the reparse point type and even though it lets the OS handle
> the reparse point in subsequent calls, the PC_KEEP_HANDLE flag is not
> removed.  The effect is that stat uses the metadata collected in the
> symlink_info::check call, which is the reparse point metadata.  So, I
> think the right thing to do here is to remove the PC_KEEP_HANDLE flag so
> stat reopens the reparse point, but this time without the
> FILE_OPEN_REPARSE_POINT flag. 
> 
> You're set up to build Cygwin yourself, right?  Can you please try the
> below patch?
> 
> 
> Thanks,
> Corinna
> 
> 
> Index: path.cc
> ===================================================================
> RCS file: /cvs/src/src/winsup/cygwin/path.cc,v
> retrieving revision 1.672
> diff -u -p -r1.672 path.cc
> --- path.cc	3 Apr 2013 11:20:36 -0000	1.672
> +++ path.cc	3 Apr 2013 20:46:08 -0000
> @@ -2668,7 +2668,14 @@ restart:
>  		 to the volumes root dir. */
>  	      pflags &= ~PC_KEEP_HANDLE;
>  	    }
> -	  else if (res)
> +	  else if (!res)
> +	    {
> +	      /* Make sure the open handle is not used in later stat calls.
> +		 We didn't recognize the reparse point type, so let the
> +		 OS handle this the default way. */
> +	      pflags &= ~PC_KEEP_HANDLE;
> +	    }
> +	  else
>  	    {
>  	      /* A symlink is never a directory. */
>  	      conv_hdl.fnoi ()->FileAttributes &= ~FILE_ATTRIBUTE_DIRECTORY;
> 



More information about the Cygwin-developers mailing list