Re: #19519: tmpreaper: Will not remove dirs
Rob Browning <rlb@cs.utexas.edu> writes:
> Assuming that you don't have to worry about new files inserted into
> the tree while tmpreaper is running (do you?), then it's probably
> easiest to just do this operation in two passes. (This is off the top
> of my head, so I'm nearly certain there's a better approach):
Actually, I realized that the algorithm I posted may not be safe
enough. It probably has the same race conditions as the traditional
"find | xargs" solution, but if for each file you kept:
path
timestamp
creation-date
inode
and refused to delete anything whose inode number (or creation date if
the inode is the same) had changed since you last looked, would that
be safe? Is there any way to atomically get the inode number/creation
date and delete the file after checking it?
Not being a security expert, I should probably shut up now.
--
Rob Browning <rlb@cs.utexas.edu>
PGP fingerprint = E8 0E 0D 04 F5 21 A0 94 53 2B 97 F5 D6 4E 39 30
--
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: