From owner-freebsd-questions@FreeBSD.ORG Tue Oct 7 14:05:35 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 E4F1A106568E for ; Tue, 7 Oct 2008 14:05:35 +0000 (UTC) (envelope-from jeremyhooks@googlemail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by mx1.freebsd.org (Postfix) with ESMTP id 6B6288FC39 for ; Tue, 7 Oct 2008 14:05:35 +0000 (UTC) (envelope-from jeremyhooks@googlemail.com) Received: by ug-out-1314.google.com with SMTP id m2so220475uge.39 for ; Tue, 07 Oct 2008 07:05:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=cUgijUstdXBPfMWeI1x/B2oQv6sfeVqI+grTRWL6GOc=; b=kPO8/ETihYgSHMnXoHzwVblUewegq/ssMXE0SSsCtjGkMjD6Bjq6YJAZwykMFm/t/0 1toL1lawi/OI5KT1ximASn6AcJxK2GjeMf9sioHsj8jODTk1/EnhBEqv03UvKdAzPGs6 urm41hmrCmc45MwHCP1PJAJZwoVQOj+5kY5+g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=EEttpN1BD9pYnLracnCVxa5QdyrX/N/Mz33LW68LO8dpSCjmX8ibv85kGhVr1mF61T 3GqFGTt2xD30HuePvVmRuwh7lBYeuv1nXwIh/Xm0CiuNQxQYKMgsLH2iDEIMq6j6zQ+B y0DuvP/wBujJtXMonZhPYf13A8bHP25qeRGeg= Received: by 10.210.52.9 with SMTP id z9mr5195635ebz.70.1223386444476; Tue, 07 Oct 2008 06:34:04 -0700 (PDT) Received: by 10.210.82.9 with HTTP; Tue, 7 Oct 2008 06:34:04 -0700 (PDT) Message-ID: Date: Tue, 7 Oct 2008 14:34:04 +0100 From: "Jeremy Hooks" To: "John Almberg" In-Reply-To: <0C63914A-E3A3-4FC7-92AD-797F407A5FF7@identry.com> MIME-Version: 1.0 References: <0C63914A-E3A3-4FC7-92AD-797F407A5FF7@identry.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-questions@freebsd.org Subject: Re: 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 14:05:36 -0000 >> 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 Hi John. Correct me if I am wrong but permission to delete a file depends on the users permissions for the containing directory. If B has write permission on the directory then B can delete the file. However you will likely need to use 'rm -f'. Regards. Jeremy. On Tue, Oct 7, 2008 at 1:54 PM, John Almberg wrote: > 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 > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org" >