delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/01/15/09:33:30

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Tue, 15 Jan 2008 15:32:43 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Maybe 1.5 Regression: cp failing while working with cygwin 1.3.22
Message-ID: <20080115143243.GG5097@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <478CA52E DOT 8050609 AT onevision DOT de> <20080115140340 DOT GF5097 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <20080115140340.GF5097@calimero.vinschen.de>
User-Agent: Mutt/1.5.16 (2007-06-09)
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 Jan 15 15:03, Corinna Vinschen wrote:
> On Jan 15 13:21, Roland Schwingel wrote:
> > [...]
> > 11. cp -rp //server/share/path/to/your/home/tmp/test /tmp
> > 12. Error message appears:
> >
> > cp: will not create hard link: '/tmp/test/symlink' to directory 
> > '/tmp/test/subdir'
> >
> > Obviously cygwin 1.5 is now detecting the symlink correctly while 1.3 was 
> > not because it copied
> > the symlinked folder as folder not as link (even when I did cp -a).
> 
> Cygwin 1.5.25 uses the i-node numbers returned by
> Samba > 3.x as ... i-node numbers.  Cygwin 1.3.x generated always pseudo
> i-node numbers on remote drives.
> [...]
> cygwin-1.5.25$ ls -li
> total 0
> 8808978157900 drwxr-xr-x 1 corinna root 0 Jan 15 14:46 subdir
> 8808978157900 drwxr-xr-x 1 corinna root 0 Jan 15 14:46 symlink
> [...]
> I have no idea why Samba doesn't return the correct i-node number for
> symlinks.  This is most unfortunate.

A look into the Samba source code shows why.  Samba always calls stat(2)
on files if the client is a Windows client.  It uses lstat(2) only for
UNIX CIFS clients.  That explains the identical i-node numbers in Cygwin.
Sigh, a bit more intelligence would have been nice :(

Eric, maybe cp(1) can be pushed up a bit by checking the number of
hardlinks on the file?  Two files with identical i-nodes are only
actually hardlinks to the same file if the number of links is equal
and > 1?


Corinna

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

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

- Raw text -


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