From 85c68bed42a21fbfa7445edc67d680a23501e0c9 Mon Sep 17 00:00:00 2001 From: Alfredo Tupone Date: Mon, 20 Oct 2014 07:00:23 +0000 Subject: Fix compile with format-security. Bug #520568 (Portage version: 2.2.8-r2/cvs/Linux x86_64, signed Manifest commit with key 0145142D) --- games-strategy/lgeneral/ChangeLog | 6 +++- .../lgeneral/files/lgeneral-1.2.3-format.patch | 40 ++++++++++++++++++++++ games-strategy/lgeneral/lgeneral-1.2.3.ebuild | 20 +++++------ 3 files changed, 53 insertions(+), 13 deletions(-) create mode 100644 games-strategy/lgeneral/files/lgeneral-1.2.3-format.patch diff --git a/games-strategy/lgeneral/ChangeLog b/games-strategy/lgeneral/ChangeLog index af5faaeb0a40..ac0fdbc58bc5 100644 --- a/games-strategy/lgeneral/ChangeLog +++ b/games-strategy/lgeneral/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for games-strategy/lgeneral # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/games-strategy/lgeneral/ChangeLog,v 1.44 2014/05/15 17:05:05 ulm Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-strategy/lgeneral/ChangeLog,v 1.45 2014/10/20 07:00:23 tupone Exp $ + + 20 Oct 2014; Alfredo Tupone lgeneral-1.2.3.ebuild, + +files/lgeneral-1.2.3-format.patch: + Fix compile with format-security. Bug #520568 by Agostino Sarubbo 15 May 2014; Ulrich Müller lgeneral-1.2.3.ebuild: Fix USE dependency on media-libs/libsdl, "audio" USE flag was renamed to diff --git a/games-strategy/lgeneral/files/lgeneral-1.2.3-format.patch b/games-strategy/lgeneral/files/lgeneral-1.2.3-format.patch new file mode 100644 index 000000000000..364b65a7ee3c --- /dev/null +++ b/games-strategy/lgeneral/files/lgeneral-1.2.3-format.patch @@ -0,0 +1,40 @@ +--- lgc-pg/units.c.old 2014-10-20 08:42:12.389153753 +0200 ++++ lgc-pg/units.c 2014-10-20 08:42:41.412883009 +0200 +@@ -552,7 +552,7 @@ + } + } + /* get flags */ +- sprintf( flags, unit_classes[entry.class * 3 + 2] ); ++ sprintf( flags, "%s", unit_classes[entry.class * 3 + 2] ); + if ( apply_unit_mods ) { + i = 0; + while ( add_flags[i*2][0] != 'X' ) { +--- src/engine.c.old 2014-10-20 08:44:21.867947804 +0200 ++++ src/engine.c 2014-10-20 08:45:19.299413602 +0200 +@@ -2311,7 +2311,7 @@ + if ( gui->module_dlg->subdir[0] != 0 ) + sprintf( path, "%s/%s", gui->module_dlg->subdir, (char*)gui->module_dlg->lbox->cur_item ); + else +- sprintf( path, (char*)gui->module_dlg->lbox->cur_item ); ++ sprintf( path, "%s", (char*)gui->module_dlg->lbox->cur_item ); + free( setup.modules[gui->setup->sel_id] ); + setup.modules[gui->setup->sel_id] = strdup( path ); + gui_handle_player_select( gui->setup->list->cur_item ); +@@ -2756,7 +2756,7 @@ + result = gui_get_message_pane_selection(camp_pane); + if (result && strcmp(result, "nextscen") == 0) { + /* start scenario */ +- sprintf( setup.fname, camp_cur_scen->scen ); ++ sprintf( setup.fname, "%s", camp_cur_scen->scen ); + setup.type = SETUP_DEFAULT_SCEN; + end_scen = 1; + *reinit = 1; +@@ -4243,7 +4243,7 @@ + } + else { + /* next scenario */ +- sprintf( setup.fname, camp_cur_scen->scen ); ++ sprintf( setup.fname, "%s", camp_cur_scen->scen ); + setup.type = SETUP_CAMP_BRIEFING; + reinit = 1; + } diff --git a/games-strategy/lgeneral/lgeneral-1.2.3.ebuild b/games-strategy/lgeneral/lgeneral-1.2.3.ebuild index c1f48a187a3e..00bfc1c366b3 100644 --- a/games-strategy/lgeneral/lgeneral-1.2.3.ebuild +++ b/games-strategy/lgeneral/lgeneral-1.2.3.ebuild @@ -1,8 +1,8 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/games-strategy/lgeneral/lgeneral-1.2.3.ebuild,v 1.5 2014/05/15 17:05:05 ulm Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-strategy/lgeneral/lgeneral-1.2.3.ebuild,v 1.6 2014/10/20 07:00:23 tupone Exp $ -EAPI=2 +EAPI=5 inherit eutils autotools games MY_P="${P/_/}" @@ -26,6 +26,7 @@ DEPEND="${RDEPEND} S=${WORKDIR}/${MY_P} src_prepare() { + epatch "${FILESDIR}"/${P}-format.patch sed -i \ -e '/desktop_DATA/d' \ -e '/icon_DATA/d' \ @@ -53,29 +54,25 @@ src_prepare() { src_configure() { egamesconf \ - --disable-dependency-tracking \ - $(use_enable nls) \ - || die + $(use_enable nls) # Build the temporary lgc-pg: cd "${WORKDIR}"/tmp-build egamesconf \ - --disable-dependency-tracking \ --disable-nls \ - --datadir="${D}/${GAMES_DATADIR}" \ - || die + --datadir="${D}/${GAMES_DATADIR}" } src_compile() { - emake || die "emake failed" + emake # Build the temporary lgc-pg: cd "${WORKDIR}"/tmp-build - emake || die "emake failed (tmp)" + emake } src_install() { - emake DESTDIR="${D}" install || die "emake install failed" + default keepdir "${GAMES_DATADIR}"/${PN}/{ai_modules,music,terrain} # Generate scenario data: @@ -85,7 +82,6 @@ src_install() { -d "${D}/${GAMES_DATADIR}"/${PN} \ || die "Failed to generate scenario data" - dodoc AUTHORS ChangeLog README.lgeneral README.lgc-pg TODO newicon lgeneral48.png ${PN}.png make_desktop_entry ${PN} LGeneral prepgamesdirs -- cgit v1.2.3-65-gdbad