Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libzio for openSUSE:Factory checked in at 2026-02-14 21:35:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libzio (Old) and /work/SRC/openSUSE:Factory/.libzio.new.1977 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libzio" Sat Feb 14 21:35:54 2026 rev:50 rq:1332878 version:1.10 Changes: -------- --- /work/SRC/openSUSE:Factory/libzio/libzio.changes 2026-02-05 17:56:42.786323696 +0100 +++ /work/SRC/openSUSE:Factory/.libzio.new.1977/libzio.changes 2026-02-14 21:35:56.109227899 +0100 @@ -1,0 +2,9 @@ +Fri Feb 6 14:32:13 UTC 2026 - Dr. Werner Fink <[email protected]> + +- Version 1.10: Allow fdzopen() to detect magic bytes as well in + the stream of the file descriptor. Note that this does not work + if reading from a pipe or socketpair as it is not possible to + reset the reposition of the file descriptor. Today it is + impossible to use fdzopen in a pipe. + +------------------------------------------------------------------- Old: ---- libzio-1.09.tar.bz2 New: ---- libzio-1.10.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libzio.spec ++++++ --- /var/tmp/diff_new_pack.BLYkNh/_old 2026-02-14 21:35:57.225273903 +0100 +++ /var/tmp/diff_new_pack.BLYkNh/_new 2026-02-14 21:35:57.225273903 +0100 @@ -18,7 +18,7 @@ Name: libzio %define lname libzio1 -Version: 1.09 +Version: 1.10 Release: 0 Summary: A Library for Accessing Compressed Text Files License: GPL-2.0-or-later ++++++ libzio-1.09.tar.bz2 -> libzio-1.10.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzio-1.09/Makefile new/libzio-1.10/Makefile --- old/libzio-1.09/Makefile 2024-02-01 10:31:01.000000000 +0100 +++ new/libzio-1.10/Makefile 2026-02-06 14:37:47.000000000 +0100 @@ -8,7 +8,7 @@ CFLAGS = $(RPM_OPT_FLAGS) -pipe -Wall -D_GNU_SOURCE -D_REENTRANT -D_DEFAULT_SOURCE $(LARGE) CC = gcc MAJOR = 1 -MINOR = 09 +MINOR = 10 VERSION = $(MAJOR).$(MINOR) SONAME = libzio.so.$(MAJOR) LDMAP = -Wl,--version-script=zio.map diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzio-1.09/zio.c new/libzio-1.10/zio.c --- old/libzio-1.09/zio.c 2024-02-01 10:31:01.000000000 +0100 +++ new/libzio-1.10/zio.c 2026-02-06 14:37:47.000000000 +0100 @@ -7,6 +7,7 @@ * Copyright 2013 Werner Fink, 2013 SuSE Products GmbH, Germany. * Copyright 2017 Werner Fink, 2017 SUSE Linux GmbH, Germany. * Copyright 2021 Werner Fink, 2021 SUSE Software Solutions Germany GmbH, Germany. + * Copyright 2026 Werner Fink, 2026 SUSE Software Solutions Germany GmbH, Germany. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -172,7 +173,8 @@ return -1; } if (bzf->fd >= 0) { - lseek(bzf->fd, 0, SEEK_SET); + if (lseek(bzf->fd, 0, SEEK_SET) < 0) + return -1; bzf->file = BZ2_bzdopen(bzf->fd, bzf->mode); } else if (bzf->path) { bzf->file = BZ2_bzopen(bzf->path, bzf->mode); @@ -882,7 +884,8 @@ if (whence != SEEK_END && newpos < curpos) { closelzw(lzw->file); if (lzw->fd >= 0) { - lseek(lzw->fd, 0, SEEK_SET); + if (lseek(lzw->fd, 0, SEEK_SET) < 0) + return -1; lzw->file = dopenlzw(lzw->fd, lzw->mode); } else if (lzw->path) { lzw->file = openlzw(lzw->path, lzw->mode); @@ -947,6 +950,32 @@ .close = (cookie_close_function_t*)lzwclose, }; +static inline char magic(const char *m, const size_t len) +{ + char what = 'n'; + if (!m || len < 5) + goto err; + + if (m[0] == '\037' && m[1] == '\213') + what = 'g'; + if (m[0] == '\037' && m[1] == '\235') + what = 'Z'; + if (m[0] == '\037' && m[1] == '\236') + what = 'z'; + else if (m[0] == 'B' && m[1] == 'Z' && m[2] == 'h') + what = 'b'; + else if (m[0] == ']' && m[1] == '\0' && m[2] == '\0' && m[3] == '\200') /* weak!! */ + what = 'l'; + else if (m[0] == '\377' && m[1] == 'L' && m[2] == 'Z' && m[3] == 'M' && m[4] == 'A') + what = 'l'; + else if (m[0] == '\375' && m[1] == '7' && m[2] == 'z' && m[3] == 'X' && m[4] == 'Z') + what = 'x'; + else if (m[0] >= 34 && m[0] <= 40 && m[1] == '\265' && m[2] == '\057' && m[3] == '\375') + what = 's'; +err: + return what; +} + static inline char autodetect(char **__restrict path, const char *__restrict check) { const size_t len = strlen(*path); @@ -1029,24 +1058,8 @@ if ((fd = open(ext, O_RDONLY|O_NOCTTY)) < 0) goto skip; - if (read(fd, m, sizeof(m)) == sizeof(m)) { - if (m[0] == '\037' && m[1] == '\213') - what = 'g'; - if (m[0] == '\037' && m[1] == '\235') - what = 'Z'; - if (m[0] == '\037' && m[1] == '\236') - what = 'z'; - else if (m[0] == 'B' && m[1] == 'Z' && m[2] == 'h') - what = 'b'; - else if (m[0] == ']' && m[1] == '\0' && m[2] == '\0' && m[3] == '\200') /* weak!! */ - what = 'l'; - else if (m[0] == '\377' && m[1] == 'L' && m[2] == 'Z' && m[3] == 'M' && m[4] == 'A') - what = 'l'; - else if (m[0] == '\375' && m[1] == '7' && m[2] == 'z' && m[3] == 'X' && m[4] == 'Z') - what = 'x'; - else if (m[0] >= 34 && m[0] <= 40 && m[1] == '\265' && m[2] == '\057' && m[3] == '\375') - what = 's'; - } + if (read(fd, m, sizeof(m)) == sizeof(m)) + what = magic(m, sizeof(m)); close(fd); skip: errno = olderr; @@ -1126,7 +1139,7 @@ goto out; } # endif - if (!(cookie = gzopen(ext, mode))) { + if ((cookie = gzopen(ext, mode)) == Z_NULL) { if (!errno) errno = ENOMEM; goto out; @@ -1419,10 +1432,12 @@ return ret; } -FILE * fdzopen(int fildes, const char * mode, const char *what) +FILE * fdzopen(int fildes, const char * mode, const char *w) { FILE * ret = (FILE *)0; char * check = (char*)0; + char m[5]; + char what; size_t n = 0; unsigned int i; @@ -1454,7 +1469,38 @@ break; } - switch (*what) { + what = *w; + + switch (what) { + int fd; + case 'g': break; + case 'z': break; + case 'Z': break; + case 'b': break; + case 'l': break; + case 'x': break; + case 's': break; + default: + if (what != '\0') { + errno = ENOTSUP; + goto out; + } + if (*mode != 'r') { + errno = ENOTSUP; + goto out; + } + if ((fd = dup(fildes)) < 0) + break; + if (read(fd, m, sizeof(m)) == sizeof(m)) + what = magic(m, sizeof(m)); + if (lseek(fd, 0, SEEK_SET) < 0) { + if (errno == ESPIPE) + goto out; + } + close(fd); + } + + switch (what) { case 'g': case 'z': /* Is this correct? Old gzip magic */ #if defined(HAS_ZLIB_H) @@ -1466,7 +1512,7 @@ goto out; } # endif - if (!(cookie = gzdopen(fildes, mode))) { + if ((cookie = gzdopen(fildes, mode)) == Z_NULL) { if (!errno) errno = ENOMEM; goto out; @@ -1607,11 +1653,11 @@ } cookie->eof = 0; - cookie->what = *what; + cookie->what = what; cookie->strm = (lzma_stream)LZMA_STREAM_INIT; cookie->level = level; cookie->encoding = (check[0] == 'w') ? 1 : 0; - lret = lzmaopen(cookie, check[0], *what, level); + lret = lzmaopen(cookie, check[0], what, level); if (lret != LZMA_OK) { fclose(cookie->file); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzio-1.09/zio.h.in new/libzio-1.10/zio.h.in --- old/libzio-1.09/zio.h.in 2024-02-01 10:31:01.000000000 +0100 +++ new/libzio-1.10/zio.h.in 2026-02-06 14:37:47.000000000 +0100 @@ -4,6 +4,7 @@ * Copyright 2004 Werner Fink, 2004 SuSE LINUX AG, Germany. * Copyright 2013 Werner Fink, 2013 SuSE LINUX AG, Germany. * Copyright 2021 Werner Fink, 2021 SUSE Software Solutions Germany GmbH, Germany. + * Copyright 2026 Werner Fink, 2026 SUSE Software Solutions Germany GmbH, Germany. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
