From nobody@FreeBSD.org  Fri Jun 22 16:10:45 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id EF54E37B406
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 22 Jun 2001 16:10:44 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.3/8.11.3) id f5MNAiQ83423;
	Fri, 22 Jun 2001 16:10:44 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200106222310.f5MNAiQ83423@freefall.freebsd.org>
Date: Fri, 22 Jun 2001 16:10:44 -0700 (PDT)
From: NIIMI Satoshi <sa2c@and.or.jp>
To: freebsd-gnats-submit@FreeBSD.org
Subject: /etc/periodic/daily/110.clean-tmps reports incorrect result
X-Send-Pr-Version: www-1.0

>Number:         28355
>Category:       misc
>Synopsis:       /etc/periodic/daily/110.clean-tmps reports incorrect result
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    brian
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 22 16:20:01 PDT 2001
>Closed-Date:    Thu Jul 19 05:09:23 PDT 2001
>Last-Modified:  Thu Jul 19 05:10:37 PDT 2001
>Originator:     NIIMI Satoshi
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
>Environment:
FreeBSD berkeley.us.and.or.jp 4.3-STABLE FreeBSD 4.3-STABLE #2: Thu Jun 21 18:28:33 JST 2001     sa2c@berkeley.us.and.or.jp:/usr/obj/usr/src/sys/BERKELEY  i386

>Description:
/etc/periodic/daily/110.clean-tmps reports like
>How-To-Repeat:
Insert 'daily_clean_disks_enable="YES"' in /etc/periodic.conf and type the following commands:
mkdir -p /tmp/path/to/dir
touch /tmp/path/to/dir/file
touch -t 19700102 /tmp/path/to/dir
/etc/periodic/daily/110.clean-tmps

>Fix:
diff -u -r1.10 110.clean-tmps
--- 110.clean-tmps      2000/09/14 17:19:10     1.10
+++ 110.clean-tmps      2001/06/22 22:46:34
@@ -41,7 +41,7 @@
                do
                    [ ."${dir#/}" != ."$dir" -a -d $dir ] && cd $dir && {
                        find -d . -type f $args -delete $print
-                       find -d . ! -name . -type d -mtime \
+                       find -d . ! -name . -type d -empty -mtime \
                            +$daily_clean_tmps_days -delete $print
                    } | sed "s,^\\.,  $dir,"
                done | tee /dev/stderr | wc -l)

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: brian 
State-Changed-When: Thu Jul 19 05:09:23 PDT 2001 
State-Changed-Why:  
Applied to -current, I'll MFC in 1 week. 
Thanks. 


Responsible-Changed-From-To: freebsd-bugs->brian 
Responsible-Changed-By: brian 
Responsible-Changed-When: Thu Jul 19 05:09:23 PDT 2001 
Responsible-Changed-Why:  
I'm responsible for this I guess 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=28355 
>Unformatted:
 >Removing old temporary files:
 >  /tmp/path/to/file
 >  /tmp/path/to/dir
 but if "/tmp/path/to/dir" is directory and is not empy, it is not deleted.
