Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 114218 - app-admin/tmpreaper - tmpreaper --protect doesn't work on directories
Summary: app-admin/tmpreaper - tmpreaper --protect doesn't work on directories
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-01 18:13 UTC by Andy Lutomirski
Modified: 2006-12-05 11:21 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
A proposed "fix" (tmpreaper.patch,849 bytes, patch)
2005-12-01 18:14 UTC, Andy Lutomirski
Details | Diff
Rediffed patch against 1.6.6 (tmpreaper_1.6.6_protect.patch,1.13 KB, patch)
2006-12-05 11:06 UTC, Andy Lutomirski
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Lutomirski 2005-12-01 18:13:26 UTC
tmpreaper --protect can't protect directories.   I emailed paul@debian.org (the
apparent upstream maintainer) two weeks ago but haven't heard back.  I'll attach
a relatively trivial patch.

I discovered this issue when tmpreaper was blowing my OpenAFS cache away.

Is a patch of this form (which arguably isn't a bugfix but adds functionality)
appropriate for Gentoo, or should I just keep bugging Paul?


To reproduce this issue, do:  (Look for the line "Pretending to remove file
`bar/baz'." -- that IMHO shouldn't have happened.)

# touch foo
# mkdir bar
# touch bar/baz
# tmpreaper -t --protect=bar 0d .
(PID 4573) Pretending to clean up directory `.'.
(PID 4574) Pretending to clean up directory `bar'.
Pretending to remove file `bar/baz'.
(PID 4574) Back from recursing down `bar'.
Entry matching `--protect' pattern skipped. `bar'
Pretending to remove file `./foo'.

Reproducible: Always
Steps to Reproduce:
To reproduce this issue, do:  (Look for the line "Pretending to remove file
`bar/baz'." -- that IMHO shouldn't have happened.)

# touch foo
# mkdir bar
# touch bar/baz
# tmpreaper -t --protect=bar 0d .
(PID 4573) Pretending to clean up directory `.'.
(PID 4574) Pretending to clean up directory `bar'.
Pretending to remove file `bar/baz'.
(PID 4574) Back from recursing down `bar'.
Entry matching `--protect' pattern skipped. `bar'
Pretending to remove file `./foo'.



Expected Results:  
I expected this:

(PID 10796) Pretending to clean up directory `.'.
Pretending to remove file `./foo'.
Entry matching `--protect' pattern skipped. `bar'

The patched version does this.
Comment 1 Andy Lutomirski 2005-12-01 18:14:17 UTC
Created attachment 73914 [details, diff]
A proposed "fix"

I think that this is correct (it just moves the check for protection before the
recursion down the directory tree).
Comment 2 Andy Lutomirski 2006-04-04 08:51:40 UTC
Ping?
Comment 3 Charlie Shepherd (RETIRED) gentoo-dev 2006-12-04 14:22:42 UTC
Thanks, fixed in CVS
Comment 4 Chris L. Mason 2006-12-05 07:32:49 UTC
This doesn't seem to work, when I emerge I get this:

>>> Unpacking source...
>>> Unpacking tmpreaper_1.6.6.tar.gz to /debian/var/tmp/portage/tmpreaper-1.6.6-r1/work
/usr/portage/app-admin/tmpreaper/tmpreaper-1.6.6-r1.ebuild: line 19: epatch: command not found

If I try to apply the patch manually, it is rejected.

Thanks.
Comment 5 Chris L. Mason 2006-12-05 10:22:38 UTC
bump, as I never got an email before, and presumably no one else did either.
Comment 6 Charlie Shepherd (RETIRED) gentoo-dev 2006-12-05 10:51:59 UTC
(In reply to comment #5)
> bump, as I never got an email before, and presumably no one else did either.

Sorry for the screw-up - I'm working on it...
Comment 7 Andy Lutomirski 2006-12-05 11:06:50 UTC
Created attachment 103406 [details, diff]
Rediffed patch against 1.6.6

This one applies to 1.6.6.  It's the same fix (moving the test up).  It seems to work, too.
Comment 8 Andy Lutomirski 2006-12-05 11:14:15 UTC
Reopening b/c this isn't actually fixed.
Comment 9 Charlie Shepherd (RETIRED) gentoo-dev 2006-12-05 11:21:02 UTC
(In reply to comment #7)
> Created an attachment (id=103406) [edit]
> Rediffed patch against 1.6.6
> 
> This one applies to 1.6.6.  It's the same fix (moving the test up).  It seems
> to work, too.
> 

Thanks again, please ignore my reply to your mail - I didn't notice this bugzie mail :\

Should be fixed in CVS now