New version

Resolves: rhbz#1753061
Dropped visio, python3, CVE-2018-10196, CVE-2019-11023, and
  swig4-updated-language-options patches (all upstreamed)
Simplified python bindings build process
This commit is contained in:
Jaroslav Škarvada 2019-10-02 16:10:30 +02:00
parent 4c84128f6d
commit c9e32e41ae
7 changed files with 20 additions and 286 deletions

View File

@ -1,16 +0,0 @@
diff --git a/lib/dotgen/conc.c b/lib/dotgen/conc.c
--- a/lib/dotgen/conc.c
+++ b/lib/dotgen/conc.c
@@ -159,7 +159,11 @@ static void rebuild_vlists(graph_t * g)
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
lead = GD_rankleader(g)[r];
- if (GD_rank(dot_root(g))[r].v[ND_order(lead)] != lead) {
+ if (lead == NULL) {
+ agerr(AGERR, "rebuiltd_vlists: lead is null for rank %d\n", r);
+ longjmp(jbuf, 1);
+ }
+ else if (GD_rank(dot_root(g))[r].v[ND_order(lead)] != lead) {
agerr(AGERR, "rebuiltd_vlists: rank lead %s not in order %d of rank %d\n",
agnameof(lead), ND_order(lead), r);
longjmp(jbuf, 1);

View File

@ -1,77 +0,0 @@
diff --git a/cmd/tools/graphml2gv.c b/cmd/tools/graphml2gv.c
index 7b8214b..0910d99 100644
--- a/cmd/tools/graphml2gv.c
+++ b/cmd/tools/graphml2gv.c
@@ -477,8 +477,10 @@ startElementHandler(void *userData, const char *name, const char **atts)
if (pos > 0) {
const char *attrname;
attrname = atts[pos];
-
- bind_node(attrname);
+ if (G == 0)
+ fprintf(stderr,"node %s outside graph, ignored\n",attrname);
+ else
+ bind_node(attrname);
pushString(&ud->elements, attrname);
}
@@ -504,21 +506,25 @@ startElementHandler(void *userData, const char *name, const char **atts)
if (tname)
head = tname;
- bind_edge(tail, head);
+ if (G == 0)
+ fprintf(stderr,"edge source %s target %s outside graph, ignored\n",(char*)tail,(char*)head);
+ else {
+ bind_edge(tail, head);
- t = AGTAIL(E);
- tname = agnameof(t);
+ t = AGTAIL(E);
+ tname = agnameof(t);
- if (strcmp(tname, tail) == 0) {
- ud->edgeinverted = FALSE;
- } else if (strcmp(tname, head) == 0) {
- ud->edgeinverted = TRUE;
- }
+ if (strcmp(tname, tail) == 0) {
+ ud->edgeinverted = FALSE;
+ } else if (strcmp(tname, head) == 0) {
+ ud->edgeinverted = TRUE;
+ }
- pos = get_xml_attr("id", atts);
- if (pos > 0) {
- setEdgeAttr(E, GRAPHML_ID, (char *) atts[pos], ud);
- }
+ pos = get_xml_attr("id", atts);
+ if (pos > 0) {
+ setEdgeAttr(E, GRAPHML_ID, (char *) atts[pos], ud);
+ }
+ }
} else {
/* must be some extension */
fprintf(stderr,
@@ -539,7 +545,7 @@ static void endElementHandler(void *userData, const char *name)
char *ele_name = topString(ud->elements);
if (ud->closedElementType == TAG_GRAPH) {
Agnode_t *node = agnode(root, ele_name, 0);
- agdelete(root, node);
+ if (node) agdelete(root, node);
}
popString(&ud->elements);
Current_class = TAG_GRAPH;
diff --git a/lib/cgraph/obj.c b/lib/cgraph/obj.c
index 7b1c8c1..709774e 100644
--- a/lib/cgraph/obj.c
+++ b/lib/cgraph/obj.c
@@ -168,6 +168,8 @@ void agdelcb(Agraph_t * g, void *obj, Agcbstack_t * cbstack)
Agraph_t *agroot(void* obj)
{
+ // fixes CVE-2019-11023 by moving the problem to the caller :-)
+ if (obj == 0) return NILgraph;
switch (AGTYPE(obj)) {
case AGINEDGE:
case AGOUTEDGE:

View File

@ -1,56 +0,0 @@
diff --git a/config/config_python.py b/config/config_python.py
index b747045..2b1ac8d 100644
--- a/config/config_python.py
+++ b/config/config_python.py
@@ -1,12 +1,13 @@
+from __future__ import print_function
+
import sys
from distutils import sysconfig
if sys.argv[1] == "archlib":
- print sysconfig.get_python_lib(1,1)
+ print(sysconfig.get_python_lib(1,1))
elif sys.argv[1] == "lib":
- print sysconfig.get_python_lib(0,1)
+ print(sysconfig.get_python_lib(0,1))
elif sys.argv[1] == "archsitelib":
- print sysconfig.get_python_lib(1,0)
+ print(sysconfig.get_python_lib(1,0))
elif sys.argv[1] == "sitelib":
- print sysconfig.get_python_lib(0,0)
-
+ print(sysconfig.get_python_lib(0,0))
diff --git a/configure.ac b/configure.ac
index 51166c3..0f18965 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1142,7 +1142,7 @@ else
if test `$SWIG -help 2>&1 | $EGREP -c '\-python *- Generate'` = 0; then
use_python="No (swig does not support -python option)"
else
- AC_CHECK_PROG(PYTHON,python,python)
+ AC_CHECK_PROGS(PYTHON,[python3 python])
if test "x$PYTHON" = "x"; then
use_python="No (python not available)"
else
@@ -1167,8 +1167,8 @@ else
if test "x$PYTHON" = "x"; then
use_python="No (python is too old)"
else
- PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"`
- PYTHON_INCLUDES=-I$PYTHON_PREFIX/include/python$PYTHON_VERSION_SHORT
+ PYTHON_PREFIX=`$PYTHON -c "import sys; print(sys.prefix)"`
+ PYTHON_INCLUDES=`$PYTHON-config --includes`
# PYTHON_LIBS="-lpython$PYTHON_VERSION_SHORT"
PYTHON_LIBS="-undefined dynamic_lookup"
PYTHON_INSTALL_DIR="`$PYTHON $srcdir/config/config_python.py archsitelib`"
@@ -1548,7 +1548,7 @@ else
if test "x$PYTHON34" = "x"; then
use_python34="No (python34 is too old)"
else
- PYTHON34_PREFIX=`$PYTHON3 -c "import sys; print sys.prefix"`
+ PYTHON34_PREFIX=`$PYTHON3 -c "import sys; print(sys.prefix)"`
# PYTHON34_INCLUDES=-I$PYTHON34_PREFIX/include/python$PYTHON34_VERSION_SHORT
# FIXME - whats the stupid "m" for?
PYTHON34_INCLUDES=-I/usr/include/python3.4m

View File

@ -1,61 +0,0 @@
diff -up graphviz-stable_release_2.40.1/configure.ac.swig4 graphviz-stable_release_2.40.1/configure.ac
--- graphviz-stable_release_2.40.1/configure.ac.swig4 2019-03-12 16:17:45.243092580 +0100
+++ graphviz-stable_release_2.40.1/configure.ac 2019-03-12 16:19:43.436206447 +0100
@@ -1023,8 +1023,13 @@ else
if test "x$use_swig" != "xYes"; then
use_perl="No (swig not available)"
else
- if test `$SWIG -help 2>&1 | $EGREP -c '\-perl *- Generate'` = 0; then
- use_perl="No (swig does not support -perl option)"
+ if test `$SWIG -perl5 2>&1 | $EGREP -c '(Unable|No target)'` -eq 1; then
+ SWIG_PERL_OPT='-perl'
+ else
+ SWIG_PERL_OPT='-perl5'
+ fi
+ if test `$SWIG -help 2>&1 | $EGREP -c "(-perl|-perl5) *- Generate"` = 0; then
+ use_perl="No (swig does not support -perl or -perl5 option)"
else
AC_CHECK_PROG(PERL,perl,perl)
if test "x$PERL" = "x"; then
@@ -1057,6 +1062,7 @@ else
AC_SUBST([PERL_INCLUDES])
AC_SUBST([PERL_LIBS])
AC_SUBST([PERL_INSTALL_DIR])
+ AC_SUBST([SWIG_PERL_OPT])
fi
fi
fi
@@ -1077,8 +1083,8 @@ else
if test "x$use_swig" != "xYes"; then
use_php="No (swig not available)"
else
- if test `$SWIG -php7 2>&1 | $EGREP -c 'Unable'` -eq 1; then
- if test `$SWIG -php5 2>&1 | $EGREP -c 'Unable'` -eq 1; then
+ if test `$SWIG -php7 2>&1 | $EGREP -c '(Unable|No target)'` -eq 1; then
+ if test `$SWIG -php5 2>&1 | $EGREP -c '(Unable|No target)'` -eq 1; then
SWIG_PHP_OPT='-php'
else
SWIG_PHP_OPT='-php5'
@@ -1086,8 +1092,8 @@ else
else
SWIG_PHP_OPT='-php7'
fi
- if test `$SWIG -help 2>&1 | $EGREP -c '\-php5* *- Generate'` = 0 ; then
- use_php="No (swig does not support -php or -php5 option)"
+ if test `$SWIG -help 2>&1 | $EGREP -c "(-php|-php5|-php7) *- Generate"` = 0 ; then
+ use_php="No (swig does not support -php or -php5 or -php7 option)"
else
AC_CHECK_PROGS(PHP,php7,php,php5)
if test "x$PHP" = "x"; then
diff -up graphviz-stable_release_2.40.1/tclpkg/gv/Makefile.am.swig4 graphviz-stable_release_2.40.1/tclpkg/gv/Makefile.am
--- graphviz-stable_release_2.40.1/tclpkg/gv/Makefile.am.swig4 2016-12-25 04:04:04.000000000 +0100
+++ graphviz-stable_release_2.40.1/tclpkg/gv/Makefile.am 2019-03-12 16:17:45.248092670 +0100
@@ -171,7 +171,7 @@ libgv_perl_la_LDFLAGS = -module -avoid-v
libgv_perl_la_CPPFLAGS = $(BASECPPFLAGS) $(PERL_CC)
$(PERL_data): gv_perl.cpp
gv_perl.cpp: gv.i
- $(SWIG) -c++ -perl -o gv_perl.cpp $(srcdir)/gv.i
+ $(SWIG) -c++ $(SWIG_PERL_OPT) -o gv_perl.cpp $(srcdir)/gv.i
pkgphpdir = $(pkglibdir)/php
PHP_data = gv.php

View File

@ -1,25 +0,0 @@
diff --git a/plugin/visio/VisioGraphic.cpp b/plugin/visio/VisioGraphic.cpp
index 303eac0..14e377c 100644
--- a/plugin/visio/VisioGraphic.cpp
+++ b/plugin/visio/VisioGraphic.cpp
@@ -29,6 +29,8 @@
#define isfinite(x) finite(x)
#endif
+#include <cstdlib>
+
#include "VisioGraphic.h"
#include "gvcjob.h"
diff --git a/plugin/visio/VisioText.cpp b/plugin/visio/VisioText.cpp
index 635806c..3c6441a 100644
--- a/plugin/visio/VisioText.cpp
+++ b/plugin/visio/VisioText.cpp
@@ -17,6 +17,7 @@
#include "gvcjob.h"
#include "gvio.h"
+#include <cstdlib>
#include <string.h>
extern "C" char *xml_string(char* str);

View File

@ -60,21 +60,15 @@
Name: graphviz
Summary: Graph Visualization Tools
Version: 2.40.1
Release: 58%{?dist}
Version: 2.42.2
Release: 1%{?dist}
License: EPL-1.0
URL: http://www.graphviz.org/
# A bit hacking needed due to: https://gitlab.com/graphviz/graphviz/issues/1371
Source0: https://gitlab.com/graphviz/graphviz/-/archive/stable_release_%{version}/graphviz-stable_release_%{version}.tar.gz #/graphviz-2.40.1.tar.gz
Patch0: graphviz-2.40.1-visio.patch
Patch1: graphviz-2.40.1-python3.patch
# https://gitlab.com/graphviz/graphviz/issues/1367
Patch2: graphviz-2.40.1-CVE-2018-10196.patch
Source0: https://gitlab.com/%{name}/%{name}/-/archive/stable_release_%{version}/%{name}-stable_release_%{version}.tar.gz #/%{name}-%{version}.tar.gz
# rhbz#1505230
Patch3: graphviz-2.40.1-dotty-menu-fix.patch
Patch4: graphviz-2.40.1-coverity-scan-fixes.patch
Patch5: graphviz-2.40.1-CVE-2019-11023.patch
Patch6: graphviz-2.40.1-swig4-updated-language-options.patch
Patch0: graphviz-2.42.2-dotty-menu-fix.patch
Patch1: graphviz-2.42.2-coverity-scan-fixes.patch
BuildRequires: zlib-devel, libpng-devel, libjpeg-devel, expat-devel, freetype-devel >= 2
BuildRequires: ksh, bison, m4, flex, tk-devel, tcl-devel >= 8.3, swig, sed
BuildRequires: fontconfig-devel, libtool-ltdl-devel, ruby-devel, ruby, guile-devel
@ -286,13 +280,8 @@ Various tcl packages (extensions) for the graphviz tools.
%prep
%setup -q -n graphviz-stable_release_%{version}
%patch0 -p1 -b .visio
%patch1 -p1 -b .python3
%patch2 -p1 -b .CVE-2018-10196
%patch3 -p1 -b .dotty-menu-fix
%patch4 -p1 -b .coverity-scan-fixes
%patch5 -p1 -b .CVE-2019-11023
%patch6 -p1 -b .swig4-updated-language-options
%patch0 -p1 -b .dotty-menu-fix
%patch1 -p1 -b .coverity-scan-fixes
# Attempt to fix rpmlint warnings about executable sources
find -type f -regex '.*\.\(c\|h\)$' -exec chmod a-x {} ';'
@ -340,31 +329,13 @@ export CPPFLAGS=-I`ruby -e "puts File.join(RbConfig::CONFIG['includedir'], RbCon
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
%if %{with python2}
cp -a tclpkg/gv tclpkg/gv.python2
%endif
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fno-strict-overflow %{?FFSTORE}" \
CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fno-strict-overflow %{?FFSTORE}" \
PYTHON_INCLUDES=`python3-config --includes` PYTHON_LIBS=`python3-config --libs` \
PYTHON_INSTALL_DIR=%{python3_sitearch} PYTHON=%{__python3}
%if %{with python2}
pushd tclpkg/gv.python2
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fno-strict-overflow %{?FFSTORE}" \
CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fno-strict-overflow %{?FFSTORE}" \
PYTHON_INCLUDES=-I/usr/include/python%{python2_version} PYTHON_LIBS="-lpython%{python2_version}" \
PYTHON_INSTALL_DIR=%{python2_sitearch} libgv_python.la
popd
%endif
CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fno-strict-overflow %{?FFSTORE}"
%install
rm -rf %{buildroot}
make DESTDIR=%{buildroot} \
docdir=%{buildroot}%{_docdir}/%{name} \
pkgconfigdir=%{_libdir}/pkgconfig \
PYTHON_LIBS=`python3-config --libs` \
PYTHON_INSTALL_DIR=%{python3_sitearch} \
install
find %{buildroot} -type f -name "*.la" -exec rm -f {} ';'
chmod -x %{buildroot}%{_datadir}/%{name}/lefty/*
@ -411,22 +382,13 @@ done
popd
%if %{with python2}
pushd tclpkg/gv.python2
install -pD .libs/libgv_python.so %{buildroot}%{python2_sitearch}/_gv.so
install -p gv.py %{buildroot}%{python2_sitearch}/gv.py
popd
install -pD tclpkg/gv/.libs/libgv_python2.so %{buildroot}%{python2_sitearch}/_gv.so
install -p tclpkg/gv/gv.py %{buildroot}%{python2_sitearch}/gv.py
%endif
# python 3
pushd tclpkg/gv
install -pD .libs/libgv_python.so %{buildroot}%{python3_sitearch}/_gv.so
install -p gv.py %{buildroot}%{python3_sitearch}/gv.py
popd
# remove the python module from the %%_libdir/graphviz/python, it's
# already installed in the python sitearch
rm -f %{buildroot}%{_libdir}/graphviz/python/*
rmdir %{buildroot}%{_libdir}/graphviz/python
install -pD tclpkg/gv/.libs/libgv_python3.so %{buildroot}%{python3_sitearch}/_gv.so
install -p tclpkg/gv/gv.py %{buildroot}%{python3_sitearch}/gv.py
# Ghost plugins config
touch %{buildroot}%{_libdir}/graphviz/config%{pluginsver}
@ -617,6 +579,13 @@ php --no-php-ini \
%{_mandir}/man3/*.3tcl*
%changelog
* Tue Oct 2 2019 Jaroslav Škarvada <jskarvad@redhat.com> - 2.42.2-1
- New version
Resolves: rhbz#1753061
- Dropped visio, python3, CVE-2018-10196, CVE-2019-11023, and
swig4-updated-language-options patches (all upstreamed)
- Simplified python bindings build process
* Wed Oct 02 2019 Orion Poplawski <orion@nwra.com> - 2.40.1-58
- Rebuild for lasi 1.1.3 soname bump

View File

@ -1 +1 @@
SHA512 (graphviz-2.40.1.tar.gz) = 65d1ad6aaf0508028eb9061adabf86e35c5bc1ac0e797424d030c8079b596baef498f6e804af06f2baac8d48f1da8f3e00c3bd64deef4bc62b53167b063ef596
SHA512 (graphviz-2.42.2.tar.gz) = 52c7e94290b16b5dbe6f7e9bde34d31b1c0e748df207a4ae46c8d862de7bed21a19d638aaf98cac8204a506b4dfaaa04e88b586fcd37e67f07a291bd498c2b36