bugGNU tar - Bugs: bug #8194, Misplaced faith in unlink system...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #8194: Misplaced faith in unlink system call

Submitted by:  None
Submitted on:  Thu 18 Mar 2004 11:11:13 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

Tue 29 Jun 2004 10:28:25 AM UTC, comment #1:

The patch breaks tar functionality.

Sergey Poznyakoff <gray>
Project Administrator
Thu 18 Mar 2004 11:11:13 PM UTC, original submission:

Version 1.13.25 of tar contains a new version of the
function "remove_any_file" in misc.c. This version
"optimizes" away a single lstat call per file compared
to the old version. It does this by relying on a side
effect of the unlink call. IMHO, this "optimization" is
misplaced, if the unlink call misbehaves there can be
destruction of files. If you read the POSIX standard it
is only optional for unlink not work on directories if
you aren't root. We have had some disasterous results
with the recent version of tar in combination with a
mis-behaving unlink call.

IMHO, tar should err on the side of robustness rather
than foolish optimizations. It should never call unlink
on a directory or rmdir on a file. While I admit it's
a nice elegant hack, it is not IMHO very robust and
as far as an "optimization" goes, no benchmark will
ever be able to prove it faster. While using lstat
may be boring, it is FAR FAR more robuse than relying
on the side effects of syscalls.

Anonymous

 

Attached Files
file #1138:  misc.c.diff added by None (756B - application/octet-stream - Diff to src/misc.c)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Tue 29 Jun 2004 10:28:25 AM UTCgrayOpen/ClosedOpen=>Closed
Thu 18 Mar 2004 11:11:13 PM UTCNoneAttached File-=>Added misc.c.diff, #1119

Back to the top


Powered by Savane 3.1-cleanup1