Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
108d205e3a | ||
|
|
be504ea700 | ||
|
|
2f8855e0d3 | ||
|
|
09d22c15fd |
23 changed files with 8651 additions and 21 deletions
0
.cvsignore → .gitignore
vendored
0
.cvsignore → .gitignore
vendored
4203
01_libjpeg-support.dpatch
Normal file
4203
01_libjpeg-support.dpatch
Normal file
File diff suppressed because it is too large
Load diff
1777
02_png-support.dpatch
Normal file
1777
02_png-support.dpatch
Normal file
File diff suppressed because it is too large
Load diff
157
03_security-strfoo.dpatch
Normal file
157
03_security-strfoo.dpatch
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
#! /bin/sh -e
|
||||
## 03_newpatch.dpatch by James Troup <james@nocrew.org>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: Fix unsafe str{cat,cpy} usage.
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1
|
||||
fi
|
||||
case "$1" in
|
||||
-patch) patch -f --no-backup-if-mismatch -p1 < $0;;
|
||||
-unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
|
||||
*)
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
diff -urNad 03.xloadimage.tmp/config.c 03.xloadimage/config.c
|
||||
--- 03.xloadimage.tmp/config.c 2003-04-02 19:16:50.000000000 +0100
|
||||
+++ 03.xloadimage/config.c 2003-04-02 19:16:44.000000000 +0100
|
||||
@@ -256,7 +256,8 @@
|
||||
}
|
||||
break;
|
||||
case parse_filter_name: /* name of filter program */
|
||||
- strcpy(filter_name, buf);
|
||||
+ strncpy(filter_name, buf, BUFSIZ - 1);
|
||||
+ filter_name[BUFSIZ - 1] = '\0';
|
||||
state= parse_filter_extension;
|
||||
break;
|
||||
case parse_filter_extension:
|
||||
@@ -454,7 +455,8 @@
|
||||
#endif
|
||||
else if(*p == '~') {
|
||||
buf1[b1] = '\0';
|
||||
- strcat(buf1, getenv("HOME"));
|
||||
+ strncat(buf1, getenv("HOME"), BUFSIZ - strlen(buf1) - 1);
|
||||
+ buf1[BUFSIZ - 1] = '\0';
|
||||
b1 = strlen(buf1);
|
||||
var = 0;
|
||||
}
|
||||
@@ -462,7 +464,8 @@
|
||||
if(var) {
|
||||
buf1[b1] = '\0';
|
||||
buf2[b2] = '\0';
|
||||
- strcat(buf1, getenv(buf2));
|
||||
+ strncat(buf1, getenv(buf2), BUFSIZ - strlen (buf1) - 1);
|
||||
+ buf1[BUFSIZ - 1] = '\0';
|
||||
b1 = strlen(buf1);
|
||||
buf2[0] = '\0';
|
||||
b2 = 0;
|
||||
diff -urNad 03.xloadimage.tmp/faces.c 03.xloadimage/faces.c
|
||||
--- 03.xloadimage.tmp/faces.c 1993-10-21 22:28:37.000000000 +0100
|
||||
+++ 03.xloadimage/faces.c 2003-04-02 19:16:44.000000000 +0100
|
||||
@@ -108,9 +108,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) {
|
||||
printf("%s: Bad Faces Project image\n", fullname);
|
||||
@@ -136,7 +142,7 @@
|
||||
|
||||
image= newRGBImage(w, h, d);
|
||||
fname[strlen(fname) - 1]= ' ';
|
||||
- strcat(fname, lname);
|
||||
+ strncat(fname, lname, BUFSIZ - strlen(fname) -1);
|
||||
fname[strlen(fname) - 1]= '\0';
|
||||
image->title= dupString(fname);
|
||||
|
||||
diff -urNad 03.xloadimage.tmp/imagetypes.c 03.xloadimage/imagetypes.c
|
||||
--- 03.xloadimage.tmp/imagetypes.c 2003-04-02 19:16:50.000000000 +0100
|
||||
+++ 03.xloadimage/imagetypes.c 2003-04-02 19:16:44.000000000 +0100
|
||||
@@ -146,7 +146,10 @@
|
||||
optptr++; /* skip comma */
|
||||
}
|
||||
else
|
||||
- strcpy(typename, type);
|
||||
+ {
|
||||
+ strncpy(typename, type, 31);
|
||||
+ typename[31] = '\0';
|
||||
+ }
|
||||
|
||||
for (a= 0; ImageTypes[a].loader; a++)
|
||||
if (!strncmp(ImageTypes[a].type, typename, strlen(typename))) {
|
||||
diff -urNad 03.xloadimage.tmp/options.c 03.xloadimage/options.c
|
||||
--- 03.xloadimage.tmp/options.c 2003-04-02 19:16:50.000000000 +0100
|
||||
+++ 03.xloadimage/options.c 2003-04-02 19:16:44.000000000 +0100
|
||||
@@ -13,6 +13,9 @@
|
||||
#include "image.h"
|
||||
#include "options.h"
|
||||
|
||||
+#undef MIN
|
||||
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
|
||||
+
|
||||
extern char *ProgramName;
|
||||
/* options array and definitions. If you add something to this you also
|
||||
* need to add its OptionId in options.h.
|
||||
@@ -883,12 +886,13 @@
|
||||
*/
|
||||
p = index(*opt_string, ',');
|
||||
if (p != NULL) {
|
||||
- strncpy(option_name, *opt_string, p - *opt_string);
|
||||
- option_name[p - *opt_string] = '\0';
|
||||
+ strncpy(option_name, *opt_string, MIN(BUFSIZ - 1, p - *opt_string));
|
||||
+ option_name[MIN(BUFSIZ - 1, p - *opt_string)] = '\0';
|
||||
*opt_string = p + 1; /* increment to next option */
|
||||
}
|
||||
else {
|
||||
- strcpy(option_name, *opt_string);
|
||||
+ strncpy(option_name, *opt_string, BUFSIZ -1);
|
||||
+ option_name[BUFSIZ - 1] = '\0';
|
||||
*opt_string += strlen(*opt_string); /* increment to end of string */
|
||||
}
|
||||
*name = option_name;
|
||||
@@ -897,7 +901,8 @@
|
||||
*/
|
||||
p = index(option_name, '=');
|
||||
if (p != NULL) {
|
||||
- strcpy(option_value, p + 1);
|
||||
+ strncpy(option_value, p + 1, BUFSIZ - 1);
|
||||
+ option_value[BUFSIZ - 1] = '\0';
|
||||
*p = '\0'; /* stomp equals sign */
|
||||
*value = option_value;
|
||||
}
|
||||
diff -urNad 03.xloadimage.tmp/packtar.c 03.xloadimage/packtar.c
|
||||
--- 03.xloadimage.tmp/packtar.c 1993-11-09 21:18:14.000000000 +0000
|
||||
+++ 03.xloadimage/packtar.c 2003-04-02 19:16:44.000000000 +0100
|
||||
@@ -48,9 +48,12 @@
|
||||
char new_file[1024];
|
||||
char *p;
|
||||
|
||||
- strcpy(new_file, dir); /* target directory */
|
||||
- strcat(new_file, "/");
|
||||
- strcat(new_file, old_file);
|
||||
+ strncpy(new_file, dir, 1023); /* target directory */
|
||||
+ new_file[1023] = '\0';
|
||||
+ strncat(new_file, "/", 1023 - strlen(new_file));
|
||||
+ new_file[1023] = '\0';
|
||||
+ strncat(new_file, old_file, 1023 - strlen(new_file));
|
||||
+ new_file[1023] = '\0';
|
||||
|
||||
for (p = new_file; p = strchr(p, '/'); p++) {
|
||||
*p = '\0'; /* stomp directory separator */
|
||||
32
04_previous-image.dpatch
Normal file
32
04_previous-image.dpatch
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#! /bin/sh -e
|
||||
## 04_previous-image.dpatch by Juan Cespedes <cespedes@debian.org>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: Fix 'p' (previous image) key.
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1
|
||||
fi
|
||||
case "$1" in
|
||||
-patch) patch -f --no-backup-if-mismatch -p1 < $0;;
|
||||
-unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
|
||||
*)
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
diff -urNad 04.xloadimage.tmp/xloadimage.c 04.xloadimage/xloadimage.c
|
||||
--- 04.xloadimage.tmp/xloadimage.c 2003-04-02 19:28:25.000000000 +0100
|
||||
+++ 04.xloadimage/xloadimage.c 2003-04-02 19:27:44.000000000 +0100
|
||||
@@ -493,6 +493,8 @@
|
||||
if (!tmpset)
|
||||
goto redisplay_in_window; /* ick */
|
||||
optset= tmpset;
|
||||
+ freeImage(dispimage);
|
||||
+ dispimage= NULL;
|
||||
goto get_another_image; /* ick */
|
||||
case '<':
|
||||
if ((opt = getOption(optset,ZOOM)) == NULL) {
|
||||
58
05_idelay-manpage.dpatch
Normal file
58
05_idelay-manpage.dpatch
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
#! /bin/sh -e
|
||||
## 05_idelay-manpage.dpatch by James Troup <james@nocrew.org>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: Update manpage for how -idelay/-delay actually work.
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1
|
||||
fi
|
||||
case "$1" in
|
||||
-patch) patch -f --no-backup-if-mismatch -p1 < $0;;
|
||||
-unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
|
||||
*)
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
diff -urNad 05.xloadimage.tmp/xloadimage.man 05.xloadimage/xloadimage.man
|
||||
--- 05.xloadimage.tmp/xloadimage.man 1993-10-21 22:29:05.000000000 +0100
|
||||
+++ 05.xloadimage/xloadimage.man 2003-04-02 19:33:28.000000000 +0100
|
||||
@@ -84,9 +84,6 @@
|
||||
debugging. If an X error is seen while in this mode, a core will be
|
||||
dumped.
|
||||
.TP
|
||||
--delay \fIsecs\fR
|
||||
-Automatically advance to the next image after \fIsecs\fR seconds.
|
||||
-.TP
|
||||
-display \fIdisplay_name\fR
|
||||
X11 display name to send the image(s) to.
|
||||
.TP
|
||||
@@ -237,6 +234,11 @@
|
||||
Specify the maximum number of colors to use in the image. This is a
|
||||
way to forcibly reduce the depth of an image.
|
||||
.TP
|
||||
+-delay \fIsecs\fR
|
||||
+Automatically advance to the next image after \fIsecs\fR seconds. You
|
||||
+may want to use the \fI-global\fR switch with this command to create a
|
||||
+slideshow with multiple images.
|
||||
+.TP
|
||||
-dither
|
||||
Dither a color image to monochrome using a Floyd-Steinberg dithering
|
||||
algorithm. This happens by default when viewing color images on a
|
||||
@@ -273,10 +275,8 @@
|
||||
but will take longer to process and will be less accurate.
|
||||
.TP
|
||||
-idelay \fIsecs\fR
|
||||
-Set the delay to be used for this image to \fIsecs\fR seconds (see
|
||||
-\fI-delay\fR). If \fI-delay\fR was specified, this overrides it. If
|
||||
-it was not specified, this sets the automatic advance delay for this
|
||||
-image while others will wait for the user to advance them.
|
||||
+This option is no longer supported due to the addition of
|
||||
+\fI-global\fR. The same functionality can be had with \fI-delay\fR.
|
||||
.TP
|
||||
-invert
|
||||
Inverts a monochrome image. This is shorthand for \fI-foreground
|
||||
1361
06_-Wall-cleanup.dpatch
Normal file
1361
06_-Wall-cleanup.dpatch
Normal file
File diff suppressed because it is too large
Load diff
32
07_SYSPATHFILE.dpatch
Normal file
32
07_SYSPATHFILE.dpatch
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#! /bin/sh -e
|
||||
## 07_SYSPATHFILE.dpatch by James Troup <james@nocrew.org>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: Define SYSPATHFILE during build.
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1
|
||||
fi
|
||||
case "$1" in
|
||||
-patch) patch -f --no-backup-if-mismatch -p1 < $0;;
|
||||
-unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
|
||||
*)
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
diff -urNad 07.xloadimage.tmp/Makefile.in 07.xloadimage/Makefile.in
|
||||
--- 07.xloadimage.tmp/Makefile.in 2003-04-02 23:40:49.000000000 +0100
|
||||
+++ 07.xloadimage/Makefile.in 2003-04-02 23:40:15.000000000 +0100
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
CC = @CC@
|
||||
-DEFS = @DEFS@
|
||||
+DEFS = @DEFS@ -DSYSPATHFILE=\"/etc/X11/Xloadimage\"
|
||||
CFLAGS = @CFLAGS@
|
||||
XLIB = @X_LIBS@ -lX11 @X_EXTRA_LIBS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
32
08_manpage-config-path.dpatch
Normal file
32
08_manpage-config-path.dpatch
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#! /bin/sh -e
|
||||
## 08_manpage-config-path.dpatch by Austin Donnelly <and1000@debian.org>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: Correct path for system-wide configuration file in manpage.
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1
|
||||
fi
|
||||
case "$1" in
|
||||
-patch) patch -f --no-backup-if-mismatch -p1 < $0;;
|
||||
-unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
|
||||
*)
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
diff -urNad 08.xloadimage.tmp/xloadimage.man 08.xloadimage/xloadimage.man
|
||||
--- 08.xloadimage.tmp/xloadimage.man 2003-04-02 23:43:14.000000000 +0100
|
||||
+++ 08.xloadimage/xloadimage.man 2003-04-02 23:42:26.000000000 +0100
|
||||
@@ -633,7 +633,7 @@
|
||||
xloadimage - the image loader and viewer
|
||||
xsetbg - pseudonym which quietly sets the background
|
||||
xview - pseudonym which views in a window
|
||||
-/usr/lib/X11/Xloadimage - default system-wide configuration file
|
||||
+/etc/X11/Xloadimage - default system-wide configuration file
|
||||
~/.xloadimagerc - user's personal configuration file
|
||||
.in -5
|
||||
.fi
|
||||
34
09_xloadimagerc-path.dpatch
Normal file
34
09_xloadimagerc-path.dpatch
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#! /bin/sh -e
|
||||
## 09_xloadimagerc-path.dpatch by Austin Donnelly <and1000@debian.org>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: Include ~images in path for system-wide configuration file.
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1
|
||||
fi
|
||||
case "$1" in
|
||||
-patch) patch -f --no-backup-if-mismatch -p1 < $0;;
|
||||
-unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
|
||||
*)
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
diff -urNad 09.xloadimage.tmp/xloadimagerc 09.xloadimage/xloadimagerc
|
||||
--- 09.xloadimage.tmp/xloadimagerc 1993-10-21 22:30:32.000000000 +0100
|
||||
+++ 09.xloadimage/xloadimagerc 2003-04-02 23:44:16.000000000 +0100
|
||||
@@ -1,6 +1,9 @@
|
||||
# Sample .xloadimagerc file
|
||||
|
||||
-path = /usr/local/images
|
||||
+# Directories to search for images
|
||||
+path = ~/images /usr/local/images
|
||||
+
|
||||
+# Default extensions to try tacking onto the end of a filename, in order
|
||||
extension = .niff # NIFF image
|
||||
.jpg .jpeg # JPEG image
|
||||
.gif # CompuServe GIF image
|
||||
78
10_config.c-HOME-fix.dpatch
Normal file
78
10_config.c-HOME-fix.dpatch
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
#! /bin/sh -e
|
||||
## 10_config.c-HOME-fix.dpatch by Austin Donnelly <and1000@debian.org>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: Gracefully handle lack of HOME env. variable.
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1
|
||||
fi
|
||||
case "$1" in
|
||||
-patch) patch -f --no-backup-if-mismatch -p1 < $0;;
|
||||
-unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
|
||||
*)
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
diff -urNad 10.xloadimage.tmp/config.c 10.xloadimage/config.c
|
||||
--- 10.xloadimage.tmp/config.c 2003-04-02 23:48:30.000000000 +0100
|
||||
+++ 10.xloadimage/config.c 2003-04-02 23:46:22.000000000 +0100
|
||||
@@ -15,11 +15,13 @@
|
||||
#include <sys/stat.h>
|
||||
#ifndef VMS
|
||||
#include <pwd.h>
|
||||
+#include <sys/types.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
+#include <stdlib.h>
|
||||
|
||||
/* SUPPRESS 530 */
|
||||
/* SUPPRESS 560 */
|
||||
@@ -434,14 +436,29 @@
|
||||
printf("No filters\n");
|
||||
}
|
||||
|
||||
+/* Work out where this user's home directory is, or default to '/' */
|
||||
+/* XXX needs a VMS guru to supply something plausable for VMS */
|
||||
+static char *homedir()
|
||||
+{ char *p;
|
||||
+ struct passwd *pw;
|
||||
+
|
||||
+ p = getenv("HOME");
|
||||
+ if (p) return p;
|
||||
+
|
||||
+ /* try for a password file lookup instead */
|
||||
+ pw = getpwuid(getuid());
|
||||
+ if (!pw)
|
||||
+ return "/"; /* XXX maybe print message? */
|
||||
+ else
|
||||
+ return pw->pw_dir;
|
||||
+}
|
||||
+
|
||||
char *expandPath(p)
|
||||
char *p;
|
||||
{ char buf1[BUFSIZ], buf2[BUFSIZ];
|
||||
int b1, b2, var;
|
||||
char *ptr;
|
||||
|
||||
- char *getenv();
|
||||
-
|
||||
buf1[0] = '\0';
|
||||
buf2[0] = '\0';
|
||||
b1 = 0;
|
||||
@@ -455,7 +472,7 @@
|
||||
#endif
|
||||
else if(*p == '~') {
|
||||
buf1[b1] = '\0';
|
||||
- strncat(buf1, getenv("HOME"), BUFSIZ - strlen(buf1) - 1);
|
||||
+ strncat(buf1, homedir(), BUFSIZ - strlen(buf1) - 1);
|
||||
buf1[BUFSIZ - 1] = '\0';
|
||||
b1 = strlen(buf1);
|
||||
var = 0;
|
||||
31
11_fork-implies-quiet.dpatch
Normal file
31
11_fork-implies-quiet.dpatch
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#! /bin/sh -e
|
||||
## 11_fork-implies-quiet.dpatch by Jens Peter Secher <jpsecher@diku.dk>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: Make -fork imply -quiet as documented.
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1
|
||||
fi
|
||||
case "$1" in
|
||||
-patch) patch -f --no-backup-if-mismatch -p1 < $0;;
|
||||
-unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
|
||||
*)
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
diff -urNad 11.xloadimage.tmp/options.c 11.xloadimage/options.c
|
||||
--- 11.xloadimage.tmp/options.c 2003-04-05 14:13:53.000000000 +0100
|
||||
+++ 11.xloadimage/options.c 2003-04-05 14:13:30.000000000 +0100
|
||||
@@ -551,6 +551,7 @@
|
||||
optionName(FORK));
|
||||
continue;
|
||||
#else
|
||||
+ killOption(global_options, VERBOSE);
|
||||
global_opt= 1;
|
||||
break;
|
||||
#endif
|
||||
51
12_fix-tile.dpatch
Normal file
51
12_fix-tile.dpatch
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#! /bin/sh -e
|
||||
## 12_fix-tile.dpatch by Rémi Guyomarch <rguyom@pobox.com> (via FreeBSD & OpenBSD)
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: Fix -tile for images smaller than the screen.
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1
|
||||
fi
|
||||
case "$1" in
|
||||
-patch) patch -f --no-backup-if-mismatch -p1 < $0;;
|
||||
-unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
|
||||
*)
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
diff -urNad 12.xloadimage.tmp/merge.c 12.xloadimage/merge.c
|
||||
--- 12.xloadimage.tmp/merge.c 1993-10-21 22:28:39.000000000 +0100
|
||||
+++ 12.xloadimage/merge.c 2003-04-05 15:04:06.000000000 +0100
|
||||
@@ -244,6 +244,7 @@
|
||||
int x, y;
|
||||
unsigned int width, height, verbose;
|
||||
{ Image *base, *tmp;
|
||||
+ int nx, ny;
|
||||
|
||||
if (verbose) {
|
||||
printf(" Tiling...");
|
||||
@@ -259,16 +260,14 @@
|
||||
else
|
||||
base = newTrueImage(width, height);
|
||||
|
||||
- while (x < base->width) {
|
||||
- while(y < base->height) {
|
||||
- tmp = merge(base, image, x, y, 0);
|
||||
+ for (nx = x; nx < base->width; nx += image->width) {
|
||||
+ for(ny = y; ny < base->height; ny += image->height) {
|
||||
+ tmp = merge(base, image, nx, ny, 0);
|
||||
if (tmp != base) {
|
||||
freeImage(base);
|
||||
base = tmp;
|
||||
}
|
||||
- y += image->width;
|
||||
}
|
||||
- x += image->width;
|
||||
}
|
||||
printf("done.\n");
|
||||
return(base);
|
||||
37
13_varargs-is-obsolete.dpatch
Normal file
37
13_varargs-is-obsolete.dpatch
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#!/bin/sh -e
|
||||
## 13_varargs-is-obsolete.dpatch by James Troup <james@nocrew.org>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: <varargs.h> is obsolete and no longer supported by gcc-3.3.
|
||||
## DP: ... and more to the point rlelib.c doesn't actually need it.
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
|
||||
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
|
||||
|
||||
case "$1" in
|
||||
-patch) patch $patch_opts -p1 < $0;;
|
||||
-unpatch) patch $patch_opts -p1 -R < $0;;
|
||||
*)
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
@DPATCH@
|
||||
diff -urNad /home/james/debian/packages/xloadimage/xloadimage-4.1/rlelib.c xloadimage-4.1/rlelib.c
|
||||
--- /home/james/debian/packages/xloadimage/xloadimage-4.1/rlelib.c 2003-06-06 03:32:44.000000000 +0100
|
||||
+++ xloadimage-4.1/rlelib.c 2003-06-06 03:33:00.000000000 +0100
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
-#include <varargs.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "image.h" /* need ZFILE definition */
|
||||
88
14_errno-not-extern.dpatch
Normal file
88
14_errno-not-extern.dpatch
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
#!/bin/sh -e
|
||||
## 14_errno-not-extern.dpatch by James Troup <james@nocrew.org>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: Remove 'extern int errno' which breaks with new glibc (>=
|
||||
## DP: 2.3.2-ds1-8) and add #include <errno.h> where needed.
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
|
||||
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
|
||||
|
||||
case "$1" in
|
||||
-patch) patch $patch_opts -p1 < $0;;
|
||||
-unpatch) patch $patch_opts -p1 -R < $0;;
|
||||
*)
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
@DPATCH@
|
||||
diff -urNad /home/james/debian/packages/xloadimage/xloadimage-4.1/config.c xloadimage-4.1/config.c
|
||||
--- /home/james/debian/packages/xloadimage/xloadimage-4.1/config.c 2003-10-31 01:50:29.000000000 +0000
|
||||
+++ xloadimage-4.1/config.c 2003-10-31 01:50:29.000000000 +0000
|
||||
@@ -26,8 +26,6 @@
|
||||
/* SUPPRESS 530 */
|
||||
/* SUPPRESS 560 */
|
||||
|
||||
-extern int errno;
|
||||
-
|
||||
struct filter *Filters = (struct filter *)NULL;
|
||||
|
||||
static unsigned int NumPaths= 0;
|
||||
diff -urNad /home/james/debian/packages/xloadimage/xloadimage-4.1/imagetypes.c xloadimage-4.1/imagetypes.c
|
||||
--- /home/james/debian/packages/xloadimage/xloadimage-4.1/imagetypes.c 2003-10-31 01:50:29.000000000 +0000
|
||||
+++ xloadimage-4.1/imagetypes.c 2003-10-31 01:50:29.000000000 +0000
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
/* SUPPRESS 560 */
|
||||
|
||||
-extern int errno;
|
||||
extern int findImage(char *name, char *fullname);
|
||||
|
||||
/* load a named image
|
||||
diff -urNad /home/james/debian/packages/xloadimage/xloadimage-4.1/img.c xloadimage-4.1/img.c
|
||||
--- /home/james/debian/packages/xloadimage/xloadimage-4.1/img.c 2003-10-31 01:50:29.000000000 +0000
|
||||
+++ xloadimage-4.1/img.c 2003-10-31 01:50:43.000000000 +0000
|
||||
@@ -14,10 +14,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
+#include <errno.h>
|
||||
#include "image.h"
|
||||
|
||||
-extern int errno;
|
||||
-
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
diff -urNad /home/james/debian/packages/xloadimage/xloadimage-4.1/packtar.c xloadimage-4.1/packtar.c
|
||||
--- /home/james/debian/packages/xloadimage/xloadimage-4.1/packtar.c 2003-10-31 01:50:29.000000000 +0000
|
||||
+++ xloadimage-4.1/packtar.c 2003-10-31 01:50:29.000000000 +0000
|
||||
@@ -11,8 +11,6 @@
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
-extern int errno;
|
||||
-
|
||||
/* poor-man's varargs. good enough for now.
|
||||
*/
|
||||
int run(a0, a1, a2, a3, a4, a5, a6, a7, a8)
|
||||
diff -urNad /home/james/debian/packages/xloadimage/xloadimage-4.1/window.c xloadimage-4.1/window.c
|
||||
--- /home/james/debian/packages/xloadimage/xloadimage-4.1/window.c 2003-10-31 01:50:29.000000000 +0000
|
||||
+++ xloadimage-4.1/window.c 2003-10-31 01:50:29.000000000 +0000
|
||||
@@ -33,8 +33,6 @@
|
||||
|
||||
/* SUPPRESS 560 */
|
||||
|
||||
-extern int errno; /* not defined in errno.h on some systems */
|
||||
-
|
||||
static Window ImageWindow= 0;
|
||||
static Window ViewportWin= 0;
|
||||
static Colormap ImageColormap;
|
||||
61
15_CAN-2005-0638.dpatch
Normal file
61
15_CAN-2005-0638.dpatch
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
#! /bin/sh -e
|
||||
## 15_CAN-2005-0638.dpatch
|
||||
##
|
||||
## DP: Description: Fix shell metacharacters vulnerability with compressed
|
||||
## DP: images (#298926).
|
||||
## DP: Author: xli upstream via Gentoo
|
||||
## DP: Upstream status: Not submitted
|
||||
## DP: Date: 2005-03-10
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1
|
||||
fi
|
||||
case "$1" in
|
||||
-patch) patch -f --no-backup-if-mismatch -p1 < $0;;
|
||||
-unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
|
||||
*)
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
@DPATCH@
|
||||
diff -urNad --exclude=CVS --exclude=.svn ./zio.c /tmp/dpep-work.7hAKRd/xloadimage-4.1/zio.c
|
||||
--- ./zio.c 1993-10-28 17:10:02.000000000 +0000
|
||||
+++ /tmp/dpep-work.7hAKRd/xloadimage-4.1/zio.c 2005-10-08 04:12:08.000000000 +0100
|
||||
@@ -210,9 +210,30 @@
|
||||
if ((strlen(name) > strlen(filter->extension)) &&
|
||||
!strcmp(filter->extension,
|
||||
name + (strlen(name) - strlen(filter->extension)))) {
|
||||
- debug(("Filtering image through '%s'\n", filter->filter));
|
||||
- zf->type= ZPIPE;
|
||||
- sprintf(buf, "%s %s", filter->filter, name);
|
||||
+ char *fname, *t, *s;
|
||||
+
|
||||
+ /* meta-char protection from xli.
|
||||
+ *
|
||||
+ * protect in single quotes, replacing single quotes
|
||||
+ * with '"'"', so worst-case expansion is 5x
|
||||
+ */
|
||||
+
|
||||
+ s = fname = (char *) lmalloc(1 + (5 * strlen(name)) + 1 + 1);
|
||||
+ *s++ = '\'';
|
||||
+ for (t = name; *t; ++t) {
|
||||
+ if ('\'' == *t) {
|
||||
+ /* 'foo'bar' -> 'foo'"'"'bar' */
|
||||
+ strcpy(s, "'\"'\"'");
|
||||
+ s += strlen(s);
|
||||
+ } else {
|
||||
+ *s++ = *t;
|
||||
+ }
|
||||
+ }
|
||||
+ strcpy (s, "'");
|
||||
+ debug(("Filtering image through '%s'\n", filter->filter));
|
||||
+ zf->type= ZPIPE;
|
||||
+ sprintf(buf, "%s %s", filter->filter, fname);
|
||||
+ lfree (fname);
|
||||
if (! (zf->stream= popen(buf, "r"))) {
|
||||
lfree((byte *)zf->filename);
|
||||
zf->filename= NULL;
|
||||
71
16_CAN-2005-0639.dpatch
Normal file
71
16_CAN-2005-0639.dpatch
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
#! /bin/sh -e
|
||||
## 16_CAN-2005-0639.dpatch
|
||||
##
|
||||
## DP: Description: Fix integer overflows in new.c.
|
||||
## DP: Author: Debian security team
|
||||
## DP: Upstream status: Not submitted
|
||||
## DP: Date: 2005-03-18
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1
|
||||
fi
|
||||
case "$1" in
|
||||
-patch) patch -f --no-backup-if-mismatch -p1 < $0;;
|
||||
-unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
|
||||
*)
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
@DPATCH@
|
||||
diff -urNad --exclude=CVS --exclude=.svn ./new.c /tmp/dpep-work.Yefw4q/xloadimage-4.1/new.c
|
||||
--- ./new.c 1993-10-28 17:24:14.000000000 +0000
|
||||
+++ /tmp/dpep-work.Yefw4q/xloadimage-4.1/new.c 2005-10-08 04:12:37.000000000 +0100
|
||||
@@ -63,6 +63,18 @@
|
||||
}
|
||||
|
||||
|
||||
+static unsigned int ovmul(unsigned int a, unsigned int b)
|
||||
+{
|
||||
+ unsigned int r;
|
||||
+
|
||||
+ r = a * b;
|
||||
+ if (r / a != b) {
|
||||
+ memoryExhausted();
|
||||
+ }
|
||||
+
|
||||
+ return r;
|
||||
+}
|
||||
+
|
||||
void goodImage(image, func)
|
||||
Image *image;
|
||||
char *func;
|
||||
@@ -128,7 +140,7 @@
|
||||
image->height= height;
|
||||
image->depth= 1;
|
||||
linelen= (width / 8) + (width % 8 ? 1 : 0); /* thanx johnh@amcc.com */
|
||||
- image->data= (unsigned char *)lcalloc(linelen * height);
|
||||
+ image->data= (unsigned char *)lcalloc(ovmul(linelen, height));
|
||||
return(image);
|
||||
}
|
||||
|
||||
@@ -149,7 +161,7 @@
|
||||
image->height= height;
|
||||
image->depth= depth;
|
||||
image->pixlen= pixlen;
|
||||
- image->data= (unsigned char *)lmalloc(width * height * pixlen);
|
||||
+ image->data= (unsigned char *)lmalloc(ovmul(ovmul(width, height), pixlen));
|
||||
return(image);
|
||||
}
|
||||
|
||||
@@ -165,6 +177,7 @@
|
||||
image->height= height;
|
||||
image->depth= 24;
|
||||
image->pixlen= 3;
|
||||
+ image->data= (unsigned char *)lmalloc(ovmul(ovmul(width, height), 3));
|
||||
image->data= (unsigned char *)lmalloc(width * height * 3);
|
||||
return(image);
|
||||
}
|
||||
135
17_security-sprintf.dpatch
Normal file
135
17_security-sprintf.dpatch
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
#! /bin/sh -e
|
||||
## 17_security-sprintf.dpatch
|
||||
##
|
||||
## DP: Description: Fix unsafe sprintf usage. (#332524)
|
||||
## DP: Author: James Troup <james@nocrew.org>
|
||||
## DP: Upstream status: Not submitted
|
||||
## DP: URL: http://msgs.securepoint.com/cgi-bin/get/bugtraq0510/57.html
|
||||
## DP: Date: 2005-10-07
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1
|
||||
fi
|
||||
case "$1" in
|
||||
-patch) patch -f --no-backup-if-mismatch -p1 < $0;;
|
||||
-unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
|
||||
*)
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
@DPATCH@
|
||||
diff -urNad --exclude=CVS --exclude=.svn ./mcidas.c /tmp/dpep-work.5qsW5w/xloadimage-4.1/mcidas.c
|
||||
--- ./mcidas.c 2005-10-08 04:15:18.000000000 +0100
|
||||
+++ /tmp/dpep-work.5qsW5w/xloadimage-4.1/mcidas.c 2005-10-08 04:15:19.000000000 +0100
|
||||
@@ -63,7 +63,7 @@
|
||||
minute = (time % 10000) / 100;
|
||||
second = (time % 100);
|
||||
|
||||
- sprintf(buf, "%d:%2.2d:%2.2d %s %d, %d (day %d)",
|
||||
+ snprintf(buf, 29, "%d:%2.2d:%2.2d %s %d, %d (day %d)",
|
||||
hour, minute, second, month_info[month].name, day, year,
|
||||
(date % 1000));
|
||||
return(buf);
|
||||
diff -urNad --exclude=CVS --exclude=.svn ./reduce.c /tmp/dpep-work.5qsW5w/xloadimage-4.1/reduce.c
|
||||
--- ./reduce.c 2005-10-08 04:15:18.000000000 +0100
|
||||
+++ /tmp/dpep-work.5qsW5w/xloadimage-4.1/reduce.c 2005-10-08 04:15:19.000000000 +0100
|
||||
@@ -501,7 +501,7 @@
|
||||
|
||||
depth= colorsToDepth(n);
|
||||
new_image= newRGBImage(image->width, image->height, depth);
|
||||
- sprintf(buf, "%s (%d colors)", image->title, n);
|
||||
+ snprintf(buf, BUFSIZ - 1, "%s (%d colors)", image->title, n);
|
||||
new_image->title= dupString(buf);
|
||||
|
||||
/* calculate RGB table from each color area. this should really calculate
|
||||
diff -urNad --exclude=CVS --exclude=.svn ./rotate.c /tmp/dpep-work.5qsW5w/xloadimage-4.1/rotate.c
|
||||
--- ./rotate.c 2005-10-08 04:15:18.000000000 +0100
|
||||
+++ /tmp/dpep-work.5qsW5w/xloadimage-4.1/rotate.c 2005-10-08 04:15:19.000000000 +0100
|
||||
@@ -70,7 +70,7 @@
|
||||
{ printf(" Rotating image by %d degrees...", degrees);
|
||||
fflush(stdout);
|
||||
}
|
||||
- sprintf(buf, "%s (rotated by %d degrees)", simage->title, degrees);
|
||||
+ snprintf(buf, BUFSIZ - 1, "%s (rotated by %d degrees)", simage->title, degrees);
|
||||
|
||||
image1 = simage;
|
||||
image2 = NULL;
|
||||
diff -urNad --exclude=CVS --exclude=.svn ./tiff.c /tmp/dpep-work.5qsW5w/xloadimage-4.1/tiff.c
|
||||
--- ./tiff.c 2005-10-08 04:15:18.000000000 +0100
|
||||
+++ /tmp/dpep-work.5qsW5w/xloadimage-4.1/tiff.c 2005-10-08 04:15:19.000000000 +0100
|
||||
@@ -125,14 +125,14 @@
|
||||
switch (info->photometric) {
|
||||
case PHOTOMETRIC_MINISBLACK:
|
||||
if (info->bitspersample > 1) {
|
||||
- sprintf(buf, "%d-bit greyscale ", info->bitspersample);
|
||||
+ snprintf(buf, 31, "%d-bit greyscale ", info->bitspersample);
|
||||
return(buf);
|
||||
}
|
||||
else
|
||||
return "white-on-black ";
|
||||
case PHOTOMETRIC_MINISWHITE:
|
||||
if (info->bitspersample > 1) {
|
||||
- sprintf(buf, "%d-bit greyscale ", info->bitspersample);
|
||||
+ snprintf(buf, 31, "%d-bit greyscale ", info->bitspersample);
|
||||
return(buf);
|
||||
}
|
||||
else
|
||||
diff -urNad --exclude=CVS --exclude=.svn ./window.c /tmp/dpep-work.5qsW5w/xloadimage-4.1/window.c
|
||||
--- ./window.c 2005-10-08 04:15:18.000000000 +0100
|
||||
+++ /tmp/dpep-work.5qsW5w/xloadimage-4.1/window.c 2005-10-08 04:15:19.000000000 +0100
|
||||
@@ -602,7 +602,7 @@
|
||||
else {
|
||||
char def_geom[30];
|
||||
|
||||
- sprintf(def_geom, "%ux%u+0+0", image->width, image->height);
|
||||
+ snprintf(def_geom, 29, "%ux%u+0+0", image->width, image->height);
|
||||
XGeometry(disp, scrn, opt->info.geometry.string, def_geom, 0, 1, 1, 0, 0,
|
||||
(int *)&winx, (int *)&winy, (int *)&winwidth, (int *)&winheight);
|
||||
}
|
||||
diff -urNad --exclude=CVS --exclude=.svn ./zio.c /tmp/dpep-work.5qsW5w/xloadimage-4.1/zio.c
|
||||
--- ./zio.c 2005-10-08 04:15:18.000000000 +0100
|
||||
+++ /tmp/dpep-work.5qsW5w/xloadimage-4.1/zio.c 2005-10-08 04:15:28.000000000 +0100
|
||||
@@ -232,7 +232,7 @@
|
||||
strcpy (s, "'");
|
||||
debug(("Filtering image through '%s'\n", filter->filter));
|
||||
zf->type= ZPIPE;
|
||||
- sprintf(buf, "%s %s", filter->filter, fname);
|
||||
+ snprintf(buf, BUFSIZ - 1, "%s %s", filter->filter, fname);
|
||||
lfree (fname);
|
||||
if (! (zf->stream= popen(buf, "r"))) {
|
||||
lfree((byte *)zf->filename);
|
||||
diff -urNad --exclude=CVS --exclude=.svn ./zoom.c /tmp/dpep-work.5qsW5w/xloadimage-4.1/zoom.c
|
||||
--- ./zoom.c 2005-10-08 04:15:18.000000000 +0100
|
||||
+++ /tmp/dpep-work.5qsW5w/xloadimage-4.1/zoom.c 2005-10-08 04:15:19.000000000 +0100
|
||||
@@ -63,23 +63,23 @@
|
||||
if (!xzoom) {
|
||||
if (verbose)
|
||||
printf(" Zooming image Y axis by %d%%...", yzoom);
|
||||
- sprintf(buf, "%s (Y zoom %d%%)", oimage->title, yzoom);
|
||||
+ snprintf(buf, BUFSIZ - 1, "%s (Y zoom %d%%)", oimage->title, yzoom);
|
||||
}
|
||||
else if (!yzoom) {
|
||||
if (verbose)
|
||||
printf(" Zooming image X axis by %d%%...", xzoom);
|
||||
- sprintf(buf, "%s (X zoom %d%%)", oimage->title, xzoom);
|
||||
+ snprintf(buf, BUFSIZ - 1, "%s (X zoom %d%%)", oimage->title, xzoom);
|
||||
}
|
||||
else if (xzoom == yzoom) {
|
||||
if (verbose)
|
||||
printf(" Zooming image by %d%%...", xzoom);
|
||||
- sprintf(buf, "%s (%d%% zoom)", oimage->title, xzoom);
|
||||
+ snprintf(buf, BUFSIZ - 1, "%s (%d%% zoom)", oimage->title, xzoom);
|
||||
}
|
||||
else {
|
||||
if (verbose)
|
||||
printf(" Zooming image X axis by %d%% and Y axis by %d%%...",
|
||||
xzoom, yzoom);
|
||||
- sprintf(buf, "%s (X zoom %d%% Y zoom %d%%)", oimage->title,
|
||||
+ snprintf(buf, BUFSIZ - 1, "%s (X zoom %d%% Y zoom %d%%)", oimage->title,
|
||||
xzoom, yzoom);
|
||||
}
|
||||
if (verbose)
|
||||
112
18_manpage_fixes.dpatch
Normal file
112
18_manpage_fixes.dpatch
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
#! /bin/sh -e
|
||||
## 18_manpage_fixes.dpatch
|
||||
##
|
||||
## DP: Various typo fixes and correction of .TH section.
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1
|
||||
fi
|
||||
case "$1" in
|
||||
-patch) patch -f --no-backup-if-mismatch -p1 < $0;;
|
||||
-unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
|
||||
*)
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
@DPATCH@
|
||||
diff -urNad xloadimage-4.1~/uufilter.man xloadimage-4.1/uufilter.man
|
||||
--- xloadimage-4.1~/uufilter.man 1993-11-04 15:47:26.000000000 +0000
|
||||
+++ xloadimage-4.1/uufilter.man 2005-12-06 02:47:57.000000000 +0000
|
||||
@@ -1,4 +1,4 @@
|
||||
-.TH UUFILTER 1 "21 October 1993"
|
||||
+.TH UUFILTER 1x "21 October 1993"
|
||||
.SH NAME
|
||||
uufilter - decode uuencoded files to stdout
|
||||
.SH SYNOPSIS
|
||||
@@ -12,7 +12,7 @@
|
||||
\fIUufilter\fR automatically ignores lines that do not appear to be
|
||||
part of the uuencoded file. This is particularly useful in uudecoding
|
||||
files that have been concatenated from several email or news postings
|
||||
-without stripping off the headers or otherwise editting extraneous
|
||||
+without stripping off the headers or otherwise editing extraneous
|
||||
content.
|
||||
.SH OPTIONS
|
||||
.TP 8
|
||||
diff -urNad xloadimage-4.1~/xloadimage.man xloadimage-4.1/xloadimage.man
|
||||
--- xloadimage-4.1~/xloadimage.man 2005-12-06 02:45:45.000000000 +0000
|
||||
+++ xloadimage-4.1/xloadimage.man 2005-12-06 02:52:04.000000000 +0000
|
||||
@@ -1,4 +1,4 @@
|
||||
-.TH XLOADIMAGE 1 "8 May 1991"
|
||||
+.TH XLOADIMAGE 1x "8 May 1991"
|
||||
.SH NAME
|
||||
xloadimage, xsetbg, xview \- load images into an X11 window or onto
|
||||
the root window
|
||||
@@ -174,7 +174,7 @@
|
||||
-type \fItype_name\fR
|
||||
Forces \fIxloadimage\fR to try to load the image as a particular file
|
||||
type rather than trying to guess. This often improves load
|
||||
-performance noticably.
|
||||
+performance noticeably.
|
||||
.TP
|
||||
-verbose
|
||||
Causes \fIxloadimage\fR to be talkative, telling you what kind of
|
||||
@@ -198,13 +198,13 @@
|
||||
.TP
|
||||
-windowid \fIhex_window_id\fR
|
||||
Sets the background pixmap of a particular window ID. The argument
|
||||
-must be in hexadecimal and must be preceeded by "0x" (\fIeg\fR
|
||||
+must be in hexadecimal and must be preceded by "0x" (\fIeg\fR
|
||||
-windowid 0x40000b. This is intended for setting the background
|
||||
pixmap of some servers which use untagged virtual roots
|
||||
(\fIeg\fR HP-VUE), but can have other interesting applications.
|
||||
.SH IMAGE OPTIONS
|
||||
-The following options may preceed each image. These options are
|
||||
-local to the image they preceed.
|
||||
+The following options may precede each image. These options are
|
||||
+local to the image they precede.
|
||||
.TP
|
||||
-at \fIX\fR,\fIY\fR
|
||||
Indicates coordinates to load the image at on the base image. If
|
||||
@@ -285,7 +285,7 @@
|
||||
-merge
|
||||
Merge this image onto the base image after local processing. The base
|
||||
image is considered to be the first image specified or the last image
|
||||
-that was not preceeded by \fI-merge\fR. If used in conjunction with
|
||||
+that was not preceded by \fI-merge\fR. If used in conjunction with
|
||||
\fI-at\fR and \fI-clip\fR, very complex images can be built up. This
|
||||
option is on by default for all images if the \fI-onroot\fR or
|
||||
\fI-windowid\fR options are specified.
|
||||
@@ -408,7 +408,7 @@
|
||||
When zooming color images up you can reduce blockiness with
|
||||
\fI-smooth\fR. For zooms of 300% or more, I recommend two smoothing
|
||||
passes (although this can take awhile to do on slow machines). There
|
||||
-will be a noticable improvement in the image.
|
||||
+will be a noticeable improvement in the image.
|
||||
.PP
|
||||
You can perform image processing on a small portion of an image by
|
||||
loading the image more than once and using the \fI-merge\fR, \fI-at\fR
|
||||
@@ -547,7 +547,7 @@
|
||||
filter = "uufilter -s" .uu .uue
|
||||
.fi
|
||||
The filter will be automatically invoked on any file with a .uu or
|
||||
-.uue extension.
|
||||
+\&.uue extension.
|
||||
.PP
|
||||
For a list of filters automatically recognized by xloadimage use the
|
||||
\fI-configuration\fR option.
|
||||
@@ -640,9 +640,9 @@
|
||||
.SH COPYRIGHT
|
||||
Copyright (c) 1989, 1993 Jim Frost and others.
|
||||
.PP
|
||||
-\fIXloadimage\fR is copywritten material with a very loose copyright
|
||||
+\fIXloadimage\fR is copyrighted material with a very loose copyright
|
||||
allowing unlimited modification and distribution if the copyright
|
||||
-notices are left intact. Various portions are copywritten by various
|
||||
+notices are left intact. Various portions are copyrighted by various
|
||||
people, but all use a modification of the MIT copyright notice.
|
||||
Please check the source for complete copyright information. The
|
||||
intent is to keep the source free, not to stifle its distribution, so
|
||||
184
19_fix_root_c_resource_leak.dpatch
Normal file
184
19_fix_root_c_resource_leak.dpatch
Normal file
|
|
@ -0,0 +1,184 @@
|
|||
#! /bin/sh -e
|
||||
## 19_fix_root_c_resource_leak.dpatch
|
||||
##
|
||||
## DP: Fix leaking xresources when using onroot option. See #325689.
|
||||
## DP: Patch by Alex Perry, reformatted by Tim Connors
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1
|
||||
fi
|
||||
case "$1" in
|
||||
-patch) patch -f --no-backup-if-mismatch -p1 < $0;;
|
||||
-unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
|
||||
*)
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
@DPATCH@
|
||||
diff -urNad xloadimage-4.1~/root.c xloadimage-4.1/root.c
|
||||
--- xloadimage-4.1~/root.c 2008-11-22 19:52:01.000000000 +0100
|
||||
+++ xloadimage-4.1/root.c 2008-11-22 19:52:02.000000000 +0100
|
||||
@@ -16,24 +16,6 @@
|
||||
|
||||
#define RETAIN_PROP_NAME "_XSETROOT_ID"
|
||||
|
||||
-void updateProperty(dpy, w, name, type, format, data, nelem)
|
||||
- Display *dpy;
|
||||
- Window w;
|
||||
- char *name;
|
||||
- Atom type;
|
||||
- int format;
|
||||
- int data;
|
||||
- int nelem;
|
||||
-{
|
||||
- /* intern the property name */
|
||||
- Atom atom = XInternAtom(dpy, name, 0);
|
||||
-
|
||||
- /* create or replace the property */
|
||||
- XChangeProperty(dpy, w, atom, type, format, PropModeReplace,
|
||||
- (unsigned char *)&data, nelem);
|
||||
-}
|
||||
-
|
||||
-
|
||||
/* Sets the close-down mode of the client to 'RetainPermanent'
|
||||
* so all client resources will be preserved after the client
|
||||
* exits. Puts a property on the default root window containing
|
||||
@@ -47,9 +29,15 @@
|
||||
{
|
||||
/* create dummy resource */
|
||||
Pixmap pm= XCreatePixmap(dpy, w, 1, 1, 1);
|
||||
+ unsigned char *data = (unsigned char *) ±
|
||||
|
||||
- /* create/replace the property */
|
||||
- updateProperty(dpy, w, RETAIN_PROP_NAME, XA_PIXMAP, 32, (int)pm, 1);
|
||||
+ /* intern the property name */
|
||||
+ char *name = RETAIN_PROP_NAME;
|
||||
+ Atom atom = XInternAtom(dpy, name, 0);
|
||||
+
|
||||
+ /* create or replace the property */
|
||||
+ XChangeProperty(dpy, w, atom, XA_PIXMAP, 32, PropModeReplace,
|
||||
+ data, sizeof(Pixmap)/4);
|
||||
|
||||
/* retain all client resources until explicitly killed */
|
||||
XSetCloseDownMode(dpy, RetainPermanent);
|
||||
@@ -61,36 +49,64 @@
|
||||
*/
|
||||
|
||||
static void
|
||||
-freePrevious(dpy, w)
|
||||
+freePrevious(dpy, w, verbose)
|
||||
Display *dpy;
|
||||
Window w;
|
||||
+ unsigned int verbose;
|
||||
{
|
||||
- Pixmap *pm;
|
||||
- Atom actual_type; /* NOTUSED */
|
||||
+ Pixmap *pm;
|
||||
+ unsigned char *charpm;
|
||||
+ Atom actual_type;
|
||||
int format;
|
||||
- int nitems;
|
||||
- int bytes_after;
|
||||
+ unsigned long nitems;
|
||||
+ unsigned long bytes_after;
|
||||
+ int returncode;
|
||||
|
||||
/* intern the property name */
|
||||
Atom atom = XInternAtom(dpy, RETAIN_PROP_NAME, 0);
|
||||
|
||||
/* 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, (unsigned char **)&pm) == Success) &&
|
||||
- nitems == 1) {
|
||||
- if ((actual_type == XA_PIXMAP) && (format == 32) &&
|
||||
- (nitems == 1) && (bytes_after == 0)) {
|
||||
- /* blast it away */
|
||||
- XKillClient(dpy, (XID) *pm);
|
||||
- XFree((char *)pm);
|
||||
- }
|
||||
- else if (actual_type != None) {
|
||||
- fprintf(stderr,
|
||||
- "%s: warning: invalid format encountered for property %s\n",
|
||||
- RETAIN_PROP_NAME, "xloadimage");
|
||||
- }
|
||||
+ nitems = sizeof(Pixmap)/4;
|
||||
+ returncode = XGetWindowProperty(dpy, w, atom,
|
||||
+ 0, nitems, 1/*delete*/,
|
||||
+ XA_PIXMAP, &actual_type,
|
||||
+ &format, &nitems,
|
||||
+ &bytes_after, &charpm);
|
||||
+ if (returncode != Success) {
|
||||
+ if (verbose)
|
||||
+ fprintf(stderr, "failed to look for %s with return code %i.\n",
|
||||
+ RETAIN_PROP_NAME, returncode);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* Check if the property was found */
|
||||
+ if (actual_type == None) {
|
||||
+ if (verbose)
|
||||
+ fprintf(stderr, "didn't find evidence of prior run.\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* Make sure the dummy value is still present */
|
||||
+ if (actual_type != XA_PIXMAP) {
|
||||
+ if (verbose)
|
||||
+ fprintf(stderr, "found wrong data type - skipped.\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* Check size, in case we're a different architecture */
|
||||
+ if ((nitems != sizeof(Pixmap)/4) ||
|
||||
+ (format != 32) ||
|
||||
+ (bytes_after != 0)) {
|
||||
+ if (verbose)
|
||||
+ fprintf(stderr, "saw wrong %li / word size %i / architecture %li.\n",
|
||||
+ bytes_after, format, nitems);
|
||||
+ return;
|
||||
}
|
||||
+
|
||||
+ /* blast it away */
|
||||
+ pm = (Pixmap*) charpm;
|
||||
+ XKillClient(dpy, (XID) *pm);
|
||||
+ XFree(charpm);
|
||||
}
|
||||
|
||||
#if FIND_DEC_ROOTWINDOW
|
||||
@@ -185,20 +201,21 @@
|
||||
for(i = 0; i < numChildren; i++) {
|
||||
Atom actual_type;
|
||||
int actual_format;
|
||||
- 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,
|
||||
- (unsigned char **) &newRoot) ==
|
||||
- Success && newRoot) {
|
||||
- root = *newRoot;
|
||||
+ unsigned long nitems, bytesafter;
|
||||
+ unsigned char *newRoot = 0;
|
||||
+
|
||||
+ if ((XGetWindowProperty (disp, children[i], __SWM_VROOT,0,1,
|
||||
+ False, XA_WINDOW,
|
||||
+ &actual_type, &actual_format,
|
||||
+ &nitems, &bytesafter, &newRoot)
|
||||
+ == Success) &&
|
||||
+ newRoot) {
|
||||
+ root = *((Window*) newRoot);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
- freePrevious(disp, root);
|
||||
+ freePrevious(disp, root, verbose);
|
||||
|
||||
if (! (ximageinfo= imageToXImage(disp, scrn,
|
||||
DefaultVisual(disp, scrn),
|
||||
21
Makefile
21
Makefile
|
|
@ -1,21 +0,0 @@
|
|||
# Makefile for source rpm: xloadimage
|
||||
# $Id$
|
||||
NAME := xloadimage
|
||||
SPECFILE = $(firstword $(wildcard *.spec))
|
||||
|
||||
define find-makefile-common
|
||||
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(find-makefile-common))
|
||||
|
||||
ifeq ($(MAKEFILE_COMMON),)
|
||||
# attept a checkout
|
||||
define checkout-makefile-common
|
||||
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
|
||||
endif
|
||||
|
||||
include $(MAKEFILE_COMMON)
|
||||
1
sources
1
sources
|
|
@ -0,0 +1 @@
|
|||
7331850fc04056ab8ae6b5725d1fb3d2 xloadimage.4.1.tar.gz
|
||||
116
xloadimage.spec
Normal file
116
xloadimage.spec
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
Name: xloadimage
|
||||
Summary: Image viewer and processor
|
||||
Version: 4.1
|
||||
Release: 2%{?dist}
|
||||
License: MIT
|
||||
Group: User Interface/X
|
||||
Source0: ftp://ftp.x.org/R5contrib/%{name}.%{version}.tar.gz
|
||||
# All of these patches come from Debian 4.1-16.1
|
||||
# Many thanks to all those who have done work on this package over the years
|
||||
Patch0: 01_libjpeg-support.dpatch
|
||||
Patch1: 02_png-support.dpatch
|
||||
Patch2: 03_security-strfoo.dpatch
|
||||
Patch3: 04_previous-image.dpatch
|
||||
Patch4: 05_idelay-manpage.dpatch
|
||||
Patch5: 06_-Wall-cleanup.dpatch
|
||||
Patch6: 07_SYSPATHFILE.dpatch
|
||||
Patch7: 08_manpage-config-path.dpatch
|
||||
Patch8: 09_xloadimagerc-path.dpatch
|
||||
Patch9: 10_config.c-HOME-fix.dpatch
|
||||
Patch10: 11_fork-implies-quiet.dpatch
|
||||
Patch11: 12_fix-tile.dpatch
|
||||
Patch12: 13_varargs-is-obsolete.dpatch
|
||||
Patch13: 14_errno-not-extern.dpatch
|
||||
Patch14: 15_CAN-2005-0638.dpatch
|
||||
Patch15: 16_CAN-2005-0639.dpatch
|
||||
Patch16: 17_security-sprintf.dpatch
|
||||
Patch17: 18_manpage_fixes.dpatch
|
||||
Patch18: 19_fix_root_c_resource_leak.dpatch
|
||||
|
||||
URL: http://www.frostbytes.com/~jimf/xloadimage.html
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: libX11-devel, libtiff-devel, libpng-devel, libjpeg-devel
|
||||
BuildRequires: libICE-devel
|
||||
|
||||
%description
|
||||
Xloadimage is a utility which will view many different types of images
|
||||
under X11, load images onto the root window, or dump processed images
|
||||
into one of several image file formats. The current version can read
|
||||
many different image file types.
|
||||
|
||||
A variety of options are available to modify images prior to viewing.
|
||||
These options include clipping, dithering, depth reduction, zoom (either
|
||||
X or Y axis independently or both at once), brightening or darkening,
|
||||
and image merging. When applicable, these options are done automatically
|
||||
(eg a color image to be displayed on a monochrome screen will be
|
||||
dithered automatically).
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}.%{version}
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
%patch14 -p1
|
||||
%patch15 -p1
|
||||
%patch16 -p1
|
||||
%patch17 -p1
|
||||
%patch18 -p1
|
||||
chmod +x configure
|
||||
|
||||
%build
|
||||
%configure
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
# First, the binaries:
|
||||
mkdir -p %{buildroot}%{_bindir}
|
||||
install -m 0755 uufilter %{buildroot}%{_bindir}
|
||||
install -m 0755 xloadimage %{buildroot}%{_bindir}
|
||||
# Next, the symlinks
|
||||
pushd %{buildroot}%{_bindir}
|
||||
ln -s xloadimage xsetbg
|
||||
ln -s xloadimage xview
|
||||
popd
|
||||
# The configuration file
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/X11/
|
||||
install -m 0644 xloadimagerc %{buildroot}%{_sysconfdir}/X11/Xloadimage
|
||||
# Now, the man pages
|
||||
mkdir -p %{buildroot}%{_mandir}/man1/
|
||||
install -m 0644 xloadimage.man %{buildroot}%{_mandir}/man1/xloadimage.1x
|
||||
install -m 0644 uufilter.man %{buildroot}%{_mandir}/man1/uufilter.1x
|
||||
# And some copies for the symlinks (we can't really make symlinks here because of how rpm
|
||||
# compresses man pages)
|
||||
cp -a %{buildroot}%{_mandir}/man1/xloadimage.1x %{buildroot}%{_mandir}/man1/xsetbg.1x
|
||||
cp -a %{buildroot}%{_mandir}/man1/xloadimage.1x %{buildroot}%{_mandir}/man1/xview.1x
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc README mit.cpyrght
|
||||
%{_bindir}/uufilter
|
||||
%{_bindir}/xloadimage
|
||||
%{_bindir}/xsetbg
|
||||
%{_bindir}/xview
|
||||
%config(noreplace) %{_sysconfdir}/X11/Xloadimage
|
||||
%{_mandir}/man1/*
|
||||
|
||||
%changelog
|
||||
* Wed Dec 10 2008 Tom "spot" Callaway <tcallawa@redhat.com> 4.1-2
|
||||
- drop unnecessary BR: zlib-devel (dragged in by libpng-devel)
|
||||
|
||||
* Thu Dec 4 2008 Tom "spot" Callaway <tcallawa@redhat.com> 4.1-1
|
||||
- Initial package for Fedora
|
||||
Loading…
Add table
Add a link
Reference in a new issue