updates for 108365
authorTavis Ormandy <taviso@gentoo.org>
Wed, 26 Oct 2005 15:09:15 +0000 (15:09 +0000)
committerTavis Ormandy <taviso@gentoo.org>
Wed, 26 Oct 2005 15:09:15 +0000 (15:09 +0000)
Package-Manager: portage-2.0.51.19

media-gfx/xli/ChangeLog
media-gfx/xli/Manifest
media-gfx/xli/files/digest-xli-1.17.0-r2 [new file with mode: 0644]
media-gfx/xli/files/xli-security-gentoo.diff [new file with mode: 0644]
media-gfx/xli/xli-1.17.0-r2.ebuild [new file with mode: 0644]

index 9aa805c04389eb81a52f992fb414fa9cf5762ea1..9b4be0dd7c350ce13a652ba8ff9bd481b91256fc 100644 (file)
@@ -1,6 +1,12 @@
 # ChangeLog for media-gfx/xli
 # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-gfx/xli/ChangeLog,v 1.25 2005/09/17 11:53:55 kloeri Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-gfx/xli/ChangeLog,v 1.26 2005/10/26 15:09:15 taviso Exp $
+
+*xli-1.17.0-r2 (26 Oct 2005)
+
+  26 Oct 2005; Tavis Ormandy <taviso@gentoo.org>
+  +files/xli-security-gentoo.diff, +xli-1.17.0-r2.ebuild:
+  security fix, #108365
 
   24 Apr 2005; Markus Rothe <corsair@gentoo.org> xli-1.17.0-r1.ebuild:
   Stable on ppc64
index baad1813426879652863bc3417bb5b4adf8c4302..d38ee1bd5ac0547cf53fef3ab85c0efa0a05dcc7 100644 (file)
@@ -1,17 +1,10 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-MD5 dffd46174e78b327c834fc3e4b1cf848 metadata.xml 160
+MD5 4d87af61b05d90ac04d0abee536d31ea xli-1.17.0-r2.ebuild 2327
 MD5 102b722f83fa906cc5ce1a687bbd240f xli-1.17.0-r1.ebuild 2211
+MD5 4721c0b2e08641fe1d88be2020b0ba92 ChangeLog 2886
+MD5 dffd46174e78b327c834fc3e4b1cf848 metadata.xml 160
 MD5 9cde58e96d0616fd7a7707bcc8a44eec xli-1.17.0.ebuild 2119
-MD5 1fe2d2519d7bf7c3cecf98d069132a87 ChangeLog 2724
 MD5 88664b266f34957e871e07457c605227 files/Xli.ad 123
-MD5 56c2673ad567dbf5ca2163c932571234 files/digest-xli-1.17.0 62
 MD5 4f4d73aa9e90de9931e810d283ab6db6 files/digest-xli-1.17.0-r1 66
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.2 (GNU/Linux)
-
-iD8DBQFDLAPpKf2g/qXtneoRAlPAAJ9uTtYFh+ziAR/HmtI9Vh4OepsY/QCeM8id
-fKmvi66mePevlX54Y3yAq8g=
-=DBbn
------END PGP SIGNATURE-----
+MD5 4f4d73aa9e90de9931e810d283ab6db6 files/digest-xli-1.17.0-r2 66
+MD5 56c2673ad567dbf5ca2163c932571234 files/digest-xli-1.17.0 62
+MD5 5cfa67b158e1deae4d28589f9a7da60a files/xli-security-gentoo.diff 6940
diff --git a/media-gfx/xli/files/digest-xli-1.17.0-r2 b/media-gfx/xli/files/digest-xli-1.17.0-r2
new file mode 100644 (file)
index 0000000..0a00458
--- /dev/null
@@ -0,0 +1 @@
+MD5 db470da53500017fd6969457c12c98f7 xli-2005-02-27.tar.gz 201011
diff --git a/media-gfx/xli/files/xli-security-gentoo.diff b/media-gfx/xli/files/xli-security-gentoo.diff
new file mode 100644 (file)
index 0000000..7425e67
--- /dev/null
@@ -0,0 +1,199 @@
+diff -Nrup xli-2005-02-27/imagetypes.c xli-2005-02-27/imagetypes.c
+--- xli-2005-02-27/imagetypes.c        1999-10-24 22:14:57.000000000 -0400
++++ xli-2005-02-27/imagetypes.c        2005-10-18 07:53:46.000000000 -0400
+@@ -53,7 +53,7 @@ Image *loadImage(ImageOptions * image_op
+       Image *image;
+       int a;
+ 
+-      if (findImage(image_ops->name, fullname) < 0) {
++      if (findImage(image_ops->name, fullname, BUFSIZ) < 0) {
+               if (errno == ENOENT)
+                       printf("%s: image not found\n", image_ops->name);
+               else if (errno == EISDIR)
+@@ -95,7 +95,7 @@ void identifyImage(char *name)
+       char fullname[BUFSIZ];
+       int a;
+ 
+-      if (findImage(name, fullname) < 0) {
++      if (findImage(name, fullname, BUFSIZ) < 0) {
+               if (errno == ENOENT)
+                       printf("%s: image not found\n", name);
+               else if (errno == EISDIR)
+diff -Nrup xli-2005-02-27/path.c xli-2005-02-27/path.c
+--- xli-2005-02-27/path.c      2005-02-27 19:42:39.000000000 -0500
++++ xli-2005-02-27/path.c      2005-10-18 07:56:45.000000000 -0400
+@@ -172,12 +172,12 @@ static int fileIsOk(char *fullname, stru
+ /* find an image with paths and extensions from defaults files.  returns
+  * -1 if access denied or not found, 0 if ok.
+  */
+-int findImage(char *name, char *fullname)
++int findImage(char *name, char *fullname, size_t size)
+ {
+       unsigned int p, e;
+       struct stat sbuf;
+ 
+-      strcpy(fullname, name);
++      strncpy(fullname, name, size);
+       if (!strcmp(name, "stdin"))     /* stdin is special name */
+               return (0);
+ 
+@@ -185,26 +185,26 @@ int findImage(char *name, char *fullname
+       if (!stat(fullname, &sbuf))
+               return (fileIsOk(fullname, &sbuf));
+ #ifndef NO_COMPRESS
+-      strcat(fullname, ".Z");
++      strncat(fullname, ".Z", size);
+       if (!stat(fullname, &sbuf))
+               return (fileIsOk(fullname, &sbuf));
+ #endif
+ 
+       for (p = 0; p < NumPaths; p++) {
+-              sprintf(fullname, "%s/%s", Paths[p], name);
++              snprintf(fullname, size, "%s/%s", Paths[p], name);
+               if (!stat(fullname, &sbuf))
+                       return (fileIsOk(fullname, &sbuf));
+ #ifndef NO_COMPRESS
+-              strcat(fullname, ".Z");
++              strncat(fullname, ".Z", size);
+               if (!stat(fullname, &sbuf))
+ #endif
+                       return (fileIsOk(fullname, &sbuf));
+               for (e = 0; e < NumExts; e++) {
+-                      sprintf(fullname, "%s/%s%s", Paths[p], name, Exts[e]);
++                      snprintf(fullname, size, "%s/%s%s", Paths[p], name, Exts[e]);
+                       if (!stat(fullname, &sbuf))
+                               return (fileIsOk(fullname, &sbuf));
+ #ifndef NO_COMPRESS
+-                      strcat(fullname, ".Z");
++                      strncat(fullname, ".Z", size);
+                       if (!stat(fullname, &sbuf))
+                               return (fileIsOk(fullname, &sbuf));
+ #endif
+@@ -212,11 +212,11 @@ int findImage(char *name, char *fullname
+       }
+ 
+       for (e = 0; e < NumExts; e++) {
+-              sprintf(fullname, "%s%s", name, Exts[e]);
++              snprintf(fullname, size, "%s%s", name, Exts[e]);
+               if (!stat(fullname, &sbuf))
+                       return (fileIsOk(fullname, &sbuf));
+ #ifndef NO_COMPRESS
+-              strcat(fullname, ".Z");
++              strncat(fullname, ".Z", size);
+               if (!stat(fullname, &sbuf))
+                       return (fileIsOk(fullname, &sbuf));
+ #endif
+@@ -241,7 +241,7 @@ void listImages(void)
+       for (a = 0; a < NumPaths; a++) {
+               printf("%s:\n", Paths[a]);
+               fflush(stdout);
+-              sprintf(buf, "ls %s", Paths[a]);
++              snprintf(buf, sizeof(buf)-1, "ls %s", Paths[a]);
+               if (system(buf) < 0) {
+                       perror("ls");
+                       return;
+@@ -296,14 +296,14 @@ char *expandPath(char *p)
+                       var++;
+               else if (*p == '~') {
+                       buf1[b1] = '\0';
+-                      strcat(buf1, getenv("HOME"));
++                      strncat(buf1, getenv("HOME"), sizeof(buf1)-1);
+                       b1 = strlen(buf1);
+                       var = 0;
+               } else if (*p == '/' || *p == '}') {
+                       if (var) {
+                               buf1[b1] = '\0';
+                               buf2[b2] = '\0';
+-                              strcat(buf1, getenv(buf2));
++                              strncat(buf1, getenv(buf2), sizeof(buf1));
+                               b1 = strlen(buf1);
+                               buf2[0] = '\0';
+                               b2 = 0;
+diff -Nrup xli-2005-02-27/reduce.c xli-2005-02-27/reduce.c
+--- xli-2005-02-27/reduce.c    1999-10-24 22:15:02.000000000 -0400
++++ xli-2005-02-27/reduce.c    2005-10-18 07:33:34.000000000 -0400
+@@ -178,7 +178,7 @@ Image *reduce(Image *image, unsigned col
+       /* get destination image */
+       depth = colorsToDepth(OutColors);
+       new_image = newRGBImage(image->width, image->height, depth);
+-      sprintf(buf, "%s (%d colors)", image->title, OutColors);
++      snprintf(buf, sizeof(buf)-1, "%s (%d colors)", image->title, OutColors);
+       new_image->title = dupString(buf);
+       new_image->gamma = image->gamma;
+ 
+diff -Nrup xli-2005-02-27/rlelib.c xli-2005-02-27/rlelib.c
+--- xli-2005-02-27/rlelib.c    2005-10-18 07:40:51.000000000 -0400
++++ xli-2005-02-27/rlelib.c    2005-10-18 07:48:12.000000000 -0400
+@@ -18,7 +18,7 @@
+ #undef  DEBUG
+ 
+ #ifdef DEBUG
+-# define debug(xx)    fprintf(stderr,xx)
++# define debug(xx)    fprintf(stderr, "%s", xx)
+ #else
+ # define debug(xx)
+ #endif
+Files xli-2005-02-27/xli and xli-2005-02-27/xli differ
+diff -Nrup xli-2005-02-27/xli.h xli-2005-02-27/xli.h
+--- xli-2005-02-27/xli.h       1999-10-24 22:15:07.000000000 -0400
++++ xli-2005-02-27/xli.h       2005-10-19 07:49:21.000000000 -0400
+@@ -229,7 +229,7 @@ char *xlistrstr(char *s1, char *s2);
+ 
+ /* path.c */
+ char *expandPath(char *p);
+-int findImage(char *name, char *fullname);
++int findImage(char *name, char *fullname, size_t size);
+ void listImages(void);
+ void loadPathsAndExts(void);
+ void showPath(void);
+diff -Nrup xli-2005-02-27/xlito.c xli-2005-02-27/xlito.c
+--- xli-2005-02-27/xlito.c     2005-02-27 19:42:39.000000000 -0500
++++ xli-2005-02-27/xlito.c     2005-10-18 07:48:54.000000000 -0400
+@@ -31,7 +31,7 @@ char *pname, *fname;
+ #undef  DEBUG
+ 
+ #ifdef DEBUG
+-# define debug(xx)    fprintf(stderr,xx)
++# define debug(xx)    fprintf(stderr, "%s", xx)
+ #else
+ # define debug(xx)
+ #endif
+diff -Nrup xli-2005-02-27/zoom.c xli-2005-02-27/zoom.c
+--- xli-2005-02-27/zoom.c      2005-02-27 19:42:39.000000000 -0500
++++ xli-2005-02-27/zoom.c      2005-10-18 07:35:42.000000000 -0400
+@@ -52,30 +52,30 @@ Image *zoom(Image *oimage, unsigned int 
+     if (verbose)
+       printf("  Zooming image Y axis by %d%%...", yzoom);
+     if (changetitle)
+-      sprintf(buf, "%s (Y zoom %d%%)", oimage->title, yzoom);
++      snprintf(buf, sizeof(buf)-1, "%s (Y zoom %d%%)", oimage->title, yzoom);
+   }
+   else if (!yzoom) {
+     if (verbose)
+       printf("  Zooming image X axis by %d%%...", xzoom);
+     if (changetitle)
+-      sprintf(buf, "%s (X zoom %d%%)", oimage->title, xzoom);
++      snprintf(buf, sizeof(buf)-1, "%s (X zoom %d%%)", oimage->title, xzoom);
+   }
+   else if (xzoom == yzoom) {
+     if (verbose)
+       printf("  Zooming image by %d%%...", xzoom);
+     if (changetitle)
+-      sprintf(buf, "%s (%d%% zoom)", oimage->title, xzoom);
++      snprintf(buf, sizeof(buf)-1, "%s (%d%% zoom)", oimage->title, xzoom);
+   }
+   else {
+     if (verbose)
+       printf("  Zooming image X axis by %d%% and Y axis by %d%%...",
+            xzoom, yzoom);
+     if (changetitle)
+-      sprintf(buf, "%s (X zoom %d%% Y zoom %d%%)", oimage->title,
++      snprintf(buf, sizeof(buf)-1, "%s (X zoom %d%% Y zoom %d%%)", oimage->title,
+           xzoom, yzoom);
+   }
+   if (!changetitle)
+-    strcpy(buf,oimage->title);
++    strncpy(buf,oimage->title, sizeof(buf)-1);
+ 
+   if (verbose)
+     fflush(stdout);
diff --git a/media-gfx/xli/xli-1.17.0-r2.ebuild b/media-gfx/xli/xli-1.17.0-r2.ebuild
new file mode 100644 (file)
index 0000000..6275bc2
--- /dev/null
@@ -0,0 +1,92 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-gfx/xli/xli-1.17.0-r2.ebuild,v 1.1 2005/10/26 15:09:15 taviso Exp $
+
+inherit alternatives eutils
+
+SNAPSHOT="2005-02-27"
+DESCRIPTION="X Load Image: view images or load them to root window"
+HOMEPAGE="http://pantransit.reptiles.org/prog/"
+SRC_URI="http://pantransit.reptiles.org/prog/xli/xli-${SNAPSHOT}.tar.gz"
+
+LICENSE="X11"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc-macos ~ppc64 ~sparc ~x86"
+IUSE=""
+
+DEPEND="virtual/x11
+       >=sys-libs/zlib-1.1.4
+       >=media-libs/libpng-1.0.5
+       >=media-libs/jpeg-6b-r2
+       app-arch/bzip2"
+
+S=${WORKDIR}/${PN}-${SNAPSHOT}
+
+src_unpack() {
+       unpack ${A}
+
+       cd ${S}
+
+       if use ppc-macos ; then
+               for f in $(grep zopen * | cut -d':' -f1 | uniq); do
+                       sed -i "s:zopen:xli_zopen:g" $f
+               done
+       fi
+
+       sed -i Imakefile \
+               -e "/^DEFINES =/s/$/ -DHAVE_GUNZIP -DHAVE_BUNZIP2 /" \
+               -e "/CCOPTIONS =/s/=.*/=/"
+
+       # This is a hack to avoid a parse error on /usr/include/string.h
+       # when _BSD_SOURCE is defined. This may be a bug in that header.
+       sed     -i png.c \
+               -e "/^#include \"xli.h\"/i#undef _BSD_SOURCE"
+
+       # This hack will allow xli to compile using gcc-3.3
+       sed -i rlelib.c \
+               -e "s/#include <varargs.h>//"
+
+       # fix potential security issues.
+       EPATCH_OPTS="-F3 -l" epatch ${FILESDIR}/xli-security-gentoo.diff
+}
+
+src_compile() {
+       xmkmf || die "xmkmf failed."
+
+       emake CDEBUGFLAGS="${CFLAGS}" || die
+}
+
+
+src_install() {
+       into /usr
+       dobin xli xlito
+       dodoc README README.xloadimage ABOUTGAMMA TODO chkgamma.jpg
+       newman xli.man xli.1
+       newman xliguide.man xliguide.1
+       newman xlito.man xlito.1
+       #dosym /usr/bin/xli /usr/bin/xview
+       #dosym /usr/bin/xli /usr/bin/xsetbg
+
+       insinto /etc/X11/app-defaults
+       newins ${FILESDIR}/Xli.ad Xli || die
+       fperms a+r /etc/X11/app-defaults/Xli
+}
+
+update_alternatives() {
+       alternatives_makesym /usr/bin/xview \
+               /usr/bin/{xloadimage,xli}
+       alternatives_makesym /usr/bin/xsetbg \
+               /usr/bin/{xloadimage,xli}
+       alternatives_makesym /usr/share/man/man1/xview.1.gz \
+               /usr/share/man/man1/{xloadimage,xli}.1.gz
+       alternatives_makesym /usr/share/man/man1/xsetbg.1.gz \
+               /usr/share/man/man1/{xloadimage,xli}.1.gz
+}
+
+pkg_postinst() {
+       use ppc-macos || update_alternatives
+}
+
+pkg_postrm() {
+       use ppc-macos || update_alternatives
+}