Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753590AbaATKbe (ORCPT ); Mon, 20 Jan 2014 05:31:34 -0500 Received: from mail1.SerNet.de ([193.175.80.2]:50548 "EHLO mail.SerNet.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751732AbaATKbc (ORCPT ); Mon, 20 Jan 2014 05:31:32 -0500 Date: Mon, 20 Jan 2014 11:31:13 +0100 Date: Mon, 20 Jan 2014 11:31:13 +0100 From: Volker Lendecke To: Pavel Shilovsky Cc: Kernel Mailing List , linux-cifs , linux-fsdevel , Linux NFS Mailing list , wine-devel@winehq.org Subject: Re: [PATCH v7 0/7] Add O_DENY* support for VFS and CIFS/NFS Reply-To: Volker.Lendecke@SerNet.DE References: <1389953232-9428-1-git-send-email-piastry@etersoft.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Message-Id: Organization: SerNet GmbH, Goettingen, Germany Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 20, 2014 at 02:20:43PM +0400, Pavel Shilovsky wrote: > > One question: If Samba wants to open a file for delete > > access, there's no corresponding flag in the open > > permissions. There can be the case where Samba wants to open > > *just* for future unlink, no read or write access required. > > Is there a way to achieve this atomically correct? > > You can try to use O_PATH flag. It doesn't give you a delete access > but should be ok because further deleting will be done without file > descriptor -- through unlink syscall. Ok, I did not know about O_PATH. Thanks for that! So I do an open with O_PATH. How do I then make sure that nobody else has a O_DENYDELETE set without doing the unlink itself? Thanks, Volker -- SerNet GmbH, Bahnhofsallee 1b, 37081 G?ttingen phone: +49-551-370000-0, fax: +49-551-370000-9 AG G?ttingen, HRB 2816, GF: Dr. Johannes Loxen http://www.sernet.de, mailto:kontakt@sernet.de -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/