OBS User unknown
2007-01-15 23:42:46 +00:00
committed by Git OBS Bridge
commit f603bed4bf
10 changed files with 589 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

0
ready Normal file
View File

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f1ff5feece09458ca97d4aa65852328511cc2fa2f135cd6b2e6a534f5dced9d2
size 171688

View File

@@ -0,0 +1,142 @@
--- pcx.c
+++ pcx.c
@@ -5,6 +5,8 @@
** Adapted from code by Jef Poskanzer (see Copyright below).
**
** Version 0.1 -- 4/25/91 -- Initial cut
+** Version 0.2 -- 2001-12-15 -- Support 8bit color images with palette.
+** (Alexandre Duret-Lutz <duret_g@epita.fr>)
**
** Copyright (c) 1991 Tim Northrup
** (see file "tgncpyrght.h" for complete copyright information)
@@ -33,7 +35,9 @@
#define PCX_MAGIC 0x0a /* first byte in a PCX image file */
-static boolean PCX_LoadImage(ZFILE *zf, int in_bpr, int img_bpr, Image *image, int rows); /* Routine to load a PCX file */
+/* Routine to load a PCX file */
+static boolean PCX_LoadImage(ZFILE *zf, int in_bpr, int img_bpr,
+ Image *image, int rows, boolean readpal);
/*
@@ -129,35 +133,43 @@
xmax = xmax - xmin + 1;
ymax = ymax - ymin + 1;
in_bpr = pcxhd[66] + ( 256 * pcxhd[67] );
- img_bpr = (xmax + 7)/8; /* assumes monochrome image */
+ img_bpr = (xmax * pcxhd[3] + 7)/8; /* Recompute the number of bytes
+ per lines. */
/* double check image */
if (xmax < 0 || ymax < 0 || in_bpr < img_bpr) {
zclose(zf);
return((Image *)NULL);
- }
+ }
if (verbose)
printf("%s is a %dx%d PC Paintbrush image\n",name,xmax,ymax);
- if (pcxhd[65] > 1) {
- fprintf(stderr,"pcxLoad: %s - Unable to handle Color PCX image\n",name);
+ /* Only monochorme or 8bits paletized images are supported. */
+ if (pcxhd[65] > 1 || !(pcxhd[3] == 1 || pcxhd[3] == 8)) {
+ fprintf(stderr,
+ "pcxLoad: %s - Unsuported PCX type\n",
+ name);
+
zclose(zf);
return((Image *)NULL);
- }
+ }
znocache(zf);
- /* Allocate pbm array. */
- image = newBitImage(xmax,ymax);
+ /* Allocate image. */
+ if (pcxhd[3] == 1)
+ image = newBitImage(xmax, ymax);
+ else
+ image = newRGBImage(xmax, ymax, pcxhd[3]);
image->title = dupString(name);
/* Read compressed bitmap. */
- if (!PCX_LoadImage( zf, in_bpr, img_bpr, image, ymax )) {
+ if (!PCX_LoadImage(zf, in_bpr, img_bpr, image, ymax, pcxhd[3] == 8)) {
fprintf(stderr,"pcxLoad: %s - Short read of PCX file\n",name);
zclose(zf);
return(image);
- }
+ }
read_trail_opt(image_ops,zf,image,verbose);
zclose(zf);
@@ -173,7 +185,8 @@
** Returns FALSE if there was a short read.
*/
-static boolean PCX_LoadImage (ZFILE *zf, int in_bpr, int img_bpr, Image *image, int rows)
+static boolean PCX_LoadImage (ZFILE *zf, int in_bpr, int img_bpr,
+ Image *image, int rows, boolean readpal)
{
/* Goes like this: Read a byte. If the two high bits are set,
** then the low 6 bits contain a repeat count, and the byte to
@@ -185,10 +198,12 @@
int row = 0;
int bytes_this_row = 0;
int b, i, cnt;
+ /* For binary image we need to reverse all bits. */
+ int xor_mask = (image->type == IBITMAP) ? 0xff : 0;
ptr = &(image->data[0]);
- while ((b = zgetc(zf)) != EOF) {
+ while (row < rows && (b = zgetc(zf)) != EOF) {
if ((b & 0xC0) == 0xC0) {
/* have a repetition count -- mask flag bits */
@@ -201,12 +216,14 @@
cnt = 1; /* no repeating this one */
}
+ b ^= xor_mask;
+
for ( i = 0; i < cnt; i++ ) {
if ( row >= rows ) {
- return TRUE;
+ break;
}
if (bytes_this_row < img_bpr)
- *ptr++ = (unsigned char) (255 - b);
+ *ptr++ = (unsigned char) b;
if (++bytes_this_row == in_bpr) {
/* start of a new line */
row++;
@@ -214,6 +231,25 @@
}
}
}
+ /* Read a palette if needed. */
+ if (readpal) {
+ /* The palette is separated from the pixels data by dummy
+ byte equal to 12. */
+ if ((b = zgetc(zf)) == EOF || b != 12)
+ return FALSE;
+
+ for (cnt = 0; cnt < 256; ++cnt) {
+ int r, g, b;
+ if ((r = zgetc(zf)) == EOF
+ || (g = zgetc(zf)) == EOF
+ || (b = zgetc(zf)) == EOF)
+ return FALSE;
+ image->rgb.red[cnt] = r << 8;
+ image->rgb.green[cnt] = g << 8;
+ image->rgb.blue[cnt] = b << 8;
+ }
+ image->rgb.used = 256;
+ }
return TRUE;
}

View File

@@ -0,0 +1,11 @@
--- Imakefile
+++ Imakefile
@@ -19,7 +19,7 @@
PNG_INCLUDES =
PNG_LDFLAGS =
-SYSPATHFILE = $(XAPPLOADDIR)/Xli
+SYSPATHFILE = $(RPM_BUILD_ROOT)/usr/lib/X11/Xli
DEPLIBS = $(DEPXLIB)
LOCAL_LIBRARIES = $(XLIB) $(JPEG_LDFLAGS) $(PNG_LDFLAGS) -ljpeg -lpng -lz
SYS_LIBRARIES = -lm

84
xli-1.17.0-overflow.patch Normal file
View File

@@ -0,0 +1,84 @@
--- ddxli.h
+++ ddxli.h
@@ -36,11 +36,13 @@
/* equate bcopy with memcpy and bzero with memset where appropriate. */
#ifdef HAS_MEMCPY
+#ifndef __linux__
#ifndef bcopy
#define bcopy(S,D,N) memcpy((char *)(D),(char *)(S),(N))
#endif
#ifndef bzero
#define bzero(P,N) memset((P),'\0',(N))
+#endif /* __linux__ */
#endif
#ifndef bfill
#define bfill(P,N,C) memset((P),(C),(N))
--- faces.c
+++ faces.c
@@ -56,9 +56,15 @@
if (! strcmp(buf, "\n"))
break;
if (!strncmp(buf, "FirstName:", 10))
- strcpy(fname, buf + 11);
+ {
+ strncpy(fname, buf + 11, BUFSIZ - 1);
+ fname[BUFSIZ - 1] = '\0';
+ }
else if (!strncmp(buf, "LastName:", 9))
- strcpy(lname, buf + 10);
+ {
+ strncpy(lname, buf + 10, BUFSIZ - 1);
+ lname[BUFSIZ - 1] = '\0';
+ }
else if (!strncmp(buf, "Image:", 6)) {
if (sscanf(buf + 7, "%d%d%d", &iw, &ih, &id) != 3) {
fprintf(stderr,"facesLoad: %s - Bad image\n", name);
--- reduce.c
+++ reduce.c
@@ -178,7 +178,8 @@
/* get destination image */
depth = colorsToDepth(OutColors);
new_image = newRGBImage(image->width, image->height, depth);
- sprintf(buf, "%s (%d colors)", image->title, OutColors);
+ snprintf(buf, BUFSIZ, "%s (%d colors)", image->title, OutColors);
+ buf[BUFSIZ-1] = '\0';
new_image->title = dupString(buf);
new_image->gamma = image->gamma;
--- zoom.c
+++ zoom.c
@@ -52,28 +52,29 @@
if (verbose)
printf(" Zooming image Y axis by %d%%...", yzoom);
if (changetitle)
- sprintf(buf, "%s (Y zoom %d%%)", oimage->title, yzoom);
+ snprintf(buf, BUFSIZ, "%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, BUFSIZ, "%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, BUFSIZ, "%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, BUFSIZ, "%s (X zoom %d%% Y zoom %d%%)", oimage->title,
xzoom, yzoom);
}
+ buf[BUFSIZ-1] = '\0';
if (!changetitle)
strcpy(buf,oimage->title);

73
xli-1.17.0.patch Normal file
View File

@@ -0,0 +1,73 @@
--- ddxli.h 1999-10-25 04:14:53.000000000 +0200
+++ ddxli.h 2005-09-08 12:07:33.948259924 +0200
@@ -14,7 +14,7 @@
#include <sys/shm.h>
#include <X11/extensions/XShm.h>
-#if defined(SYSV) || defined(VMS)
+#if defined(SYSV) || defined(VMS) || defined __GLIBC__
#include <string.h>
#ifndef index /* some SysV's do this for you */
#define index strchr
--- Imakefile 2005-09-05 07:01:30.000000000 +0200
+++ Imakefile 2005-09-08 12:07:33.931258518 +0200
@@ -9,7 +9,7 @@
# -DHAVE_BOOLEAN if your system declares 'boolean' somewhere
# -DHAVE_BUNZIP2 if you have bzip2 and want to handle .bz2 files
-#ifdef HPArchitecture
+#if defined(HPArchitecture) && !defined(LinuxArchitecture)
CCOPTIONS = -Aa -D_HPUX_SOURCE
#endif
@@ -38,8 +38,8 @@
install:: $(SYSPATHFILE)
$(RM) $(BINDIR)/xview $(BINDIR)/xsetbg
- $(LN) $(BINDIR)/xli $(BINDIR)/xview
- $(LN) $(BINDIR)/xli $(BINDIR)/xsetbg
+ $(LN) xli $(BINDIR)/xview
+ $(LN) xli $(BINDIR)/xsetbg
$(SYSPATHFILE):
@echo "*** Creating default $(SYSPATHFILE) since you"
--- root.c 2005-09-05 07:01:30.000000000 +0200
+++ root.c 2005-09-08 12:07:34.013265302 +0200
@@ -55,8 +55,8 @@
Pixmap *pm;
Atom actual_type; /* NOTUSED */
int format;
- int nitems;
- int bytes_after;
+ unsigned long nitems;
+ unsigned long bytes_after;
/* intern the property name */
Atom atom = XInternAtom(dpy, RETAIN_PROP_NAME, 0);
@@ -64,8 +64,7 @@
/* look for existing resource allocation */
if ((XGetWindowProperty(dpy, w, atom, 0, 1, 1 /*delete */ ,
AnyPropertyType, &actual_type, &format,
- (unsigned long *) &nitems,
- (unsigned long *) &bytes_after,
+ &nitems, &bytes_after,
(unsigned char **) &pm) == Success) &&
nitems == 1) {
if ((actual_type == XA_PIXMAP) && (format == 32) &&
@@ -162,14 +161,13 @@
for (i = 0; i < numChildren; i++) {
Atom actual_type;
int actual_format;
- long nitems, bytesafter;
+ unsigned long nitems, bytesafter;
Window *newRoot = NULL;
if (XGetWindowProperty(disp, children[i], __SWM_VROOT,
0, 1, FALSE, XA_WINDOW, &actual_type,
&actual_format,
- (unsigned long *) &nitems,
- (unsigned long *) &bytesafter,
+ &nitems, &bytesafter,
(unsigned char **) &newRoot)
== Success && newRoot) {
root = *newRoot;

105
xli.changes Normal file
View File

@@ -0,0 +1,105 @@
-------------------------------------------------------------------
Thu Jul 27 16:28:51 CEST 2006 - lmichnovic@suse.cz
- building with X.org 7.x: detects version of X.org instead of
suse_version
-------------------------------------------------------------------
Sat Jul 22 20:18:38 CEST 2006 - lmichnovic@suse.cz
- create config file in /usr/lib/X11/Xli as sugested in man page
(configfile.patch)
- now builds also with new X.org 7.x
-------------------------------------------------------------------
Wed Jan 25 21:43:12 CET 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
-------------------------------------------------------------------
Thu Jan 12 20:14:01 CET 2006 - lmichnovic@suse.cz
- added -fstack-protector into CCOPTIONS in specfile
-------------------------------------------------------------------
Fri Oct 14 16:29:08 CEST 2005 - lmichnovic@suse.cz
- fixed buffer overflow which can be misused to execute arbitrary code (#121922)
- added support 8bit color images with palette.
-------------------------------------------------------------------
Thu Sep 8 12:16:53 CEST 2005 - ltinkl@suse.cz
- update to snapshot 2005-09-04 which incorporates fixes for
the previous security bug (#66139) and fullscreen handling
(#115258)
-------------------------------------------------------------------
Fri Jun 10 11:27:46 CEST 2005 - meissner@suse.de
- use RPM_OPT_FLAGS
-------------------------------------------------------------------
Wed Apr 20 15:35:44 CEST 2005 - ltinkl@suse.de
- fix buffer overflow (#66139)
-------------------------------------------------------------------
Thu Jul 1 09:36:30 CEST 2004 - bg@suse.de
- fix Imakefile for hppa
-------------------------------------------------------------------
Tue Feb 24 15:14:31 CET 2004 - schwab@suse.de
- Fix bad unsigned division [#25778].
-------------------------------------------------------------------
Wed Jun 04 20:01:54 CEST 2003 - mjancar@suse.cz
- added URL
-------------------------------------------------------------------
Wed Nov 13 17:27:20 CET 2002 - jderfina@suse.cz
- fixed "GCC no longer implements <varargs.h>." error.
-------------------------------------------------------------------
Thu Sep 26 10:28:26 CEST 2002 - max@suse.de
- New version 1.17.0.
- Now supports PNG and progressive JPEG.
-------------------------------------------------------------------
Tue Sep 4 16:39:03 CEST 2001 - nadvornik@suse.cz
- fixed copyright tag
- removed Provides: xli
-------------------------------------------------------------------
Fri Jul 20 14:46:18 CEST 2001 - nadvornik@suse.cz
- fixed possible buffer overflow
-------------------------------------------------------------------
Fri Apr 13 17:58:21 CEST 2001 - schwab@suse.de
- Fix missing declarations.
- Fix unaligned access.
-------------------------------------------------------------------
Fri May 12 09:52:42 CEST 2000 - nadvornik@suse.cz
- added BuildRoot
- removed Makefile.Linux
-------------------------------------------------------------------
Mon Sep 13 17:23:57 CEST 1999 - bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
----------------------------------------------------------------------------
Mon Jun 9 14:48:44 MEST 1997 - fehr@suse.de
- make all smlinks relative

147
xli.spec Normal file
View File

@@ -0,0 +1,147 @@
#
# spec file for package xli (Version 20050904)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: xli
BuildRequires: libjpeg-devel libpng-devel xorg-x11-devel
%define ver 2005-09-04
License: Other License(s), see package, X11/MIT
Group: System/X11/Utilities
Provides: xli115
Autoreqprov: on
Version: 20050904
Release: 17
Summary: X11 Image Loading Utility
URL: http://pantransit.reptiles.org/prog
Source: xli-1.17.0-%{version}.tar.bz2
Patch0: xli-1.17.0.patch
Patch1: xli-1.17.0-overflow.patch
Patch2: xli-1.17.0-8bit_palette.patch
Patch3: xli-1.17.0-configfile.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if "%(xft-config --prefix)" == "/usr"
%define _xorg7libs %_lib
%define _xorg7libs32 lib
%define _xorg7bin bin
%define _xorg7_mandir %_mandir
%define _xorg7pixmaps include
%define _xorg7libshare share
%define _xorg7_xkb /usr/share/X11/xkb
%define _xorg7_termcap /usr/lib/X11/etc
%define _xorg7_serverincl /usr/include/xorg
%define _xorg7_fonts /usr/share/fonts
#%define _xorg7_config /usr/share/X11/config #use libshare macro
%define _xorg7_prefix /usr
%else
%define _xorg7libs X11R6/%_lib
%define _xorg7libs32 X11R6/lib
%define _xorg7bin X11R6/bin
%define _xorg7_mandir /usr/X11R6/man
%define _xorg7pixmaps X11R6/include
%define _xorg7libshare X11R6/lib/
%define _xorg7_xkb /etc/X11/xkb
%define _xorg7_termcap /usr/X11R6/lib/X11/etc
%define _xorg7_serverincl /usr/X11R6/lib/Server/include
%define _xorg7_fonts /usr/X11R6/lib/X11/fonts
#%define _xorg7_config /usr/X11R6/lib/X11/config #use libshare macro
%define _xorg7_prefix /usr/X11R6
%endif
%description
xli is a version of xloadimage.
This utility will view several types of images under X11, or load
images onto the X11 root window.
Authors:
--------
Graeme Gill <GraemeGill@access.net.au>
Smarasderagd <smar@reptiles.org>
%prep
%setup -q -n xli-%{ver}
%patch0
%patch1
%patch2
%patch3
%build
xmkmf -a
make %{?jobs:-j%jobs} all CCOPTIONS="$RPM_OPT_FLAGS -fstack-protector"
%install
mkdir -p $RPM_BUILD_ROOT/usr/lib/X11
make BINDIR=$RPM_BUILD_ROOT/usr/%{_xorg7bin} install
make DESTDIR=$RPM_BUILD_ROOT install.man
%clean
rm -rf $RPM_BUILD_ROOT
%files
%doc README* ABOUTGAMMA
%doc %{_xorg7_mandir}/man1/xli.1x.gz
%doc %{_xorg7_mandir}/man1/xlito.1x.gz
/usr/%{_xorg7bin}/xli
/usr/%{_xorg7bin}/xlito
/usr/%{_xorg7bin}/xsetbg
/usr/%{_xorg7bin}/xview
/usr/lib/X11/Xli
%changelog -n xli
* Thu Jul 27 2006 - lmichnovic@suse.cz
- building with X.org 7.x: detects version of X.org instead of
suse_version
* Sat Jul 22 2006 - lmichnovic@suse.cz
- create config file in /usr/lib/X11/Xli as sugested in man page
(configfile.patch)
- now builds also with new X.org 7.x
* Wed Jan 25 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
* Thu Jan 12 2006 - lmichnovic@suse.cz
- added -fstack-protector into CCOPTIONS in specfile
* Fri Oct 14 2005 - lmichnovic@suse.cz
- fixed buffer overflow which can be misused to execute arbitrary code (#121922)
- added support 8bit color images with palette.
* Thu Sep 08 2005 - ltinkl@suse.cz
- update to snapshot 2005-09-04 which incorporates fixes for
the previous security bug (#66139) and fullscreen handling
(#115258)
* Fri Jun 10 2005 - meissner@suse.de
- use RPM_OPT_FLAGS
* Wed Apr 20 2005 - ltinkl@suse.de
- fix buffer overflow (#66139)
* Thu Jul 01 2004 - bg@suse.de
- fix Imakefile for hppa
* Tue Feb 24 2004 - schwab@suse.de
- Fix bad unsigned division [#25778].
* Wed Jun 04 2003 - mjancar@suse.cz
- added URL
* Wed Nov 13 2002 - jderfina@suse.cz
- fixed "GCC no longer implements <varargs.h>." error.
* Thu Sep 26 2002 - max@suse.de
- New version 1.17.0.
- Now supports PNG and progressive JPEG.
* Tue Sep 04 2001 - nadvornik@suse.cz
- fixed copyright tag
- removed Provides: xli
* Fri Jul 20 2001 - nadvornik@suse.cz
- fixed possible buffer overflow
* Fri Apr 13 2001 - schwab@suse.de
- Fix missing declarations.
- Fix unaligned access.
* Fri May 12 2000 - nadvornik@suse.cz
- added BuildRoot
- removed Makefile.Linux
* Mon Sep 13 1999 - bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
* Mon Jun 09 1997 - fehr@suse.de
- make all smlinks relative