From owner-freebsd-questions@FreeBSD.ORG Tue Oct 7 12:54:39 2008 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 E65D0106568E for ; Tue, 7 Oct 2008 12:54:39 +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 847658FC1B for ; Tue, 7 Oct 2008 12:54:38 +0000 (UTC) (envelope-from jalmberg@identry.com) Received: (qmail 47319 invoked by uid 89); 7 Oct 2008 12:54:38 -0000 Received: from unknown (HELO ?192.168.1.110?) (jalmberg@75.127.142.66) by mx1.identry.com with ESMTPA; 7 Oct 2008 12:54:38 -0000 Mime-Version: 1.0 (Apple Message framework v753.1) Content-Transfer-Encoding: 7bit Message-Id: <0C63914A-E3A3-4FC7-92AD-797F407A5FF7@identry.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: freebsd-questions@freebsd.org From: John Almberg Date: Tue, 7 Oct 2008 08:54:36 -0400 X-Mailer: Apple Mail (2.753.1) Subject: thorny (for me) permissions problem 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: Tue, 07 Oct 2008 12:54:40 -0000 The following permissions problem has me stumped: 1. User A uploads a file (using ftp) to the server, into a directory called 'data' owned by user B. Permissions on directory set to allow this, like this: drwxrwxr-x 2 user_b user_b 512 Oct 7 08:40 data 2. A cron job, run by user B, then processes the file 3. When the processing is complete, the cron job needs to delete the file from the server 4. however, after upload, the file has the ownership A:B (i.e, owned by A, group B) with permissions -rw-r--r--. So B does not have permission to delete the file. -rw-r--r-- 1 user_a user_b 154879 Oct 7 08:40 data_file.csv The ftp user can manually change the permissions on the file to -rw- rw-r--, but I do not want to depend on the user remembering to change permissions. If he forgets, the cronjob will process the file over and over again. I need the server to handle this, so it gets done correctly 100% of the time. B does not have sufficient permissions to delete the file or change it's permissions. The only thing I can think of is to have ANOTHER cron job, run by A, run every few minutes to check for the existence of a file, and change the permissions so B can delete it. But this smells like a kludge to me. Is there a correct way to handle this? For instance, is there something I can set in A's profile, so when he uploads a file, the group permission is set to rw? That would be a nice clean way to do it, but I can't find anything like that. Any help, much appreciated. -- John