From patchwork Tue Dec 21 05:20:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harsh Prateek Bora X-Patchwork-Id: 76260 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 86512B70A4 for ; Tue, 21 Dec 2010 16:21:41 +1100 (EST) Received: from localhost ([127.0.0.1]:60193 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PUufK-0005h3-9G for incoming@patchwork.ozlabs.org; Tue, 21 Dec 2010 00:21:38 -0500 Received: from [140.186.70.92] (port=38032 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PUuej-0005gg-9U for qemu-devel@nongnu.org; Tue, 21 Dec 2010 00:21:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PUueg-00058m-LH for qemu-devel@nongnu.org; Tue, 21 Dec 2010 00:21:01 -0500 Received: from e28smtp04.in.ibm.com ([122.248.162.4]:40750) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PUuef-00055s-Uq for qemu-devel@nongnu.org; Tue, 21 Dec 2010 00:20:58 -0500 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by e28smtp04.in.ibm.com (8.14.4/8.13.1) with ESMTP id oBL5Kqkp016842 for ; Tue, 21 Dec 2010 10:50:52 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oBL5KqX21437884 for ; Tue, 21 Dec 2010 10:50:52 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oBL5KpO5014711 for ; Tue, 21 Dec 2010 10:50:51 +0530 Received: from harshbora.in.ibm.com ([9.124.35.45]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id oBL5KpES014708; Tue, 21 Dec 2010 10:50:51 +0530 From: Harsh Prateek Bora To: qemu-devel@nongnu.org Date: Tue, 21 Dec 2010 10:50:48 +0530 Message-Id: <1292908848-8381-1-git-send-email-harsh@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: Harsh Prateek Bora Subject: [Qemu-devel] [PATCH v2] hw/virtio-9p-local.c: Remove unnecessary null char in symlink file 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 This patch removes the addition of null char in symlink file which is being appended to file in case of mapped security model. Without this patch, the extra null char causes LTP testcase lstat03 to fail and hence this fix is required. v2: - Description updated to mention about LTP lstat testcase failure without this patch. Signed-off-by: Harsh Prateek Bora --- 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 656bfb3..3b6447d 100644 --- a/hw/virtio-9p-local.c +++ b/hw/virtio-9p-local.c @@ -370,7 +370,7 @@ static int local_symlink(FsContext *fs_ctx, const char *oldpath, return fd; } /* Write the oldpath (target) to the file. */ - oldpath_size = strlen(oldpath) + 1; + oldpath_size = strlen(oldpath); do { write_size = write(fd, (void *)oldpath, oldpath_size); } while (write_size == -1 && errno == EINTR);