This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [1.7] Bug in link() with long filenames


On Jul 10 15:22, Charles Wilson wrote:
> It seems that the st_nlink count is not updated for very long file
> names. [...]
> Any idea why "247" is a magic number?

It's a magic number because you installed Cygwin 1.7 into some path
like C:\cygwin-1.7.  In my case the magic number is 251 because I
installed into C:\cygwin.

The bug does not occur in link(), but in lstat().  Apparently I
misunderstood what is returned by NtQueryInformationFile with
FileAllInformation information class.  It doesn't return the filename,
but the pathname.  The maximum buffer size of the datastructure I'm
using has only room for 256 chars, which would be the maximum filename
length.

I changed the internal fhandler_base::fstat_by_handle method not to
use the FileAllInformation info class at all, since we don't need the
filename anyway in stat.

Thanks for the report,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]