From owner-freebsd-bugs@FreeBSD.ORG Sat Feb 23 13:40:01 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AF2416A40D for ; Sat, 23 Feb 2008 13:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4F91F13C4D3 for ; Sat, 23 Feb 2008 13:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m1NDe1ag099272 for ; Sat, 23 Feb 2008 13:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m1NDe1If099271; Sat, 23 Feb 2008 13:40:01 GMT (envelope-from gnats) Resent-Date: Sat, 23 Feb 2008 13:40:01 GMT Resent-Message-Id: <200802231340.m1NDe1If099271@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jeremy Chadwick Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E859416A400 for ; Sat, 23 Feb 2008 13:38:07 +0000 (UTC) (envelope-from jdc@parodius.com) Received: from mx01.sc1.parodius.com (mx01.sc1.parodius.com [72.20.106.3]) by mx1.freebsd.org (Postfix) with ESMTP id CE3C513C501 for ; Sat, 23 Feb 2008 13:38:07 +0000 (UTC) (envelope-from jdc@parodius.com) Received: by mx01.sc1.parodius.com (Postfix, from userid 1000) id ADAD41CC033; Sat, 23 Feb 2008 05:38:07 -0800 (PST) Message-Id: <20080223133807.ADAD41CC033@mx01.sc1.parodius.com> Date: Sat, 23 Feb 2008 05:38:07 -0800 (PST) From: Jeremy Chadwick To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: conf/120993: 340.noid -- Add "find -x" capability (don't cross fs boundaries) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jeremy Chadwick List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Feb 2008 13:40:01 -0000 >Number: 120993 >Category: conf >Synopsis: 340.noid -- Add "find -x" capability (don't cross fs boundaries) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Sat Feb 23 13:40:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Jeremy Chadwick >Release: FreeBSD 6.3-PRERELEASE i386 >Organization: >Environment: System: FreeBSD eos.sc1.parodius.com 6.3-PRERELEASE FreeBSD 6.3-PRERELEASE #0: Mon Jan 14 17:48:12 PST 2008 root@eos.sc1.parodius.com:/usr/obj/usr/src/sys/EOS i386 >Description: Our backup server running FreeBSD rsync to do backups for all other machines on our network, storing the results in /storage (which is its own filesystem). All of our systems have different /etc/passwd and /etc/group files -- they are not identical across all machines. When weekly_noid_enable="yes" is used in periodic.conf on said server, find(1) will traverse / (see $weekly_noid_dirs), and **will** cross fs boundaries. This results in a 35MByte mail from "periodic weekly", which isn't desirable. >How-To-Repeat: See description. :-) >Fix: Add support for the -x argument to find(1) in 340.noid. Below is the patch, and has been tested on both RELENG_7 and RELENG_6 with success. With this patch, we can then do use the following in periodic.conf, thus stopping find(1) from ever hitting /storage: weekly_noid_enable="yes" weekly_noid_crossfs="no" weekly_noid_dirs="/ /var /tmp /usr" periodic.conf(5) will also need to be updated to reflect this addition. --- 340.noid.orig 2008-02-23 05:33:55.000000000 -0800 +++ 340.noid 2008-02-23 05:34:44.000000000 -0800 @@ -11,12 +11,19 @@ source_periodic_confs fi +crossfs="" +case "$weekly_noid_crossfs" in + [Nn][Oo]) + crossfs="-x" + ;; +esac + case "$weekly_noid_enable" in [Yy][Ee][Ss]) echo "" echo "Check for files with an unknown user or group:" - rc=$(find -H ${weekly_noid_dirs:-/} \ + rc=$(find -H ${crossfs} ${weekly_noid_dirs:-/} \ \( ! -fstype local -prune -or -name \* \) -and \ \( -nogroup -o -nouser \) -print | sed 's/^/ /' | tee /dev/stderr | wc -l) >Release-Note: >Audit-Trail: >Unformatted: