This is the mail archive of the
mailing list for the Cygwin project.
Re: zero byte /bin/bash file - what creates it?
On Wed 10/11/06 18:11 CDT email@example.com wrote:
> On Wed 10/11/06 18:07 EDT firstname.lastname@example.org 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
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
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html