From owner-freebsd-questions@FreeBSD.ORG Sat May 12 15:43:27 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DADC5106564A for ; Sat, 12 May 2012 15:43:27 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 976938FC08 for ; Sat, 12 May 2012 15:43:27 +0000 (UTC) Received: from r56.edvax.de (port-92-195-20-192.dynamic.qsc.de [92.195.20.192]) by mx01.qsc.de (Postfix) with ESMTP id C84B33CEAD; Sat, 12 May 2012 17:43:26 +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 q4CFhQBf002730; Sat, 12 May 2012 17:43:26 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sat, 12 May 2012 17:43:26 +0200 From: Polytropon To: fake fake Message-Id: <20120512174326.62b4594f.freebsd@edvax.de> In-Reply-To: References: 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 Cc: freebsd-questions@freebsd.org Subject: Re: file permission template X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 May 2012 15:43:27 -0000 On Sun, 13 May 2012 00:15:54 +0900, fake fake wrote: > Thanks. But I need specific directory only. > umask way seems to set mode not only under ~/secret but other > directories like ~/public. You're sure you want to have something _public_ in your home directory? > Is there any elegant way? Depends on how the files are created. A possibility is to set umask prior to creating files, and resetting it to its previous value when being done. If files are created automatically, this could be done by a shell script. Such a script could also be used to "copy to secure directory", performing the cp and the chmod step. However, is there any problem _for your particular case_ that setting secret/ to rwx/-/- only, and leaving the files inside with the default umask rw/r/r? Maybe there really is a more elegant way. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...