From sknorr@suse.de Tue Feb 9 15:22:29 2016 Return-Path: X-Original-To: xml@gnome.org Delivered-To: xml@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by restaurant.gnome.org (Postfix) with ESMTP id 8B70076568 for ; Tue, 9 Feb 2016 15:22:29 +0000 (UTC) X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Flag: NO X-Spam-Score: -2.23 X-Spam-Level: X-Spam-Status: No, score=-2.23 tagged_above=-999 required=2 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.329, SPF_PASS=-0.001] autolearn=ham Received: from restaurant.gnome.org ([127.0.0.1]) by localhost (restaurant.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zUUS1OpJqkCz for ; Tue, 9 Feb 2016 15:22:28 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by restaurant.gnome.org (Postfix) with ESMTP id 5A7DF763ED for ; Tue, 9 Feb 2016 15:22:28 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E4DC7AD10 for ; Tue, 9 Feb 2016 15:22:29 +0000 (UTC) Date: Tue, 09 Feb 2016 16:22:29 +0100 From: Stefan Knorr To: xml@gnome.org Message-Id: <1455031349.3023.3@imap.suse.de> X-Mailer: geary/0.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: [xml] 2.9.3 exhibits strange behaviour when given external entity files X-BeenThere: xml@gnome.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: The Gnome XML library mailing-list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2016 15:22:29 -0000 Hi all, I wanted to discuss this on the ML because I am not sure if this is a bug only on my distribution (openSUSE) or if this really comes from upstream... I have this file "dummy.xml": ---- %myentities; ]> Test ---- and an entities file, "entities.ent": ---- ---- Then I run $ xmllint dummy.xml For some reason, xmllint now throws away "%myentities;". I also noticed that it does not seem to care about the name of the entity file referenced in the XML. If I try to reference &entity; from the XML, xmllint will complain about a missing definition. What do you say? Regards, Stefan. --- . SUSE Linux GmbH, Gesch=C3=A4ftsf=C3=BChrer: Felix Imend=C3=B6rffer, Jane Sm= ithard, Graham Norton. HRB 21284 (AG N=C3=BCrnberg) = From veillard@redhat.com Thu Feb 18 11:06:50 2016 Return-Path: X-Original-To: xml@gnome.org Delivered-To: xml@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by restaurant.gnome.org (Postfix) with ESMTP id 6449876B35 for ; Thu, 18 Feb 2016 11:06:50 +0000 (UTC) X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Flag: NO X-Spam-Score: -6.907 X-Spam-Level: X-Spam-Status: No, score=-6.907 tagged_above=-999 required=2 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.006, SPF_HELO_PASS=-0.001] autolearn=ham Received: from restaurant.gnome.org ([127.0.0.1]) by localhost (restaurant.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RPc5hQ5Sb5Pj for ; Thu, 18 Feb 2016 11:06:49 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by restaurant.gnome.org (Postfix) with ESMTP id C1A5D76B01 for ; Thu, 18 Feb 2016 11:06:49 +0000 (UTC) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 4DBDB7EBAA; Thu, 18 Feb 2016 11:06:52 +0000 (UTC) Received: from localhost (ovpn-116-105.ams2.redhat.com [10.36.116.105]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1IB6o9a009459 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 18 Feb 2016 06:06:51 -0500 Received: from thinkpad2.veillard.com (veillard.redhat.com [10.201.4.63]) by localhost (8.15.2/8.14.7) with ESMTP id u1IB6nXR015461; Thu, 18 Feb 2016 12:06:49 +0100 Received: (from veillard@localhost) by thinkpad2.veillard.com (8.15.2/8.15.2/Submit) id u1IB6mQi015460; Thu, 18 Feb 2016 12:06:48 +0100 X-Authentication-Warning: thinkpad2.veillard.com: veillard set sender to veillard@redhat.com using -f Date: Thu, 18 Feb 2016 12:06:48 +0100 From: Daniel Veillard To: Stefan Knorr Message-ID: <20160218110648.GT32149@redhat.com> References: <1455031349.3023.3@imap.suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455031349.3023.3@imap.suse.de> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Cc: xml@gnome.org Subject: Re: [xml] 2.9.3 exhibits strange behaviour when given external entity files X-BeenThere: xml@gnome.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: veillard@redhat.com List-Id: The Gnome XML library mailing-list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2016 11:06:50 -0000 On Tue, Feb 09, 2016 at 04:22:29PM +0100, Stefan Knorr wrote: > Hi all, > > I wanted to discuss this on the ML because I am not sure if this is a > bug only on my distribution (openSUSE) or if this really comes from > upstream... > > I have this file "dummy.xml": > ---- > > %myentities; > ]> > > Test > > ---- > > and an entities file, "entities.ent": > ---- > > ---- > > Then I run > $ xmllint dummy.xml > > For some reason, xmllint now throws away "%myentities;". I also > noticed that it does not seem to care about the name of the entity file > referenced in the XML. If I try to reference &entity; from > the XML, xmllint will complain about a missing definition. > > What do you say? > > > Regards, > > Stefan. libxml2 does not fetch external entities unless asked for since it is a security hazard, unless you trust the source. This has been the default for some time. See xmllint flags like --valid --noent or --loaddtd if you want to activate this. Daniel -- Daniel Veillard | Open Source and Standards, Red Hat veillard@redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | virtualization library http://libvirt.org/ From sknorr@suse.de Thu Feb 18 11:14:35 2016 Return-Path: X-Original-To: xml@gnome.org Delivered-To: xml@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by restaurant.gnome.org (Postfix) with ESMTP id 4654C76B01 for ; Thu, 18 Feb 2016 11:14:35 +0000 (UTC) X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Flag: NO X-Spam-Score: -1.907 X-Spam-Level: X-Spam-Status: No, score=-1.907 tagged_above=-999 required=2 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.006, SPF_PASS=-0.001] autolearn=ham Received: from restaurant.gnome.org ([127.0.0.1]) by localhost (restaurant.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tb6yyS6m_aOO for ; Thu, 18 Feb 2016 11:14:34 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by restaurant.gnome.org (Postfix) with ESMTP id 95576765BC for ; Thu, 18 Feb 2016 11:14:34 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3C6BBACB0; Thu, 18 Feb 2016 11:14:36 +0000 (UTC) Date: Thu, 18 Feb 2016 12:14:35 +0100 From: Stefan Knorr To: veillard@redhat.com Message-Id: <1455794075.24409.0@imap.suse.de> In-Reply-To: <20160218110648.GT32149@redhat.com> References: <1455031349.3023.3@imap.suse.de> <20160218110648.GT32149@redhat.com> X-Mailer: geary/0.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Cc: xml@gnome.org Subject: Re: [xml] 2.9.3 exhibits strange behaviour when given external entity files X-BeenThere: xml@gnome.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: The Gnome XML library mailing-list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2016 11:14:35 -0000 Hi again, > libxml2 does not fetch external entities unless asked for since > it is a security hazard, unless you trust the source. Okay, then that part of my observations was ~useless. In any case, the bigger issue is that I get back invalid XML from xmllint now (which I did not get 2.9.1 before). I.e.: > > %myentities; > ]> > > Test > becomes > > > ]> > > Test > Best regards, Stefan. --- . SUSE Linux GmbH, Gesch=C3=A4ftsf=C3=BChrer: Felix Imend=C3=B6rffer, Jane Sm= ithard, Graham Norton. HRB 21284 (AG N=C3=BCrnberg) = From sknorr@suse.de Thu Feb 18 12:06:44 2016 Return-Path: X-Original-To: xml@gnome.org Delivered-To: xml@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by restaurant.gnome.org (Postfix) with ESMTP id B408576BA8 for ; Thu, 18 Feb 2016 12:06:44 +0000 (UTC) X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Flag: NO X-Spam-Score: -1.907 X-Spam-Level: X-Spam-Status: No, score=-1.907 tagged_above=-999 required=2 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.006, SPF_PASS=-0.001] autolearn=ham Received: from restaurant.gnome.org ([127.0.0.1]) by localhost (restaurant.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MxC20gf_zSVC for ; Thu, 18 Feb 2016 12:06:43 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by restaurant.gnome.org (Postfix) with ESMTP id 7BA9676B4E for ; Thu, 18 Feb 2016 12:06:43 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 17208AC0D; Thu, 18 Feb 2016 12:06:45 +0000 (UTC) Date: Thu, 18 Feb 2016 13:06:44 +0100 From: Stefan Knorr To: veillard@redhat.com Message-Id: <1455797204.24409.1@imap.suse.de> In-Reply-To: <1455794075.24409.0@imap.suse.de> References: <1455031349.3023.3@imap.suse.de> <20160218110648.GT32149@redhat.com> <1455794075.24409.0@imap.suse.de> X-Mailer: geary/0.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Cc: xml@gnome.org Subject: Re: [xml] 2.9.3 exhibits strange behaviour when given external entity files X-BeenThere: xml@gnome.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: The Gnome XML library mailing-list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2016 12:06:44 -0000 Hi again, Daniel, Sorry. I thought about my message again. Looked at the spec a bit and noticed where I went wrong: not having %entities; in there is totally fine from an XML standpoint... Consider this thread done. Stefan. --- . SUSE Linux GmbH, Gesch=C3=A4ftsf=C3=BChrer: Felix Imend=C3=B6rffer, Jane Sm= ithard, Graham Norton. HRB 21284 (AG N=C3=BCrnberg) = From alexhenrie24@gmail.com Sun Feb 21 04:58:12 2016 Return-Path: X-Original-To: xml@gnome.org Delivered-To: xml@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by restaurant.gnome.org (Postfix) with ESMTP id B469476EAE; Sun, 21 Feb 2016 04:58:12 +0000 (UTC) X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Flag: NO X-Spam-Score: -2.45 X-Spam-Level: X-Spam-Status: No, score=-2.45 tagged_above=-999 required=2 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham Received: from restaurant.gnome.org ([127.0.0.1]) by localhost (restaurant.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pCPgr-qSxgTB; Sun, 21 Feb 2016 04:58:11 +0000 (UTC) Received: from mail-ob0-f180.google.com (mail-ob0-f180.google.com [209.85.214.180]) by restaurant.gnome.org (Postfix) with ESMTP id B3E73764BC; Sun, 21 Feb 2016 04:58:11 +0000 (UTC) Received: by mail-ob0-f180.google.com with SMTP id xk3so142647937obc.2; Sat, 20 Feb 2016 20:58:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=mdb0opaOcyebCm5n04As1o7hIbQps7ufUqlV5vwQrS8=; b=fGrhrQ/oDtTtPr5a4XhWVtsn8i0BwiiDHrWElV471vNtJUjeWH5PCfUbkx9ZOgU4cw qPCdkDCLM5ymOdJtjUegrxIr3YK0fytZ5fQQXEnX1SLAs8hjUGNMO618NmOkSqhl2cqX oFW4vSNv0/4q5S3BSBjm8kKXe6YoYyl3EE6p6/Visx9HaVSYIEdpSUFXXmK4Ubhj5Gls axJ21rM7aV2TxdqUU64VYl58zmh/2qGmdactpCVVFRYSkZ/TLiizL1uOcGMdAZdz/xLu MDIjrHxaM5vHpHpoyW2EERaBFdyuGIRdn81zae5D/Qc1KM0esXbF8B80x91I7L201x+J xMfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=mdb0opaOcyebCm5n04As1o7hIbQps7ufUqlV5vwQrS8=; b=LS8Cf02QQbxFT3SId76+bRJ7tn7HcudT/gFLH7MdeYMpc8TH1k+5zD7Nrp/VzRuKVL buAZUUcvGjkRkBkH5HjDZLdCyhO9A1xXI5lNzZGb1CSR3ZRL89JDmz3h/99wlqk9JXvq bvrRDWzmoLA6j3akD+PuWGslZoFSVGbMNCxcmC2BdVxfNbviYYGSbA94si6uirKKxsmB SYcJ++KtSIsVpgIwnDAzKyGV/vgi1By1HLFBk0+7EvEPpHQ4RscLXsR7e6/j+iNJNv6v MU4wu3/oJup0OG0HdXwK+XfdlOB+k6CuG/jiYk4rd73zKDV2wJWziMXdVaBDv2IHhFrn BC0w== X-Gm-Message-State: AG10YOQftxT+L/BtK2doNKY6gFD7YXZ8uv0HhiH1J3TQgaXb5AcZVI2AVS3N37FeCOmi7g== X-Received: by 10.182.114.167 with SMTP id jh7mr17703548obb.70.1456030693503; Sat, 20 Feb 2016 20:58:13 -0800 (PST) Received: from alex-wolverine.localdomain (c-67-182-247-84.hsd1.ut.comcast.net. [67.182.247.84]) by smtp.gmail.com with ESMTPSA id d39sm12757123oic.0.2016.02.20.20.58.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 20 Feb 2016 20:58:12 -0800 (PST) From: Alex Henrie To: xml@gnome.org, veillard@redhat.com, wellnhofer@aevum.de, mcatanzaro@gnome.org Date: Sat, 20 Feb 2016 21:58:07 -0700 Message-Id: <1456030687-8111-1-git-send-email-alexhenrie24@gmail.com> X-Mailer: git-send-email 2.7.1 Subject: [xml] [PATCH resend] Fix XSD validation of URIs with ampersands X-BeenThere: xml@gnome.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: The Gnome XML library mailing-list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2016 04:58:12 -0000 For https://bugzilla.gnome.org/show_bug.cgi?id=709171 This makes xmlSchemaSAXHandleStartElementNs pass attributes through xmlStringDecodeEntities, similar to how xmlSchemaVDocWalk passes them through xmlNodeListGetString. --- xmlschemas.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xmlschemas.c b/xmlschemas.c index fe533e6..3d4ec68 100644 --- a/xmlschemas.c +++ b/xmlschemas.c @@ -27382,10 +27382,10 @@ xmlSchemaSAXHandleStartElementNs(void *ctx, for (j = 0, i = 0; i < nb_attributes; i++, j += 5) { /* - * Duplicate the value. + * Duplicate the value, changing & to a literal ampersand. */ - value = xmlStrndup(attributes[j+3], - attributes[j+4] - attributes[j+3]); + value = xmlStringLenDecodeEntities(vctxt->parserCtxt, attributes[j+3], + attributes[j+4] - attributes[j+3], XML_SUBSTITUTE_REF, 0, 0, 0); /* * TODO: Set the node line. */ -- 2.7.1