Re: How to restore files without deleting existing

From: Jeff Chimene (jeffchimene_at_yahoo.com)
Date: 10/04/04

  • Next message: Paul Johnson: "Linux gamers with Matrox cards, speak up please!"
    Date: Sun, 3 Oct 2004 19:57:33 -0700 (PDT)
    To: debian-user@lists.debian.org
    
    

    --- Paul E Condon <pecondon@mesanetworks.net> wrote:

    > On Sun, Oct 03, 2004 at 07:33:04PM -0700, Jeff
    > Chimene wrote:
    > >
    > > --- Rajesh Menon <prm225@cs.nyu.edu> wrote:
    > >
    > > > As far as I know, if you operate on the symlink,
    > you
    > > > are operating on
    > > > the files/dir that it points to. Unlike hard
    > links,
    > > > which are actual
    > > > copies of the link pointed to.
    > > > And if I recall right, tar's behaviour, by
    > default,
    > > > is to over-write the
    > > > destination.
    > > >
    > > > tar -xzf archive.tar.gz => it's going to create
    > > > (overwrite) a folder 'source' and dump the
    > output in
    > > > there.
    > >
    > > Thank you for the reply! I think that I clobbered
    > the
    > > symlink - i.e. the original files are in the
    > original
    > > directory. The symlink got replaced by the actual
    > > directory.
    > >
    > > Is there a way for tar to follow the symlink, or
    > am I
    > > supposed to be writing into the linked directory?
    > >
    > > Cheers,
    > > Jeff Chimene
    > >
    >
    > In my test, I used -h option only for creating .tgz
    > file
    > My untar did -not- have -h option and yet the files
    > that
    > were in the .tgz file were placed by following the
    > symlink.
    > I appears that you only need -h when you are
    > creating.
    > So, this is not likely explanation of what happened
    > to you.
    >
    > But, again, maybe Red Hat tar behaves differently.

    Hi,

    bash-2.05b$ tar --version
    tar (GNU tar) 1.13.25
    Copyright (C) 2001 Free Software Foundation, Inc.

    It's got something to do with following symlinks in a
    secure way. I found a thread that seemed to indicate
    that this behavior is more secure than previous
    symlink handling. I didn't follow the thread closely,
    but I think that's the gist of this class of behavior.

    Fortunately, I have the original files :)

    So, I will modify my restore process to write to the
    actual directory, rather than the symlink. That should
    yield the desired behavior.

    Peace,
    jec
    >
    > --
    > Paul E Condon
    > pecondon@mesanetworks.net
    >
    >
    > --
    > To UNSUBSCRIBE, email to
    > debian-user-REQUEST@lists.debian.org
    > with a subject of "unsubscribe". Trouble? Contact
    > listmaster@lists.debian.org
    >
    >

    __________________________________________________
    Do You Yahoo!?
    Tired of spam? Yahoo! Mail has the best spam protection around
    http://mail.yahoo.com

    -- 
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: Paul Johnson: "Linux gamers with Matrox cards, speak up please!"

    Relevant Pages

    • Re: Tar problem
      ... exploit symbolic links to restore files to other directories. ... A naive tar program would overwrite /bin/sh in any of ... any tar, cpio, zip, or other archiving program that tries ... require keeping a list of every directory and/or symlink restored ...
      (freebsd-current)
    • Re: RE: Is FreeBSDs tar susceptible to this?
      ... > In the meantime, though, is there a chance that a fix for the vulnerability ... What if the tarball installs a symlink to / under the current directory ... ] After reading all these threads about locate, bash ..., I wondered how tar ... ] The "src" and "Src" directories are just here to make detection less evident. ...
      (FreeBSD-Security)
    • Re: RE: Is FreeBSDs tar susceptible to this?
      ... contents of the symlink, no. ... > FreeBSD and OpenBSD are both using gtar. ... The tar format has a rich history, dating back to Sixth Edition UNIX. ... if you have a hostile process, you tend to be forced in to assuming the ...
      (FreeBSD-Security)
    • Re: Tar problem
      ... > With bsdtar, ... An archive can restore a symbolic link to ... > symlink, it will be removed and replaced with the archive ... GNU tar didn't do this a year or two ago... ...
      (freebsd-current)