Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package chmlib for openSUSE:Factory checked in at 2023-10-06 21:12:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/chmlib (Old) and /work/SRC/openSUSE:Factory/.chmlib.new.28202 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "chmlib" Fri Oct 6 21:12:36 2023 rev:22 rq:1115793 version:0.40 Changes: -------- --- /work/SRC/openSUSE:Factory/chmlib/chmlib.changes 2021-06-18 10:13:17.557955094 +0200 +++ /work/SRC/openSUSE:Factory/.chmlib.new.28202/chmlib.changes 2023-10-06 21:12:44.500166627 +0200 @@ -1,0 +2,12 @@ +Thu Oct 5 09:50:41 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- drop chmlib-0.39.diff - superseded by + chmlib-0001-Patch-to-fix-integer-types-problem-by-Goswin-von-Bre.patch +- add + chmlib-0001-Patch-to-fix-integer-types-problem-by-Goswin-von-Bre.patch, + chmlib-0002-Fix-for-extract_chmLib-confusing-empty-files-with-di.patch, + chm_http-port-shortopt.patch, chm_http-bind-localhost.patch, + chm_http-output-server-address.patch, chmlib-c99.patch: restrict + access to localhost to somewhat reduce reach + +------------------------------------------------------------------- Old: ---- chmlib-0.39.diff New: ---- chm_http-bind-localhost.patch chm_http-output-server-address.patch chm_http-port-shortopt.patch chmlib-0001-Patch-to-fix-integer-types-problem-by-Goswin-von-Bre.patch chmlib-0002-Fix-for-extract_chmLib-confusing-empty-files-with-di.patch chmlib-c99.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ chmlib.spec ++++++ --- /var/tmp/diff_new_pack.5HY9YL/_old 2023-10-06 21:12:45.852215474 +0200 +++ /var/tmp/diff_new_pack.5HY9YL/_new 2023-10-06 21:12:45.856215618 +0200 @@ -1,7 +1,7 @@ # # spec file for package chmlib # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,7 +26,18 @@ URL: http://www.jedrea.com/chmlib/ Source0: http://www.jedrea.com/chmlib/%{name}-%{version}.tar.bz2 Source2: baselibs.conf -Patch0: %{name}-0.39.diff +# backported from upstream +Patch1: chmlib-0001-Patch-to-fix-integer-types-problem-by-Goswin-von-Bre.patch +# backported from upstream +Patch2: chmlib-0002-Fix-for-extract_chmLib-confusing-empty-files-with-di.patch +# PATCH-FIX-UPSTREAM: https://github.com/jedwing/CHMLib/pull/10 +Patch3: chm_http-port-shortopt.patch +# PATCH-FIX-UPSTREAM: https://github.com/jedwing/CHMLib/pull/11 +Patch4: chm_http-bind-localhost.patch +# PATCH-FIX-UPSTREAM: https://github.com/jedwing/CHMLib/pull/12 +Patch5: chm_http-output-server-address.patch +# PATCH-FIX-UPSTREAM: https://github.com/jedwing/CHMLib/pull/17 +Patch6: chmlib-c99.patch BuildRequires: gcc-c++ %description @@ -61,8 +72,7 @@ to convert chm files from command line. %prep -%setup -q -%patch0 +%autosetup -p1 %build export CFLAGS="%{optflags} -fstack-protector" @@ -79,11 +89,11 @@ find %{buildroot} -type f -name "*.la" -delete -print %post -n %{lname} -p /sbin/ldconfig - %postun -n %{lname} -p /sbin/ldconfig %files -n %{lname} -%doc AUTHORS COPYING NEWS README +%license COPYING +%doc AUTHORS NEWS README %{_libdir}/*.so.* %files devel ++++++ chm_http-bind-localhost.patch ++++++ >From ad27f1981415f9b9df179099e36d793327ce6d8c Mon Sep 17 00:00:00 2001 From: "FeRD (Frank Dana)" <ferd...@gmail.com> Date: Thu, 11 Jul 2019 20:57:19 -0400 Subject: [PATCH] Change the default binding to 127.0.0.1 --- src/chm_http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chm_http.c b/src/chm_http.c index 237e85a..ddffe55 100644 --- a/src/chm_http.c +++ b/src/chm_http.c @@ -50,7 +50,7 @@ #include <getopt.h> int config_port = 8080; -char config_bind[65536] = "0.0.0.0"; +char config_bind[65536] = "127.0.0.1"; static void usage(const char *argv0) { -- 2.21.0 ++++++ chm_http-output-server-address.patch ++++++ >From 472396d694ae1d8b77f8b349ab13e387b9eae629 Mon Sep 17 00:00:00 2001 From: "FeRD (Frank Dana)" <ferd...@gmail.com> Date: Thu, 11 Jul 2019 21:16:43 -0400 Subject: [PATCH] Print URL for server, quiet option suppresses This will display a line of text on stdout immediately after binding to the configured address and port: `Server running at http://<address>:<port>/` An option `-q` / `--quiet` is added, to suppress the output. --- src/chm_http.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/chm_http.c b/src/chm_http.c index 237e85a..84304f9 100644 --- a/src/chm_http.c +++ b/src/chm_http.c @@ -51,13 +51,14 @@ int config_port = 8080; char config_bind[65536] = "127.0.0.1"; +char config_quiet = 0; static void usage(const char *argv0) { #ifdef CHM_HTTP_SIMPLE - fprintf(stderr, "usage: %s <filename>\n", argv0); + fprintf(stderr, "usage: %s [--quiet] <filename>\n", argv0); #else - fprintf(stderr, "usage: %s [--port=PORT] [--bind=IP] <filename>\n", argv0); + fprintf(stderr, "usage: %s [--quiet] [--port=PORT] [--bind=IP] <filename>\n", argv0); #endif exit(1); } @@ -80,6 +81,7 @@ int main(int c, char **v) { { "port", required_argument, 0, 'p' }, { "bind", required_argument, 0, 'b' }, + { "quiet", no_argument, 0, 'q' }, { "help", no_argument, 0, 'h' }, { 0, 0, 0, 0 } }; @@ -87,7 +89,7 @@ int main(int c, char **v) while (1) { int o; - o = getopt_long (c, v, "p:b:h", longopts, &optindex); + o = getopt_long (c, v, "p:b:qh", longopts, &optindex); if (o < 0) { break; @@ -109,6 +111,10 @@ int main(int c, char **v) config_bind[65535] = '\0'; break; + case 'q': + config_quiet = 1; + break; + case 'h': usage (v[0]); break; @@ -182,6 +188,12 @@ static void chmhttp_server(const char *filename) exit(3); } + /* Display URL for server */ + if (!config_quiet) + { + printf("Server running at http://%s:%d/\n", config_bind, config_port); + } + /* listen for connections */ listen(server.socket, 75); addrLen = sizeof(struct sockaddr); -- 2.21.0 ++++++ chm_http-port-shortopt.patch ++++++ >From 107ce67661c517d1c0b63c31ed1dbe34573de445 Mon Sep 17 00:00:00 2001 From: "FeRD (Frank Dana)" <ferd...@gmail.com> Date: Thu, 11 Jul 2019 21:20:23 -0400 Subject: [PATCH] Correct port short-opt to -p (not -n) The getopt_long arguments specified the short option for `--port` as `-n`, which was not handled by the case statement, making both `-p` (invalid argument) and `-n` (ignored) unusable to set the port. --- src/chm_http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chm_http.c b/src/chm_http.c index 237e85a..6ae00cc 100644 --- a/src/chm_http.c +++ b/src/chm_http.c @@ -87,7 +87,7 @@ int main(int c, char **v) while (1) { int o; - o = getopt_long (c, v, "n:b:h", longopts, &optindex); + o = getopt_long (c, v, "p:b:h", longopts, &optindex); if (o < 0) { break; -- 2.21.0 ++++++ chmlib-0001-Patch-to-fix-integer-types-problem-by-Goswin-von-Bre.patch ++++++ >From be20aa9e5992f371fa0f73be16bb1b145192a428 Mon Sep 17 00:00:00 2001 From: Jed Wing <jed.w...@gmail.com> Date: Wed, 27 May 2009 18:25:42 -0700 Subject: [PATCH 1/2] Patch to fix integer types problem by Goswin von Brederlow. This came from Goswin von Brederlow <brede...@informatik.uni-tuebingen.de> via Kartik Mistry, the maintainer of the Debian package of chmlib. --- src/chm_lib.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/chm_lib.c b/src/chm_lib.c index 6c6736c..ffd213c 100644 --- a/src/chm_lib.c +++ b/src/chm_lib.c @@ -56,6 +56,7 @@ #include "lzx.h" +#include <stdint.h> #include <stdlib.h> #include <string.h> #ifdef CHM_DEBUG @@ -149,22 +150,9 @@ typedef unsigned __int32 UInt32; typedef __int64 Int64; typedef unsigned __int64 UInt64; -/* I386, 32-bit, non-Windows */ -/* Sparc */ -/* MIPS */ -/* PPC */ -#elif __i386__ || __sun || __sgi || __ppc__ -typedef unsigned char UChar; -typedef short Int16; -typedef unsigned short UInt16; -typedef long Int32; -typedef unsigned long UInt32; -typedef long long Int64; -typedef unsigned long long UInt64; - /* x86-64 */ /* Note that these may be appropriate for other 64-bit machines. */ -#elif __x86_64__ || __ia64__ +#elif defined(__LP64__) typedef unsigned char UChar; typedef short Int16; typedef unsigned short UInt16; @@ -173,10 +161,18 @@ typedef unsigned int UInt32; typedef long Int64; typedef unsigned long UInt64; +/* I386, 32-bit, non-Windows */ +/* Sparc */ +/* MIPS */ +/* PPC */ #else - -/* yielding an error is preferable to yielding incorrect behavior */ -#error "Please define the sized types for your platform in chm_lib.c" +typedef unsigned char UChar; +typedef short Int16; +typedef unsigned short UInt16; +typedef long Int32; +typedef unsigned long UInt32; +typedef long long Int64; +typedef unsigned long long UInt64; #endif /* GCC */ -- 1.8.3.1 ++++++ chmlib-0002-Fix-for-extract_chmLib-confusing-empty-files-with-di.patch ++++++ >From 5998ff5105a9cd3f684519927e2ac78d3b6a3c30 Mon Sep 17 00:00:00 2001 From: Jed Wing <jed.w...@gmail.com> Date: Wed, 27 May 2009 18:41:10 -0700 Subject: [PATCH 2/2] Fix for extract_chmLib confusing empty files with directories. Patch from Paul Wise <p...@debian.org> via Kartik Mistry, the maintainer of the Debian chmlib package. --- src/extract_chmLib.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/extract_chmLib.c b/src/extract_chmLib.c index 078cc35..478c892 100644 --- a/src/extract_chmLib.c +++ b/src/extract_chmLib.c @@ -102,6 +102,7 @@ int _extract_callback(struct chmFile *h, struct chmUnitInfo *ui, void *context) { + LONGUINT64 ui_path_len; char buffer[32768]; struct extract_context *ctx = (struct extract_context *)context; char *i; @@ -119,7 +120,11 @@ int _extract_callback(struct chmFile *h, if (snprintf(buffer, sizeof(buffer), "%s%s", ctx->base_path, ui->path) > 1024) return CHM_ENUMERATOR_FAILURE; - if (ui->length != 0) + /* Get the length of the path */ + ui_path_len = strlen(ui->path)-1; + + /* Distinguish between files and dirs */ + if (ui->path[ui_path_len] != '/' ) { FILE *fout; LONGINT64 len, remain=ui->length; -- 1.8.3.1 ++++++ chmlib-c99.patch ++++++ Avoid implicit function declarations, for C99 compatibility Include <arpa/inet.h> for inet_addr, <unistd.h> for close, write. Define _LARGEFILE64_SOURCE so that <unistd.h> defines pread64. This avoids build failures with future compilers which do not support implicit function declarations by default. Submitted upstream: <https://github.com/jedwing/CHMLib/pull/17> diff --git a/src/chm_http.c b/src/chm_http.c index dd2787c52dece02b..08afb24db15830f9 100644 --- a/src/chm_http.c +++ b/src/chm_http.c @@ -43,6 +43,8 @@ #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> +#include <arpa/inet.h> +#include <unistd.h> /* threading includes */ #include <pthread.h> diff --git a/src/chm_lib.c b/src/chm_lib.c index ffd213c4f66d4319..9eb9d1b915364e60 100644 --- a/src/chm_lib.c +++ b/src/chm_lib.c @@ -48,6 +48,8 @@ * * ***************************************************************************/ +#define _LARGEFILE64_SOURCE /* for pread64 */ + #include "chm_lib.h" #ifdef CHM_MT