From owner-freebsd-questions@FreeBSD.ORG Mon Apr 20 19:21:32 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A6D010656BD for ; Mon, 20 Apr 2009 19:21:32 +0000 (UTC) (envelope-from jalmberg@identry.com) Received: from mx1.identry.com (on.identry.com [66.111.0.194]) by mx1.freebsd.org (Postfix) with ESMTP id D654E8FC13 for ; Mon, 20 Apr 2009 19:21:31 +0000 (UTC) (envelope-from jalmberg@identry.com) Received: (qmail 72938 invoked by uid 89); 20 Apr 2009 19:22:06 -0000 Received: from unknown (HELO ?192.168.1.110?) (jalmberg@75.127.142.66) by mx1.identry.com with ESMTPA; 20 Apr 2009 19:22:06 -0000 In-Reply-To: <1F1D939A-3787-4C5A-995B-93EDABF0BE5A@identry.com> References: <1F1D939A-3787-4C5A-995B-93EDABF0BE5A@identry.com> Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: John Almberg Date: Mon, 20 Apr 2009 15:21:29 -0400 To: John Almberg X-Mailer: Apple Mail (2.753.1) Cc: freebsd-questions@freebsd.org Subject: Re: Sorting out owner and group permissions... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Apr 2009 19:21:32 -0000 On Apr 20, 2009, at 2:48 PM, John Almberg wrote: > I have a directory called 'scans' that is owned by 'master', but I > want to allow 'customer' to FTP images to that directory. This is > the way I have permissions set: > > # ls -l > drwxrwxr-x 5 master customer 251904 Apr 20 10:29 scans > > The problem is that when customer ftp's a file to the directory, > the permissions end up like this: > > -rw-r----- 1 customer customer 772584 Apr 20 15:28 image.jpg > > When a process run by 'master' tries to copy this file to another > directory (also owned by master), I get the following: > > # cp scans/image.jpg thumbs/image.jpg > cp: scans/image.jpg: Permission denied > > The only solution that occurs to me smells like a newbie kludge: to > have a root cron job periodically chown all the images to > master:customer. This seems like the proverbial sledgehammer. There > must be a better way? > > Any thoughts, much appreciated! Well, I did figure out one way that seems reasonable... since I am using pureftpd, I changed the upload mask in the pureftpd configuration so new files are created with permissions like: -rw-r--r-- 1 customer customer 93177 Apr 20 20:12 image.jpg This seems like a pretty good approach, but if there's a better one, I'm all ears! -- John