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: zero byte /bin/bash file - what creates it?


On Wed 10/11/06 18:11 CDT cygwin@cygwin.com wrote:
> On Wed 10/11/06 18:07 EDT cygwin@cygwin.com wrote:
> > Are you untarring files into '/' and does that tar file have a '/bin/bash' file?
> 
> Thanks Larry. I was untarring to a subdir below root. I can check the
> tar archive, but I doubt it has a bash file w/"000" perms, even if it
> did I would expect that to end up below the sub-dir; this problem may
> have nothing to do w/tar- I was also fixing up perms in that subdir tree
> piping the already saved tar STDERR to a series of commands, and finally
> to "xargs chmod u+rw". I'm content to let this thread die ( I know I'm
> not supplying enough info ). If I unravel it I'll report back.

I can get the problem to happen at-will by running

  mkdir /home/bar; cd /home/bar
  tar zxf /tmp/foo.tar.gz # works fine/no problems
    # foo.tar.gz has symbolic links in a subdir ( say "./myrestricted/bin" ) pointing to 
    # /bin/bash, /bin/sed, /bin/perl, /bin/ls, /bin/mktemp, /bin/dir
    # (I suspect some of these links are from various revs of cygwin, some of them years old)
  tar zxf /tmp/foo.tar.gz 
    # 2nd untar creates zero byte files in /bin

Untarring to new empty dir does not cause any problems,
but untarring a 2nd time results in several zero byte files in /bin:

  ~ $ uname -a
  CYGWIN_NT-5.0 argon 1.5.21(0.156/4/2) 2006-07-30 14:21 i686 Cygwin
  ~ $ cd /bin
  /bin $ find . -maxdepth 1 -type f -empty
  ./bash
  ./dir
  ./less
  ./ls
  ./mktemp
  ./perl
  ./sed
  /bin $

tar seems to be following the pre-existing soft link on the file system,
and then writing to that target, instead of just replacing the soft
link on the file system.  

This approach does not have any problems:

  tar zUxf /tmp/foo.tar.gz

--
thanks,
Tom



--
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/


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