From patchwork Wed Jul 21 16:04:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jvrao X-Patchwork-Id: 59482 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 D8CCDB70B7 for ; Thu, 22 Jul 2010 02:51:02 +1000 (EST) Received: from localhost ([127.0.0.1]:43976 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ObcVX-0002fG-C1 for incoming@patchwork.ozlabs.org; Wed, 21 Jul 2010 12:50:59 -0400 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 Received: from localhost.localdomain (elm9m80.beaverton.ibm.com [9.47.81.80]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o6LG25Rk015184; Wed, 21 Jul 2010 10:02:28 -0600 From: "Venkateswararao Jujjuri (JV)" To: qemu-devel@nongnu.org Date: Wed, 21 Jul 2010 09:04:57 -0700 Message-Id: <1279728299-28482-23-git-send-email-jvrao@linux.vnet.ibm.com> X-Mailer: git-send-email 1.6.0.6 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: aliguori@us.ibm.com, Venkateswararao Jujjuri , "Aneesh Kumar K.V" Subject: [Qemu-devel] [PATCH-V2 22/24] 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 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