1 |
commit: 3e60f60f4d9cc68dcb998101dc5862ea10258675 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Mar 21 22:00:30 2018 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Mar 21 22:01:04 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e60f60f |
7 |
|
8 |
app-editors/hteditor: pull format-string fixes, bug #521018 |
9 |
|
10 |
Pulled upstream fix as is: |
11 |
https://github.com/sebastianbiallas/ht/commit/5839355d67ff822593190473a41512ca19e4280a |
12 |
|
13 |
Reported-by: Agostino Sarubbo |
14 |
Closes: https://bugs.gentoo.org/521018 |
15 |
Package-Manager: Portage-2.3.24, Repoman-2.3.6 |
16 |
|
17 |
.../files/hteditor-2.1.0-format-security.patch | 57 ++++++++++++++++++++ |
18 |
app-editors/hteditor/hteditor-2.1.0-r1.ebuild | 60 ++++++++++++++++++++++ |
19 |
2 files changed, 117 insertions(+) |
20 |
|
21 |
diff --git a/app-editors/hteditor/files/hteditor-2.1.0-format-security.patch b/app-editors/hteditor/files/hteditor-2.1.0-format-security.patch |
22 |
new file mode 100644 |
23 |
index 00000000000..408d1b9b1be |
24 |
--- /dev/null |
25 |
+++ b/app-editors/hteditor/files/hteditor-2.1.0-format-security.patch |
26 |
@@ -0,0 +1,57 @@ |
27 |
+https://bugs.gentoo.org/521018 |
28 |
+ |
29 |
+From 5839355d67ff822593190473a41512ca19e4280a Mon Sep 17 00:00:00 2001 |
30 |
+From: Anton Gladky <gladk@××××××.org> |
31 |
+Date: Wed, 18 Feb 2015 21:20:39 +0100 |
32 |
+Subject: [PATCH] Fix "format not a string" compilation failure |
33 |
+ |
34 |
+Compilation with the flag -Werror=format-security fails with |
35 |
+the message: |
36 |
+ |
37 |
+error: format not a string literal and no format arguments |
38 |
+ |
39 |
+This patch solves the issue. |
40 |
+--- |
41 |
+ asm/x86dis.cc | 6 +++--- |
42 |
+ htpal.cc | 2 +- |
43 |
+ 2 files changed, 4 insertions(+), 4 deletions(-) |
44 |
+ |
45 |
+diff --git a/asm/x86dis.cc b/asm/x86dis.cc |
46 |
+index 0830d9c..bb9028f 100644 |
47 |
+--- a/asm/x86dis.cc |
48 |
++++ b/asm/x86dis.cc |
49 |
+@@ -1218,15 +1218,15 @@ void x86dis::str_op(char *opstr, int *opstrlen, x86dis_insn *insn, x86_insn_op * |
50 |
+ default: {assert(0);} |
51 |
+ } |
52 |
+ if (!insn->rexprefix) { |
53 |
+- sprintf(opstr, x86_regs[j][op->reg]); |
54 |
++ sprintf(opstr, "%s", x86_regs[j][op->reg]); |
55 |
+ } else { |
56 |
+- sprintf(opstr, x86_64regs[j][op->reg]); |
57 |
++ sprintf(opstr, "%s", x86_64regs[j][op->reg]); |
58 |
+ } |
59 |
+ break; |
60 |
+ } |
61 |
+ case X86_OPTYPE_SEG: |
62 |
+ if (x86_segs[op->seg]) { |
63 |
+- sprintf(opstr, x86_segs[op->seg]); |
64 |
++ sprintf(opstr, "%s", x86_segs[op->seg]); |
65 |
+ } |
66 |
+ break; |
67 |
+ case X86_OPTYPE_CRX: |
68 |
+diff --git a/htpal.cc b/htpal.cc |
69 |
+index 03dea18..3d5f51e 100644 |
70 |
+--- a/htpal.cc |
71 |
++++ b/htpal.cc |
72 |
+@@ -307,7 +307,7 @@ void palette_entry::strvalue(char *buf32bytes) |
73 |
+ text = "normal"; |
74 |
+ } |
75 |
+ p = tag_make_color(p, 32, VCP(fg, bg)); |
76 |
+- p += sprintf(p, text); |
77 |
++ p += sprintf(p, "%s", text); |
78 |
+ p = tag_make_default_color(p, 32); |
79 |
+ *p = 0; |
80 |
+ } |
81 |
+-- |
82 |
+2.16.2 |
83 |
+ |
84 |
|
85 |
diff --git a/app-editors/hteditor/hteditor-2.1.0-r1.ebuild b/app-editors/hteditor/hteditor-2.1.0-r1.ebuild |
86 |
new file mode 100644 |
87 |
index 00000000000..a1d577aacaf |
88 |
--- /dev/null |
89 |
+++ b/app-editors/hteditor/hteditor-2.1.0-r1.ebuild |
90 |
@@ -0,0 +1,60 @@ |
91 |
+# Copyright 1999-2018 Gentoo Foundation |
92 |
+# Distributed under the terms of the GNU General Public License v2 |
93 |
+ |
94 |
+EAPI=6 |
95 |
+ |
96 |
+inherit autotools toolchain-funcs |
97 |
+ |
98 |
+MY_P=${P/editor} |
99 |
+ |
100 |
+DESCRIPTION="A file viewer, editor and analyzer for text, binary, and executable files" |
101 |
+HOMEPAGE="http://hte.sourceforge.net/ https://github.com/sebastianbiallas/ht/" |
102 |
+SRC_URI="mirror://sourceforge/hte/${MY_P}.tar.bz2" |
103 |
+ |
104 |
+LICENSE="GPL-2" |
105 |
+SLOT="0" |
106 |
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x86-solaris" |
107 |
+IUSE="X" |
108 |
+ |
109 |
+RDEPEND="sys-libs/ncurses:0= |
110 |
+ X? ( x11-libs/libX11 ) |
111 |
+ >=dev-libs/lzo-2" |
112 |
+DEPEND="${RDEPEND} |
113 |
+ virtual/yacc |
114 |
+ sys-devel/flex" |
115 |
+ |
116 |
+DOCS=( AUTHORS ChangeLog KNOWNBUGS README TODO ) |
117 |
+ |
118 |
+S=${WORKDIR}/${MY_P} |
119 |
+ |
120 |
+PATCHES=( |
121 |
+ "${FILESDIR}"/${P}-gcc-7.patch |
122 |
+ "${FILESDIR}"/${P}-tinfo.patch |
123 |
+ "${FILESDIR}"/${P}-gcc-6-uchar.patch |
124 |
+ "${FILESDIR}"/${P}-format-security.patch |
125 |
+) |
126 |
+ |
127 |
+src_prepare() { |
128 |
+ default |
129 |
+ eautoreconf |
130 |
+} |
131 |
+ |
132 |
+src_configure() { |
133 |
+ econf \ |
134 |
+ $(use_enable X x11-textmode) \ |
135 |
+ --enable-maintainermode |
136 |
+} |
137 |
+ |
138 |
+src_compile() { |
139 |
+ emake AR="$(tc-getAR)" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" |
140 |
+} |
141 |
+ |
142 |
+src_install() { |
143 |
+ #For prefix |
144 |
+ chmod u+x "${S}/install-sh" |
145 |
+ |
146 |
+ local HTML_DOCS="doc/*.html" |
147 |
+ doinfo doc/*.info |
148 |
+ |
149 |
+ default |
150 |
+} |