From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=53876 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oby7l-00058d-58 for qemu-devel@nongnu.org; Thu, 22 Jul 2010 11:55:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oby7j-0001gy-KQ for qemu-devel@nongnu.org; Thu, 22 Jul 2010 11:55:53 -0400 Received: from e34.co.us.ibm.com ([32.97.110.152]:34027) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oby7j-0001gf-EL for qemu-devel@nongnu.org; Thu, 22 Jul 2010 11:55:51 -0400 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e34.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id o6MFlOC5027798 for ; Thu, 22 Jul 2010 09:47:24 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o6MFtZFt048878 for ; Thu, 22 Jul 2010 09:55:36 -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 o6MFtVx3000701 for ; Thu, 22 Jul 2010 09:55:31 -0600 From: "Venkateswararao Jujjuri (JV)" Date: Thu, 22 Jul 2010 08:58:09 -0700 Message-Id: <1279814291-8301-23-git-send-email-jvrao@linux.vnet.ibm.com> In-Reply-To: <1279814291-8301-1-git-send-email-jvrao@linux.vnet.ibm.com> References: <1279814291-8301-1-git-send-email-jvrao@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH-V3 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 bc6793a..30e1bda 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