From owner-svn-src-all@FreeBSD.ORG Fri Jun 6 12:45:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A534CDF3; Fri, 6 Jun 2014 12:45:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9161D2C2F; Fri, 6 Jun 2014 12:45:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56CjCxX016184; Fri, 6 Jun 2014 12:45:12 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56CjCDD016181; Fri, 6 Jun 2014 12:45:12 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201406061245.s56CjCDD016181@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 6 Jun 2014 12:45:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r267157 - stable/9/sys/geom/part X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 12:45:12 -0000 Author: ae Date: Fri Jun 6 12:45:11 2014 New Revision: 267157 URL: http://svnweb.freebsd.org/changeset/base/267157 Log: MFC r266880: Use g_conf_printf_escaped() to escape symbols, which can break an XML tree. Approved by: re (gjb) Modified: stable/9/sys/geom/part/g_part_apm.c stable/9/sys/geom/part/g_part_gpt.c stable/9/sys/geom/part/g_part_pc98.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/part/g_part_apm.c ============================================================================== --- stable/9/sys/geom/part/g_part_apm.c Fri Jun 6 12:37:56 2014 (r267156) +++ stable/9/sys/geom/part/g_part_apm.c Fri Jun 6 12:45:11 2014 (r267157) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "g_part_if.h" @@ -311,10 +312,14 @@ g_part_apm_dumpconf(struct g_part_table /* confxml: partition entry information */ strncpy(u.name, entry->ent.ent_name, APM_ENT_NAMELEN); u.name[APM_ENT_NAMELEN] = '\0'; - sbuf_printf(sb, "%s\n", indent, u.name); + sbuf_printf(sb, "%s\n"); strncpy(u.type, entry->ent.ent_type, APM_ENT_TYPELEN); u.type[APM_ENT_TYPELEN] = '\0'; - sbuf_printf(sb, "%s%s\n", indent, u.type); + sbuf_printf(sb, "%s", indent); + g_conf_printf_escaped(sb, "%s", u.type); + sbuf_printf(sb, "\n"); } else { /* confxml: scheme information */ } Modified: stable/9/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/9/sys/geom/part/g_part_gpt.c Fri Jun 6 12:37:56 2014 (r267156) +++ stable/9/sys/geom/part/g_part_gpt.c Fri Jun 6 12:45:11 2014 (r267157) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "g_part_if.h" @@ -1217,16 +1218,16 @@ g_gpt_printf_utf16(struct sbuf *sb, uint /* Write the Unicode character in UTF-8 */ if (ch < 0x80) - sbuf_printf(sb, "%c", ch); + g_conf_printf_escaped(sb, "%c", ch); else if (ch < 0x800) - sbuf_printf(sb, "%c%c", 0xc0 | (ch >> 6), + g_conf_printf_escaped(sb, "%c%c", 0xc0 | (ch >> 6), 0x80 | (ch & 0x3f)); else if (ch < 0x10000) - sbuf_printf(sb, "%c%c%c", 0xe0 | (ch >> 12), + g_conf_printf_escaped(sb, "%c%c%c", 0xe0 | (ch >> 12), 0x80 | ((ch >> 6) & 0x3f), 0x80 | (ch & 0x3f)); else if (ch < 0x200000) - sbuf_printf(sb, "%c%c%c%c", 0xf0 | (ch >> 18), - 0x80 | ((ch >> 12) & 0x3f), + g_conf_printf_escaped(sb, "%c%c%c%c", 0xf0 | + (ch >> 18), 0x80 | ((ch >> 12) & 0x3f), 0x80 | ((ch >> 6) & 0x3f), 0x80 | (ch & 0x3f)); } } Modified: stable/9/sys/geom/part/g_part_pc98.c ============================================================================== --- stable/9/sys/geom/part/g_part_pc98.c Fri Jun 6 12:37:56 2014 (r267156) +++ stable/9/sys/geom/part/g_part_pc98.c Fri Jun 6 12:45:11 2014 (r267157) @@ -300,7 +300,9 @@ g_part_pc98_dumpconf(struct g_part_table sbuf_printf(sb, " xs PC98 xt %u sn %s", type, name); } else { /* confxml: partition entry information */ - sbuf_printf(sb, "%s\n", indent, name); + sbuf_printf(sb, "%s\n"); if (entry->ent.dp_mid & PC98_MID_BOOTABLE) sbuf_printf(sb, "%sbootable\n", indent);