[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: #19519: tmpreaper: Will not remove dirs



 [ Please remove CC's of impertinent replies to the bugs address. ]

 Summary:  `tmpreaper' will not remove empty dirs because the atime
 gets changed by `ls' or any touch of the directory.  I've been asked
 to implement an option to delete empty dirs with (>= mtime+grace now).

 There is some difficulty in programming this `mtime-mt-dir' option.
 The problem is that it must first recurse down any subdirectories to
 look for files to remove there, prior to attempting to remove the
 directory itself.  If there's any files there that get removed, the
 mtime of that directory will be changed.

 I'm afraid I'm just not knowledgeable enough to do this quickly.  It
 will require building a list of files and directories to remove prior
 to recursing down the /tmp tree.

 Perhaps it should be rewritten in `suid-perl' or `suidexec scsh'?

 I would really appreciate it if a more experienced programmer would
 spend an afternoon rewriting `tmpreaper', if you must have it right
 away.  Otherwise, expect it to take me a few weeks.  I must study the
 problem and learn not only the algorithm, but the data structure iff
 I implement in `c'.  Would someone assist me in designing the
 program?  I am unsure of how to approach the problem.

 Q: Does anyone know if `ftw' is safe to use for this purpose, or does
 it suffer from the same problems as `find ... -exec rm {} \;'?

 (remind me to keep in mind that `scsh' ought to be checked for suid
 safety as I learn how it operates.)


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


Reply to: