ports/75590: Fix security/stegdetect for 5.X
Samy Al Bahra
samy at kerneled.org
Wed Dec 29 00:50:21 UTC 2004
>Number: 75590
>Category: ports
>Synopsis: Fix security/stegdetect for 5.X
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Dec 29 00:50:21 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator: Samy Al Bahra
>Release:
>Organization:
Kerneled.org
>Environment:
>Description:
stegdetect does not compile on 5.X systems due to some antiqued
C code. A patch follows that hacks the code into compilation and
operation on 5.X systems.
>How-To-Repeat:
>Fix:
diff -ruN stegdetect/Makefile stegdetect.patch/Makefile
--- stegdetect/Makefile Wed Dec 29 02:47:34 2004
+++ stegdetect.patch/Makefile Wed Dec 29 03:37:18 2004
@@ -35,10 +35,6 @@
.include <bsd.port.pre.mk>
-.if ${OSVERSION} >= 502126
-BROKEN= "Does not compile on FreeBSD >= 5.x"
-.endif
-
post-patch:
${REINPLACE_CMD} 's/$$(JPEGLIB)/$$(JPEGLIB) -lcrypto/' \
${WRKSRC}/Makefile.in
diff -ruN stegdetect/files/patch-break_jsteg.c stegdetect.patch/files/patch-break_jsteg.c
--- stegdetect/files/patch-break_jsteg.c Thu Jan 1 03:00:00 1970
+++ stegdetect.patch/files/patch-break_jsteg.c Wed Dec 29 03:33:47 2004
@@ -0,0 +1,11 @@
+--- break_jsteg.c Fri Dec 21 01:11:32 2001
++++ /tmp/break_jsteg.c.diff Wed Dec 29 03:32:38 2004
+@@ -162,7 +162,7 @@
+ jstegob->skip = bytes - sizeof(jstegob->coeff);
+
+ if (jsbits < max || off + jsbits > bits) {
+- warnx(__FUNCTION__": bad size in bits, %d", bits);
++ warnx("break_jsteg_prepare: bad size in bits, %d", bits);
+ return (NULL);
+ }
+
diff -ruN stegdetect/files/patch-common.c stegdetect.patch/files/patch-common.c
--- stegdetect/files/patch-common.c Thu Jan 1 03:00:00 1970
+++ stegdetect.patch/files/patch-common.c Wed Dec 29 03:35:31 2004
@@ -0,0 +1,47 @@
+--- common.c Tue Jan 22 19:25:38 2002
++++ common.c.diff Wed Dec 29 03:35:11 2004
+@@ -85,7 +85,7 @@
+
+ if (datasrc->bytes_in_buffer == 0) {
+ if (! (*datasrc->fill_input_buffer) (cinfo))
+- err(1, __FUNCTION__": fill_input");
++ err(1, "jpeg_getc: fill_input");
+ }
+ datasrc->bytes_in_buffer--;
+ return GETJOCTET(*datasrc->next_input_byte++);
+@@ -297,7 +297,7 @@
+
+ dcts = malloc(bits * sizeof (short));
+ if (dcts == NULL) {
+- warn(__FUNCTION__": malloc");
++ warn("prepare_all: malloc");
+ return (-1);
+ }
+
+@@ -362,7 +362,7 @@
+ if (pdcts != NULL) {
+ dcts = malloc(bits * sizeof (short));
+ if (dcts == NULL) {
+- warn(__FUNCTION__": malloc");
++ warn("prepare_normal: malloc");
+ return (-1);
+ }
+ }
+@@ -410,7 +410,7 @@
+ /* XXX - wasteful */
+ back[comp] = calloc(off, sizeof (char));
+ if (back[comp] == NULL) {
+- warn(__FUNCTION__": calloc");
++ warn("prepare_jphide: calloc");
+ goto err;
+ }
+ }
+@@ -418,7 +418,7 @@
+ if (pdcts != NULL) {
+ dcts = malloc(mbits * sizeof (short));
+ if (dcts == NULL) {
+- warn(__FUNCTION__": malloc");
++ warn("prepare_jphide: malloc");
+ goto err;
+ }
+ }
diff -ruN stegdetect/files/patch-stegdetect.c stegdetect.patch/files/patch-stegdetect.c
--- stegdetect/files/patch-stegdetect.c Thu Jan 1 03:00:00 1970
+++ stegdetect.patch/files/patch-stegdetect.c Wed Dec 29 03:35:57 2004
@@ -0,0 +1,29 @@
+--- stegdetect.c Sat Jan 26 23:51:16 2002
++++ /tmp/stegdetect.c.diff Wed Dec 29 03:32:38 2004
+@@ -1198,7 +1198,7 @@
+ flag = 1;
+ strlcat(outbuf, " f5(***)", sizeof(outbuf));
+
+- no_f5:
++ no_f5:;
+ }
+
+ if (scans & FLAG_DOINVIS) {
+@@ -1237,7 +1237,7 @@
+ strlcat(outbuf, tmp, sizeof(outbuf));
+ }
+
+- no_invisiblesecrets:
++ no_invisiblesecrets:;
+ }
+
+ if ((scans & FLAG_CHECKHDRS)) {
+@@ -1301,7 +1301,7 @@
+ }
+
+ free(dcts);
+- jsteg_error:
++ jsteg_error:;
+ }
+
+ if ((scans & FLAG_DOOUTGUESS) && prepare_normal(&dcts, &bits) != -1) {
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list