From patchwork Wed Jun 30 04:45:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 57372 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BBABE1007D1 for ; Wed, 30 Jun 2010 14:46:33 +1000 (EST) Received: from localhost ([127.0.0.1]:38492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTpBu-0007oP-I2 for incoming@patchwork.ozlabs.org; Wed, 30 Jun 2010 00:46:30 -0400 Received: from [140.186.70.92] (port=59913 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTpAl-0007nj-AI for qemu-devel@nongnu.org; Wed, 30 Jun 2010 00:45:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OTpAk-0002xW-4S for qemu-devel@nongnu.org; Wed, 30 Jun 2010 00:45:19 -0400 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:53347) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OTpAj-0002xO-Gt for qemu-devel@nongnu.org; Wed, 30 Jun 2010 00:45:18 -0400 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.31.245]) by e23smtp02.au.ibm.com (8.14.4/8.13.1) with ESMTP id o5U4fNS1019585 for ; Wed, 30 Jun 2010 14:41:23 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o5U4jDnV1585212 for ; Wed, 30 Jun 2010 14:45:14 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o5U4jDcO023130 for ; Wed, 30 Jun 2010 14:45:13 +1000 Received: from skywalker.in.ibm.com ([9.77.195.164]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o5U4jAI5023096; Wed, 30 Jun 2010 14:45:11 +1000 From: "Aneesh Kumar K.V" To: qemu-devel@nongnu.org Date: Wed, 30 Jun 2010 10:15:09 +0530 Message-Id: <1277873109-7873-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.2.rc0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: aliguori@us.ibm.com, "Aneesh Kumar K.V" Subject: [Qemu-devel] [PATCH] virtio-9p: Use lchown which won't follow symlink X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org We should always use functions which don't follow symlink on the server Signed-off-by: Aneesh Kumar K.V --- 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