delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/10/14/01:52:08

X-Spam-Check-By: sourceware.org
Message-Id: <200610140551.k9E5pfgT027163@tigris.pounder.sol.net>
From: cygzx AT trodman DOT com (Tom Rodman)
Reply-to: cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
Subject: Re: zero byte /bin/bash file - what creates it?
In-reply-to: <200610112311.k9BNBrnW009619@tigris.pounder.sol.net>
References: <200610112043 DOT k9BKh1Lr008690 AT tigris DOT pounder DOT sol DOT net> <452D6B16 DOT 9070407 AT cygwin DOT com> <200610112311 DOT k9BNBrnW009619 AT tigris DOT pounder DOT sol DOT net>
Date: Sat, 14 Oct 2006 00:51:41 -0500
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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 Wed 10/11/06 18:11 CDT cygwin AT cygwin DOT com wrote:
> On Wed 10/11/06 18:07 EDT cygwin AT cygwin DOT 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/

- Raw text -


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