From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51427 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Opn04-0002CR-Bo for qemu-devel@nongnu.org; Sun, 29 Aug 2010 14:53:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Opn01-0001cz-N4 for qemu-devel@nongnu.org; Sun, 29 Aug 2010 14:53:04 -0400 Received: from e4.ny.us.ibm.com ([32.97.182.144]:34128) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Opn01-0001cs-Ko for qemu-devel@nongnu.org; Sun, 29 Aug 2010 14:53:01 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e4.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id o7TIc40L013487 for ; Sun, 29 Aug 2010 14:38:04 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o7TIr0Er096498 for ; Sun, 29 Aug 2010 14:53:01 -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 o7TIr0Sk004341 for ; Sun, 29 Aug 2010 12:53:00 -0600 From: "Venkateswararao Jujjuri (JV)" Date: Sun, 29 Aug 2010 12:02:48 -0700 Message-Id: <1283108572-20228-23-git-send-email-jvrao@linux.vnet.ibm.com> In-Reply-To: <1283108572-20228-1-git-send-email-jvrao@linux.vnet.ibm.com> References: <1283108572-20228-1-git-send-email-jvrao@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH -V4 22/26] 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 6a2108c..eb4797b 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