Ubuntu

Tar overwrites without prompting by default

Reported by timothy on 2007-05-07
254
Affects Status Importance Assigned to Milestone
bash (Ubuntu)
Wishlist
Unassigned

Bug Description

Tar overwrites files old or new without prompting by default. This means that, 1 a user could download a tar file for a theme, untar it at the CLI and have it overwrite config files in the home dir. And 2, it means that when I went to untar my home dir backup just now to get back some files, I lost the last few days changes to the files I had not accidentaly deleted. Not good for noobs.

Micah Cowan (micahcowan) wrote :

Thank you for your bug report. While I absolutely agree that this is a problem, I'm afraid that there's little that can be done about it. If we change tar's behavior to not overwrite files, we break with traditional tar behavior, which is something that many scripts rely upon. There are common uses of tar that expect to replace the existing contents of a directory with the contents of the archive ("extract over a directory").

Be that as it may, it may be worth considering aliasing "tar" to "tar --backup" in the .bashrc's, so that interactive use of tar will not destroy data by default. For this reason, I've switched this bug's package to bash, for consideration.

Changed in tar:
assignee: nobody → micahcowan
importance: Undecided → Wishlist
status: Unconfirmed → Confirmed
Micah Cowan (micahcowan) wrote :
Micah Cowan (micahcowan) wrote :

A contributor to the discussion, Scott Kitterman, recommended that the appropriate action for this bug is to close it as "works as designed", and invite you to submit a specification for "system changes to reduce the risk of accidental data loss by new users."

> That's, I think, the right way to deal with this type of design issue. Also
> it gives them a chance to be involved in the discussion and the community and
> feel valued.

I believe I agree with that. That would be the best way to get the right kind of discussion, and maximum community interaction, to find the best possible solution.

Changed in bash:
assignee: micahcowan → nobody
status: Confirmed → Rejected

Ok, I read along as you guys discussed the bug. I can tell you that
your proposed fix sounds great to me, I see no reason why a more
advanced user can't comment out some lines in their .bashrc. Though I
think it might be prudent to add a line to the tar manual mentioning
the alias. I can also tell you that the alias would not have helped
me as I use zsh. And that when asked if I was an advanced linux user,
would probably have said yes. I just think it is really odd behavior,
very wrong. There are many things in ubuntu which I don't think are
standard unixisms. Most cli programs prompt far more often than those
on other linux's I have used. Would it be possible to make it so that
there was an alias, that instead of doing a backup, prompted? Could
you make the prompting check to see if it was in an interactive
terminal or not, and only prompt if it wasn't some behind the scenes
shell script?

On 5/17/07, Micah Cowan <email address hidden> wrote:
> A contributor to the discussion, Scott Kitterman, recommended that the
> appropriate action for this bug is to close it as "works as designed",
> and invite you to submit a specification for "system changes to reduce
> the risk of accidental data loss by new users."
>
> > That's, I think, the right way to deal with this type of design issue.
> Also
> > it gives them a chance to be involved in the discussion and the community
> and
> > feel valued.
>
> I believe I agree with that. That would be the best way to get the right
> kind of discussion, and maximum community interaction, to find the best
> possible solution.
>
>
> ** Changed in: bash (Ubuntu)
> Assignee: Micah Cowan => (unassigned)
> Status: Confirmed => Rejected
>
> --
> Tar overwrites without prompting by default
> https://bugs.launchpad.net/bugs/113154
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
-
Tim
<email address hidden>

To post a comment you must log in.
This report contains Public Security information  Edit
Everyone can see this security related information.

Other bug subscribers