From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43722 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OrFTN-0004Lz-Sq for qemu-devel@nongnu.org; Thu, 02 Sep 2010 15:29:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OrFTM-0004hL-KK for qemu-devel@nongnu.org; Thu, 02 Sep 2010 15:29:21 -0400 Received: from e31.co.us.ibm.com ([32.97.110.149]:47946) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OrFTM-0004hB-FG for qemu-devel@nongnu.org; Thu, 02 Sep 2010 15:29:20 -0400 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by e31.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id o82JHLw2029817 for ; Thu, 2 Sep 2010 13:17:21 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o82JTJkM167940 for ; Thu, 2 Sep 2010 13:29:19 -0600 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 o82JTIpx022207 for ; Thu, 2 Sep 2010 13:29:19 -0600 From: "Venkateswararao Jujjuri (JV)" Date: Thu, 2 Sep 2010 12:39:42 -0700 Message-Id: <1283456388-13083-23-git-send-email-jvrao@linux.vnet.ibm.com> In-Reply-To: <1283456388-13083-1-git-send-email-jvrao@linux.vnet.ibm.com> References: <1283456388-13083-1-git-send-email-jvrao@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH -V5 22/28] 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 58e7647..132816e 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