From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTa7W-0006Fi-Hy for qemu-devel@nongnu.org; Thu, 05 Mar 2015 13:03:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YTa7T-0000YD-23 for qemu-devel@nongnu.org; Thu, 05 Mar 2015 13:03:38 -0500 Received: from e23smtp04.au.ibm.com ([202.81.31.146]:46296) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTa7S-0000WV-44 for qemu-devel@nongnu.org; Thu, 05 Mar 2015 13:03:34 -0500 Received: from /spool/local by e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 6 Mar 2015 04:03:28 +1000 Received: from d23relay06.au.ibm.com (d23relay06.au.ibm.com [9.185.63.219]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 7AB842CE8040 for ; Fri, 6 Mar 2015 05:03:23 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t25I3EQ752559902 for ; Fri, 6 Mar 2015 05:03:23 +1100 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t25I2nhH015344 for ; Fri, 6 Mar 2015 05:02:49 +1100 From: "Aneesh Kumar K.V" In-Reply-To: <54F774CB.1040001@msgid.tls.msk.ru> References: <54F774CB.1040001@msgid.tls.msk.ru> Date: Thu, 05 Mar 2015 23:32:30 +0530 Message-ID: <87oao7s4p5.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] 9pfs-local: open2() deletes existing data? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev Cc: qemu-devel Michael Tokarev writes: > I was looking at various interesting functions in hw/9pfs/virtio-9p-local.c > and noticed local_open2() which basically tries to open a file in a > filesystem, and if that is successful, it tries to set file credentials > using a configured mechanism, and if that fails, it deletes the file. > > Now I wonder what happens if we tried to open an existing file but was > not able to set credentials for whatever reason -- eg, because the > underlying filesystem does not support xattrs, or whatever. It looks > to me that we will remove the user file! > > If that's the case, it looks like it is a very serious bug... That callback is used for create. What is used for open is local_open() -aneesh