www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/07/12/09:02:17

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Sun, 12 Jul 2009 15:01:53 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: [1.7] Bug in link() with long filenames
Message-ID: <20090712130153.GI12258@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <4A5794FA DOT 7020406 AT cwilson DOT fastmail DOT fm>
MIME-Version: 1.0
In-Reply-To: <4A5794FA.7020406@cwilson.fastmail.fm>
User-Agent: Mutt/1.5.19 (2009-02-20)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019