From owner-freebsd-questions@freebsd.org Mon Jul 20 09:40:40 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FC099A6B66 for ; Mon, 20 Jul 2015 09:40:40 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FFB51F22 for ; Mon, 20 Jul 2015 09:40:39 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de (port-92-195-74-114.dynamic.qsc.de [92.195.74.114]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx02.qsc.de (Postfix) with ESMTPS id EC5B325386; Mon, 20 Jul 2015 11:40:36 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id t6K9ea0T002358; Mon, 20 Jul 2015 11:40:36 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Mon, 20 Jul 2015 11:40:36 +0200 From: Polytropon To: Scott Bennett Cc: freebsd-questions@freebsd.org Subject: Re: limiting find(1) in /etc/periodic scripts Message-Id: <20150720114036.b83e5116.freebsd@edvax.de> In-Reply-To: <201507200910.t6K9A9J6007857@sdf.org> References: <201507200910.t6K9A9J6007857@sdf.org> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2015 09:40:40 -0000 On Mon, 20 Jul 2015 04:10:09 -0500, Scott Bennett wrote: > What is the best way to keep find(1) in the various /etc/periodic > scripts from descending into certain directories? If I remember correctly, find will only descend into directories that have the o+rx attribute (readable by everyone). If you do not want a subtree to be searched, make sure it's +rx for the owner and +rx for the group, as well as +w where needed, usually +rwx for the user. A typical setting then is drwxr-x--- for such directories. There is another problem: Directories such as /root should not be searched. The problem is that there will be an additional information leak, like $ locate system_secrets /root/system_secrets.txt And if "descriptive" file names (including names, locations, ID numbers, etc.) are involved, well... -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...