From owner-freebsd-questions@FreeBSD.ORG Tue Oct 7 13:00: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 C3BEC106569F for ; Tue, 7 Oct 2008 13:00:35 +0000 (UTC) (envelope-from valentin.bud@gmail.com) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.28]) by mx1.freebsd.org (Postfix) with ESMTP id 7A7AA8FC12 for ; Tue, 7 Oct 2008 13:00:35 +0000 (UTC) (envelope-from valentin.bud@gmail.com) Received: by yw-out-2324.google.com with SMTP id 9so556080ywe.13 for ; Tue, 07 Oct 2008 06:00:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=DpSMhyCBBCEJDsg4t2MsEdtJi7CZp7/exehcAPXawS0=; b=Itb6t8gPyAsIZQL3Uv3jE76OZDWQXJi974KdkrCxAPZOrM+T2XXmiQT9cXccQEsoiH KjWArzA1EEYweAPVn2llcQOuey1YwebjDe0b2mYuixri1ICM2KNykoJOEA5RFEhnGt9J pcrq03v4EiqX5W7gpjZ/sRPkdx/SHuDM0pFQY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=gbAxKwuHhWMtjRdwve0BawXj1kQSz0vAhM5QiUufFIMWrcVnvrTfIEDUEy7R7bZIwp KgSuwIqMYVceRvetqXV7df2uIMbYWXmXy0Ag/4du9WldyseAH2cBtoBIXTuIO44tbsgh nEm1IKBzk8ACAipl+ypZKZcF9wWZkBj+ZScw4= Received: by 10.142.51.4 with SMTP id y4mr2651533wfy.57.1223384433925; Tue, 07 Oct 2008 06:00:33 -0700 (PDT) Received: by 10.142.154.10 with HTTP; Tue, 7 Oct 2008 06:00:33 -0700 (PDT) Message-ID: <139b44430810070600o99c3a7aw51e6d54a88d4246c@mail.gmail.com> Date: Tue, 7 Oct 2008 15:00:33 +0200 From: "Valentin Bud" 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 13:00:35 -0000 Hello mr. John, On Tue, Oct 7, 2008 at 2: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 Depends on what ftp daemon you use. All the ftp server programs have a way to enforce the umask. See http://en.wikipedia.org/wiki/Umask for a better understanding to what umask is. all the best, v > > > _______________________________________________ > 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" >