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: untarring symlinks with ../ fails randomly


On Apr 25 14:59, Lester Ingber wrote:
> Corinna Vinschen <corinna-cygwin <at> cygwin.com> writes:
> 
> > 
> > On Apr 24 17:14, Dima Pasechnik wrote:
> > > Dear all,
> > > reposting, as the message did not get through to the mailing list yesterday:
> > > 
> > > The issue I have is exactly as described in
> > > http://sourceware.org/ml/cygwin/2011-04/msg00299.html
> > > I can reproduce this on a very similar Windows 7 host.
> > > (To be precise, it seems hard to predict when creating symlinks fails;
> > > I could say
> > > that perhaps 20% of them, on average, are not created correctly (i.e.
> > > I get files of size 0 instead)).
> > 
> > A simple testcase in plain C to reproduce the issue would be fine.
> > Did you try to create the symlinks under strace?  It should contain
> > some valuable hint from the function "symlink_worker".
> > 
> > Corinna
> >
> 
> The problem seems to be with untar, not tar per se.  Just today, I did `tar cp` 
> a directory of a few hundred links under Cygwin.  Under an unbuntu machine I 
> recovered all files and links just fine.  Under Cygwin, all files were 0 and 
> permissions were "----------" instead of "lrwxrwxrwx" as in the original 
> directory.  (Yesterday, half the links were 0.  After compiling tar-12.6 from 
> gnu.org I still got 8 0's.  I then moved that tar to tar-1.26 yesterday.)  I 
> include an excerpt of the log of `tar xfp` doing this with strace just for one 
> file, index.html.

Thanks for the strace.  However, it doesn't show any problem with
Cygwin.  What can be seen here is just that...

>   199 1012793 [main] tar 7272 symlink_info::check: 0xC0000034 = 
> NtQueryInformationFile (\??\C:\cygwin\home\ingber\www-ssl\index.html.exe.lnk)
>   188 1012981 [main] tar 7272 symlink_info::check: 0 = symlink.check 
> (C:\cygwin\home\ingber\www-ssl\index.html, 0x28B590) (0x3000A)

...there is no file called index.html yet, and ...

>   305 1014830 [main] tar 7272 fhandler_base::open: (\??
> \C:\cygwin\home\ingber\www-ssl\index.html, 0x100A01)
>  1307 1016137 [main] tar 7272 alloc_sd: uid -1, gid -1, attribute 80000000

...next tar does *not* try to create a symlink, but a file of size 0
with permissions 000 instead.  So the problem here seems to be in tar.
Obviously I can't tell why tar tries to create a file rather than a
symlink.  There's nothing else to gain from this strace.


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]