Received: from [140.186.70.92] (port=39197 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Obbty-00056B-IB for qemu-devel@nongnu.org; Wed, 21 Jul 2010 12:12:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ObblN-0000Wp-NF for qemu-devel@nongnu.org; Wed, 21 Jul 2010 12:03:19 -0400 Received: from e6.ny.us.ibm.com ([32.97.182.146]:52658) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ObblN-0000WL-D6 for qemu-devel@nongnu.org; Wed, 21 Jul 2010 12:03:17 -0400 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by e6.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id o6LG2O5u013640 for ; Wed, 21 Jul 2010 12:02:24 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o6LG3CxQ078568 for ; Wed, 21 Jul 2010 12:03:13 -0400 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o6LG2Tfb018297 for ; Wed, 21 Jul 2010 10:02:32 -0600 From: "Venkateswararao Jujjuri (JV)" Date: Wed, 21 Jul 2010 09:04:57 -0700 Message-Id: <1279728299-28482-23-git-send-email-jvrao@linux.vnet.ibm.com> In-Reply-To: <1279728299-28482-1-git-send-email-jvrao@linux.vnet.ibm.com> References: <1279728299-28482-1-git-send-email-jvrao@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH-V2 22/24] virtio-9p: Use lchown which won't follow symlink List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, Venkateswararao Jujjuri , "Aneesh Kumar K.V" From: Aneesh Kumar K.V We should always use functions which don't follow symlink on the server Signed-off-by: Aneesh Kumar K.V Signed-off-by: Venkateswararao Jujjuri --- hw/virtio-9p-local.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/virtio-9p-local.c b/hw/virtio-9p-local.c index 67f12ad..3aaf4b7 100644 --- a/hw/virtio-9p-local.c +++ b/hw/virtio-9p-local.c @@ -101,7 +101,7 @@ static int local_post_create_passthrough(FsContext *fs_ctx, const char *path, if (chmod(rpath(fs_ctx, path), credp->fc_mode & 07777) < 0) { return -1; } - if (chown(rpath(fs_ctx, path), credp->fc_uid, credp->fc_gid) < 0) { + if (lchown(rpath(fs_ctx, path), credp->fc_uid, credp->fc_gid) < 0) { /* * If we fail to change ownership and if we are * using security model none. Ignore the error -- 1.6.5.2