#1 Use non-recursive string.subst
Merged 6 years ago by ovasik. Opened 6 years ago by abbra.
rpms/ abbra/docbook-style-xsl master  into  master

@@ -0,0 +1,30 @@ 

+ Description: use EXSLT "replace" function when available

+  A recursive implementation  of string.subst is problematic,

+  long strings with many matches will cause stack overflows.

+ Author: Peter De Wachter <pdewacht@gmail.com>

+ Bug-Debian: https://bugs.debian.org/750593

+ 

+ --- docbook-xsl-1.78.1+dfsg.orig/docbook-xsl/lib/lib.xsl

+ +++ docbook-xsl-1.78.1+dfsg/docbook-xsl/lib/lib.xsl

+ @@ -10,7 +10,10 @@

+       This module implements DTD-independent functions

+  

+       ******************************************************************** -->

+ -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

+ +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

+ +                xmlns:str="http://exslt.org/strings"

+ +                exclude-result-prefixes="str"

+ +                version="1.0">

+  

+  <xsl:template name="dot.count">

+    <!-- Returns the number of "." characters in a string -->

+ @@ -56,6 +59,9 @@

+    <xsl:param name="replacement"/>

+  

+    <xsl:choose>

+ +    <xsl:when test="function-available('str:replace')">

+ +      <xsl:value-of select="str:replace($string, string($target), string($replacement))"/>

+ +    </xsl:when>

+      <xsl:when test="contains($string, $target)">

+        <xsl:variable name="rest">

+          <xsl:call-template name="string.subst">

file modified
+7 -2
@@ -1,6 +1,6 @@ 

  Name: docbook-style-xsl

  Version: 1.79.2

- Release: 5%{?dist}

+ Release: 6%{?dist}

  Group: Applications/Text

  

  Summary: Norman Walsh's XSL stylesheets for DocBook XML
@@ -38,7 +38,8 @@ 

  Patch5: docbook-xsl-list-item-body.patch

  #workaround missing mandir section problem (#727251)

  Patch6: docbook-xsl-mandir.patch

- 

+ #Non-recursive string.subst that doesn't kill smb.conf.5 generation

+ Patch7: docbook-style-xsl-non-recursive-string-subst.patch

  

  %description

  These XSL stylesheets allow you to transform any DocBook XML document to
@@ -58,6 +59,7 @@ 

  %patch4 -p1 -b .nonconstant

  %patch5 -p1 -b .listitembody

  %patch6 -p1 -b .mandir

+ %patch7 -p2 -b .non-recursive-subst

  

  cp -p %{SOURCE1} Makefile

  
@@ -137,6 +139,9 @@ 

  fi

  

  %changelog

+ * Wed Sep 13 2017 Alexander Bokovoy <abokovoy@redhat.com> - 1.79.2-6

+ - Use non-recursive string.subst to allow building large documents like smb.conf.5

+ 

  * Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.79.2-5

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

  

We need this patch to make samba buildable in Rawhide. Right now it fails to generate smb.conf.5 due to recursion in string.subst. This is a well-known issue and other distros decided to use a different implementation that avoids recursion instead of string.subst.

Pull-Request has been merged by ovasik

6 years ago