]> git.ipfire.org Git - thirdparty/libsolv.git/log
thirdparty/libsolv.git
99 min agoAlso guard against block size overflows master
Michael Schroeder [Tue, 28 Apr 2026 12:35:11 +0000 (14:35 +0200)] 
Also guard against block size overflows

112 min agoUse the dirpool_parent inline function
Michael Schroeder [Tue, 28 Apr 2026 12:21:43 +0000 (14:21 +0200)] 
Use the dirpool_parent inline function

Should be as fast and is much more readable.

113 min agouse size_t in solv_MD5_Update()
Michael Schroeder [Tue, 28 Apr 2026 12:21:04 +0000 (14:21 +0200)] 
use size_t in solv_MD5_Update()

Instead of unsigned long.

2 hours agouse SOLV_CHKSUM_MAXLEN in repo_deb.c
Michael Schroeder [Thu, 23 Apr 2026 13:51:28 +0000 (15:51 +0200)] 
use SOLV_CHKSUM_MAXLEN in repo_deb.c

2 hours agoSplit the checksum implementation into chksum_impl.c
Michael Schroeder [Thu, 23 Apr 2026 13:44:16 +0000 (15:44 +0200)] 
Split the checksum implementation into chksum_impl.c

The goal is to move the implementation into the libsolvext at some
point in time.

2 hours agoMerge pull request #617 from ppisar/overflow_in_repo_add_solv
Michael Schroeder [Tue, 28 Apr 2026 11:42:23 +0000 (13:42 +0200)] 
Merge pull request #617 from ppisar/overflow_in_repo_add_solv

Cope with integer overflow in data size arithmetics in repo_add_solv()

4 days agoCope with integer overflow in data size arithmetics in repo_add_solv() 617/head
Petr Písař [Thu, 23 Apr 2026 16:04:24 +0000 (18:04 +0200)] 
Cope with integer overflow in data size arithmetics in repo_add_solv()

When parsing solv files with maliciously large "maxsize" or "allsize"
data size, e.g. this maxsize value at offset 0x29--0x2E:

    00000000  53 4f 4c 56 00 00 00 08  00 00 00 01 00 00 00 00  |SOLV............|
    00000010  00 00 00 00 00 00 00 00  00 00 00 01 00 00 00 01  |................|
    00000020  00 00 00 00 00 00 00 00  00 8f ff ff bf 77 86 8d  |.............w..|
    00000030  20 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  | ...............|
    00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    *
    00002030  00                                                |.|
    00002031

read_id() function will decode and return 4294959095 value, and a subsequent
assignment:

    int maxsize;
    [...]
    maxsize = read_id(&data, 0);

will experience an integer overflow on plaforms where signed int has 4-byte
size (e.g. x86_64).

The same flaw is possible at the next line:

    allsize = read_id(&data, 0);

Subsequent arithmetics will interpreter the value as a very large negative
number, possibly doing wrong decisions:

    maxsize += 5; /* so we can read the next schema of an array */
    if (maxsize > allsize)
      maxsize = allsize;

and finally, the negative value passed to solv_calloc():

    buf = solv_calloc(maxsize + DATA_READ_CHUNK + 4, 1);  /* 4 extra bytes to detect overflows */

will be coerced to an unsigned type (size_t) leading to allocating a smaller
buffer then intended. Then writing to the small buffer will experience a heap
buffer overflow:

    l = maxsize;
    if (l < DATA_READ_CHUNK)
      l = DATA_READ_CHUNK;
    if (l > allsize)
      l = allsize;
    if (!l || fread(buf, l, 1, data.fp) != 1)

This flaw can be demostrated by passing that solv file to the dumpsolv tool which
will crash if compiled with ASAN:

    $ /tmp/b/tools/dumpsolv /tmp/vuln_1_101_1_negative_maxsize.solv
    =================================================================
    ==17608==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7c0a2ede00b1 at pc 0x7fea30451468 b
    p 0x7ffe07220a50 sp 0x7ffe07220220
    WRITE of size 8192 at 0x7c0a2ede00b1 thread T0
#0 0x7fea30451467 in fread.part.0 (/lib64/libasan.so.8+0x51467) (BuildId: 80bfc4ae44fdec6ef5fecfb01
    e2b57d28660991c)
#1 0x7fea3028eef1 in repo_add_solv /home/test/libsolv/src/repo_solv.c:1034
#2 0x0000004041cc in main /home/test/libsolv/tools/dumpsolv.c:471
#3 0x7fea3003c680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: c04494d63bca865bedf571a4075ef8867ccf9fa9)
#4 0x7fea3003c797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: c04494d63bca865bedf571a4075ef8867ccf9fa9)
#5 0x000000400694 in _start (/tmp/b/tools/dumpsolv+0x400694) (BuildId: 0a70b5b14e5cd81f90a309bb2ff3219dfbf30bb8)

    0x7c0a2ede00b1 is located 0 bytes after 1-byte region [0x7c0a2ede00b0,0x7c0a2ede00b1)
    allocated by thread T0 here:
#0 0x7fea304ef41f in malloc (/lib64/libasan.so.8+0xef41f) (BuildId: 80bfc4ae44fdec6ef5fecfb01e2b57d28660991c)
#1 0x7fea302e4b4c in solv_calloc /home/test/libsolv/src/util.c:77
#2 0x7fea3028ee38 in repo_add_solv /home/test/libsolv/src/repo_solv.c:1025
#3 0x0000004041cc in main /home/test/libsolv/tools/dumpsolv.c:471
#4 0x7fea3003c680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: c04494d63bca865bedf571a4075ef8867ccf9fa9)
#5 0x7fea3003c797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: c04494d63bca865bedf571a4075ef8867ccf9fa9)
#6 0x000000400694 in _start (/tmp/b/tools/dumpsolv+0x400694) (BuildId: 0a70b5b14e5cd81f90a309bb2ff3219dfbf30bb8)

    SUMMARY: AddressSanitizer: heap-buffer-overflow /home/test/libsolv/src/repo_solv.c:1034 in repo_add_solv

This patch catches the integer overflow, sets an error and jumps to the end of
the function just after deallocation of the buffer (which would contain an
undefined pointer). This patch also handles a possible integer overflow at
"maxsize += 5" line.

I originally wanted to replace read_id() with read_u32(), but
complemtary repowriter_write() function also stored the value as
a signed integer, so I guess the the Id type is inteded there.

There are probably other ways how to fix it, like passing INT_MAX-5
limit to read_id(), though the error message would be less
understandable.

It's also possible to reject this patch with an explanation that loading
untrusted solv files is not supported. Though some kind of
fortification would be welcomed by people who debug solver problems
from reported solv files.

Reported by Aisle Research.

5 days agoAdd changes, bump version to 0.7.37 0.7.37
Michael Schroeder [Thu, 23 Apr 2026 09:24:27 +0000 (11:24 +0200)] 
Add changes, bump version to 0.7.37

5 days agoUse size_t in the dircache code
Michael Schroeder [Thu, 23 Apr 2026 09:13:37 +0000 (11:13 +0200)] 
Use size_t in the dircache code

This does not make a difference for our uses, but it's the right
thing to do.

6 days agorepo_deb: improve checksum parsing
Michael Schroeder [Wed, 22 Apr 2026 13:17:24 +0000 (15:17 +0200)] 
repo_deb: improve checksum parsing

1) make sure that the string fits into our buffer
2) prefer longer checksums

6 days agoMerge pull request #615 from gruenich/feature/update-github-actions
Michael Schroeder [Wed, 22 Apr 2026 13:03:01 +0000 (15:03 +0200)] 
Merge pull request #615 from gruenich/feature/update-github-actions

[ci] Update GitHub Action checkout from v4 to v6

6 days agoMerge pull request #616 from ppisar/deb_checksum_overflow
Michael Schroeder [Wed, 22 Apr 2026 12:59:25 +0000 (14:59 +0200)] 
Merge pull request #616 from ppisar/deb_checksum_overflow

Fix a buffer overflow when copying SHA-384/512 checksum from a Debian repository

6 days agoFix a buffer overflow when copying SHA-384/512 checksum from a Debian repository 616/head
Petr Písař [Wed, 22 Apr 2026 07:18:29 +0000 (09:18 +0200)] 
Fix a buffer overflow when copying SHA-384/512 checksum from a Debian repository

When parsing Debian repository, control2solvable() copies a package
checksum string from the repository into a stack-allocated "char
checksum[32 * 2 + 1]" array.

If the repository defined a SHA384 or SHA512 tag, a buffer overflow
occured (as can be seen when compiling libsolv with CFLAGS='-O0 -g
-fsanitize=address') because those tag values are longer:

    $ cat /tmp/Packages
    Package: p
    Version: 1
    Architecture: all
    SHA512: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

    $ /tmp/b/tools/deb2solv -r /tmp/Packages
    =================================================================
    ==3695==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7b685ecf0071 at pc 0x7f6861683722 b
    p 0x7fff37e3e7a0 sp 0x7fff37e3df60
    WRITE of size 129 at 0x7b685ecf0071 thread T0
        #0 0x7f6861683721 in strcpy.part.0 (/lib64/libasan.so.8+0x83721) (BuildId: 80bfc4ae44fdec6ef5fecfb01e2b57d28660991c)
        #1 0x7f6861d7f34d in control2solvable /home/test/libsolv/ext/repo_deb.c:491
        #2 0x7f6861d804ea in repo_add_debpackages /home/test/libsolv/ext/repo_deb.c:622
        #3 0x000000400fd5 in main /home/test/libsolv/tools/deb2solv.c:134
        #4 0x7f686123c680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: c04494d63bca865bedf571a4075ef8867ccf9fa9)
        #5 0x7f686123c797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: c04494d63bca865bedf571a4075ef8867ccf9fa9)
        #6 0x000000400694 in _start (/tmp/b/tools/deb2solv+0x400694) (BuildId: a3350337819a51edd0c75293970d3458b5033bc9)

    Address 0x7b685ecf0071 is located in stack of thread T0 at offset 113 in frame
        #0 0x7f6861d7de2a in control2solvable /home/test/libsolv/ext/repo_deb.c:365

      This frame has 1 object(s):
        [48, 113) 'checksum' (line 371) <== Memory access at offset 113 overflows this variable

This patch fixes it by enlarging the buffer to accomodate the longest
supported digest string.

This flaw was introduced with c8164bfecf2ba8bcf4c24329534d3104f19da73c
commit ("[ABI BREAKAGE] add support for SHA224/384/512").

Reported by Aisle Research.

8 days agoMerge pull request #614 from pvi-github/fix/mdk-recommends-offset
Michael Schroeder [Mon, 20 Apr 2026 08:55:59 +0000 (10:55 +0200)] 
Merge pull request #614 from pvi-github/fix/mdk-recommends-offset

repo_mdk: fix @recommends@ tag offset

9 days ago[ci] Update GitHub Action checkout from v4 to v6 615/head
Christoph Grüninger [Sun, 19 Apr 2026 05:38:59 +0000 (07:38 +0200)] 
[ci] Update GitHub Action checkout from v4 to v6

Fix deprecation warning that Node20.js will stop working
in June.

9 days agorepo_mdk: fix @recommends@ tag offset 614/head
Maat [Sat, 18 Apr 2026 16:58:06 +0000 (18:58 +0200)] 
repo_mdk: fix @recommends@ tag offset

Fix the offset to buf + 12 to match the tag length, aligning with every other branch in the dispatcher.

2 weeks agoSmall dirpool speedups
Michael Schroeder [Thu, 9 Apr 2026 15:08:41 +0000 (17:08 +0200)] 
Small dirpool speedups

Make dirpool_resize_hash faster and do not create the
dirtraverse helper in dirpool_add_dir

2 weeks agoMerge pull request #611 from aruiz/wip/hashdirpool
Michael Schroeder [Thu, 9 Apr 2026 14:27:31 +0000 (16:27 +0200)] 
Merge pull request #611 from aruiz/wip/hashdirpool

Add hash table to dirpool for O(1) directory lookup (reduces repo2solv time by half on filelist.xml)

2 weeks agoImprove repo_rpmmd.c a bit
Michael Schroeder [Thu, 9 Apr 2026 10:12:14 +0000 (12:12 +0200)] 
Improve repo_rpmmd.c a bit

Reuse the sizes of the epoch/version/release when building the evr.

2 weeks agoRefactor solv_xmlparser.c a bit
Michael Schroeder [Thu, 9 Apr 2026 09:53:46 +0000 (11:53 +0200)] 
Refactor solv_xmlparser.c a bit

Add hash_state_name() helper function, improve readability of
element hash lookup.

2 weeks agoMerge pull request #610 from aruiz/master
Michael Schroeder [Thu, 9 Apr 2026 09:29:57 +0000 (11:29 +0200)] 
Merge pull request #610 from aruiz/master

Optimize XML parsing: hash-based element lookup and makeevr memcpy

4 weeks agoExtract makeevr helper from makeevr_atts with memcpy optimization 610/head
Alberto Ruiz [Wed, 18 Mar 2026 03:54:01 +0000 (03:54 +0000)] 
Extract makeevr helper from makeevr_atts with memcpy optimization

Split makeevr_atts into a parsing wrapper and a makeevr helper that
takes pre-parsed epoch/ver/rel strings. The helper uses memcpy with
precomputed lengths instead of strcpy+strlen, avoiding redundant
string walks when building the EVR string. This also enables callers
that already have the parsed components to skip the attribute scan.

4 weeks agoUse hash table for XML element name lookup in solv_xmlparser
Alberto Ruiz [Wed, 18 Mar 2026 03:53:57 +0000 (03:53 +0000)] 
Use hash table for XML element name lookup in solv_xmlparser

Replace the per-state linked list traversal with an open-addressing
hash table keyed on (fromstate, element_name). The old approach did
a linear scan with strcmp over all valid elements for the current
state on every XML start tag, which for STATE_SOLVABLE meant ~40
strcmp calls per tag. The hash table reduces this to typically one
hash probe plus one strcmp for confirmation.

5 weeks agoAdd hash table to dirpool for O(1) directory lookup 611/head
Alberto Ruiz [Wed, 18 Mar 2026 07:23:09 +0000 (07:23 +0000)] 
Add hash table to dirpool for O(1) directory lookup

Profiling repo2solv with perf on a full primary+filelists workload
(Fedora 42, ~75K packages) revealed that dirpool_add_dir consumed
48.6% of all cycles and caused 92% of last-level cache misses.

The root cause: directories sharing a parent are stored across
multiple non-contiguous blocks in the dirs[] array, linked through
the dirtraverse[] auxiliary array. Looking up whether a (parent,
component) pair already exists required scanning every block for
that parent -- O(B*C) where B is the number of blocks and C the
average block size. Popular parents like /usr accumulate hundreds
of blocks from filelists data, causing cache-hostile pointer chasing
across scattered memory.

Replace the dirtraverse-based lookup with an open-addressed hash
table mapping (parent, comp) pairs to directory ids. The hash is
computed via relhash() (same scheme used for reldeps), and parent
is verified by a short backward walk to the block header -- always
within a few entries of the matched slot, so it stays in the same
cache line.

The hash table is built on demand and resized at 50% load factor.
The dirtraverse array is kept for dirpool_child/dirpool_sibling
traversal APIs but is no longer needed for the add_dir fast path.

Benchmark results (Fedora 42 metadata, 5 runs, median wall-clock):

  primary + filelists:  10,256 ms  vs  20,028 ms baseline  (49% faster)
  primary only:          2,629 ms  vs   2,546 ms baseline  (within noise)

perf profile after the change shows dirpool_add_dir dropped from
48.6% to 1.78% of cycles. Output is byte-identical to baseline.

6 weeks agoAdd changes, bump version to 0.7.36 0.7.36
Michael Schroeder [Thu, 12 Mar 2026 09:13:53 +0000 (10:13 +0100)] 
Add changes, bump version to 0.7.36

7 weeks agorewrite_suse_dep: always make a copy of the dependency string
Michael Schroeder [Tue, 10 Mar 2026 13:04:07 +0000 (14:04 +0100)] 
rewrite_suse_dep: always make a copy of the dependency string

Unfortunately we cannot call strn2id on a buffer coming from
id2str, as strn2id may reallocate the string space and then the copy
of the string will lead to access of freed memory.

7 weeks agoDo not use isdefault for the groupid default
Michael Schroeder [Mon, 9 Mar 2026 14:55:08 +0000 (15:55 +0100)] 
Do not use isdefault for the groupid default

Hijacking the isdefault variable makes the code hard to understand
and also can lead to the SOLVABLE_ISDEFAULT flag being set on
the environment if the last groupid used the default flag.

So just add a new "groupid_isdefault" flag. We also no longer downgrade
a "Requires" to a "Recommends" if the default attribute is set
in a grouplist entry.

7 weeks agoMerge pull request #607 from pkratoch/comps-optionlist-default
Michael Schroeder [Mon, 9 Mar 2026 14:24:45 +0000 (15:24 +0100)] 
Merge pull request #607 from pkratoch/comps-optionlist-default

Respect the "default" attribute in environment optionlist in comps xml

7 weeks agoAlso directly support language(xx) supplements
Michael Schroeder [Mon, 9 Mar 2026 10:50:39 +0000 (11:50 +0100)] 
Also directly support language(xx) supplements

We also allow to specify multiple languages seperated by ';',
like with the locale() provides rewriting.

7 weeks agoSupport susedep rewriting in boolean deps
Michael Schroeder [Mon, 9 Mar 2026 09:13:14 +0000 (10:13 +0100)] 
Support susedep rewriting in boolean deps

And add a testcase.

7 weeks agoAdd a way to test the suse dep transformation code
Michael Schroeder [Mon, 9 Mar 2026 09:06:47 +0000 (10:06 +0100)] 
Add a way to test the suse dep transformation code

The "genid susedep <keyname>" pops a dep from the genid stack
and rewrites it according to the specified keyname.

7 weeks agorepoinfo_download.c: fix trailing slash test
Michael Schroeder [Tue, 3 Feb 2026 12:15:40 +0000 (13:15 +0100)] 
repoinfo_download.c: fix trailing slash test

7 weeks agoMerge pull request #609 from kontura/map-and-out-of-bounds
Michael Schroeder [Fri, 6 Mar 2026 08:35:02 +0000 (09:35 +0100)] 
Merge pull request #609 from kontura/map-and-out-of-bounds

map_and: fix writing outside of target map memory

7 weeks agomap_and: fix writing outside of target map memory 609/head
Aleš Matěj [Fri, 6 Mar 2026 08:25:17 +0000 (09:25 +0100)] 
map_and: fix writing outside of target map memory

`ti` already points somewhere in the target, depending on the source
size, adding full `t->size` goes out of bounds.

2 months agoRespect the "default" attribute in environment optionlist in comps xml 607/head
Pavla Kratochvilova [Wed, 18 Feb 2026 10:59:53 +0000 (11:59 +0100)] 
Respect the "default" attribute in environment optionlist in comps xml

Add the default groups in optionlist with the "recommends" dependency
instead of "suggests" to differentiate between them.

The "reqtype" attribute of the "parsedata" structure cannot be used
directly, because it wouldn't be clear whether to use the "suggests" or
"requires" dependency for non-default groups, since the information was
already processed in the parent element and is not available at the time
of processing the individual "groupid" elements other than through the
"reqtype" attribute. Therefore, the "isdefault" attribute is used for
this.

Related: http://bugzilla.redhat.com/show_bug.cgi?id=2437049

2 months agoMerge pull request #603 from cmeerw/funopen-seekfn-arg-type
Michael Schroeder [Tue, 3 Feb 2026 14:27:31 +0000 (15:27 +0100)] 
Merge pull request #603 from cmeerw/funopen-seekfn-arg-type

Remove superfluous cast of NULL pointer

2 months agoMove getopt.h include into win32/unistd.h
Michael Schroeder [Tue, 3 Feb 2026 12:12:12 +0000 (13:12 +0100)] 
Move getopt.h include into win32/unistd.h

Fixes issue #605

2 months agodetect_dbpath: also check for /usr/lib/sysimage/rpm
Michael Schroeder [Tue, 3 Feb 2026 12:06:29 +0000 (13:06 +0100)] 
detect_dbpath: also check for /usr/lib/sysimage/rpm

Because it's the right location nowadays. (Should not matter
much, as %_dbpath should be set in most cases.)

2 months agoMake doshowproof a bit more readable
Michael Schroeder [Tue, 19 Aug 2025 15:31:01 +0000 (17:31 +0200)] 
Make doshowproof a bit more readable

2 months agoAdd note about asking the solver for a proof
Michael Schroeder [Tue, 19 Aug 2025 15:11:11 +0000 (17:11 +0200)] 
Add note about asking the solver for a proof

No functual changes

2 months agoFix indent
Michael Schroeder [Tue, 19 Aug 2025 15:10:52 +0000 (17:10 +0200)] 
Fix indent

No functual changes

2 months agomap_and: fix different size case
Michael Schroeder [Tue, 19 Aug 2025 14:55:13 +0000 (16:55 +0200)] 
map_and: fix different size case

Clear the remaining target bits if the source is smaller than the
target.

3 months agoMerge pull request #604 from evan-goode/evan-goode/test-color-filtering-update-targets
Michael Schroeder [Wed, 21 Jan 2026 10:31:32 +0000 (11:31 +0100)] 
Merge pull request #604 from evan-goode/evan-goode/test-color-filtering-update-targets

Add testcase for color filtering when adding update targets

3 months agoAdd testcase for color filtering when adding update targets 604/head
Evan Goode [Tue, 20 Jan 2026 19:11:40 +0000 (14:11 -0500)] 
Add testcase for color filtering when adding update targets

Related: https://github.com/openSUSE/libsolv/issues/583

4 months agoRemove superfluous cast of NULL pointer 603/head
Christof Meerwald [Thu, 18 Dec 2025 18:54:20 +0000 (18:54 +0000)] 
Remove superfluous cast of NULL pointer

4 months agoMerge pull request #601 from arrowd/master
Michael Schroeder [Wed, 10 Dec 2025 14:10:27 +0000 (15:10 +0100)] 
Merge pull request #601 from arrowd/master

Add support for the Elbrus2000 (e2k) architecture

4 months agoAdd support for the Elbrus2000 (e2k) architecture 601/head
Gleb Popov [Tue, 9 Dec 2025 16:31:59 +0000 (19:31 +0300)] 
Add support for the Elbrus2000 (e2k) architecture

4 months agoruntestcases.sh: Use portable shebang
Gleb Popov [Tue, 9 Dec 2025 16:26:21 +0000 (19:26 +0300)] 
runtestcases.sh: Use portable shebang

6 months agoMerge pull request #600 from goodspeed34/qsort_r_fix
Michael Schroeder [Wed, 22 Oct 2025 11:10:55 +0000 (13:10 +0200)] 
Merge pull request #600 from goodspeed34/qsort_r_fix

Fix qsort_r preprocessor for musl and FreeBSD

6 months agoFix qsort_r preprocessor for musl and FreeBSD 600/head
Gong Zhile [Wed, 22 Oct 2025 10:14:30 +0000 (18:14 +0800)] 
Fix qsort_r preprocessor for musl and FreeBSD

The original mentioned qsort_r signature difference now only exists in DragonFly
BSD & MacOS. However, the preprocessor also broke the compliation on musl+linux
and FreeBSD, leading the compilation error on buildroot.

musl: https://git.musl-libc.org/cgit/musl/commit/?id=b76f37fd5625d038141b52184956fb4b7838e9a5
freebsd, dragonfly, macos: QSORT(3)

FreeBSD and musl use the same GNU-like signature.

Signed-off-by: Gong Zhile <gongzl.oerv@isrc.iscas.ac.cn>
8 months agotarhead: add a line size limit to catch broken entries
Michael Schroeder [Tue, 5 Aug 2025 10:03:15 +0000 (12:03 +0200)] 
tarhead: add a line size limit to catch broken entries

Also write back the allocated line length.

8 months agorepo_apk: move entry size limit to the top of the file
Michael Schroeder [Tue, 5 Aug 2025 09:59:35 +0000 (11:59 +0200)] 
repo_apk: move entry size limit to the top of the file

8 months agorepo_arch: limit the package entry size
Michael Schroeder [Tue, 5 Aug 2025 09:57:14 +0000 (11:57 +0200)] 
repo_arch: limit the package entry size

8 months agorepo_apkv3: move arbitrary limits to the top of the file
Michael Schroeder [Tue, 5 Aug 2025 09:24:16 +0000 (11:24 +0200)] 
repo_apkv3: move arbitrary limits to the top of the file

8 months agorepo_apkv3: improve blob length check
Michael Schroeder [Tue, 5 Aug 2025 09:14:27 +0000 (11:14 +0200)] 
repo_apkv3: improve blob length check

8 months agoAdd changes, bump version to 0.7.35 0.7.35
Michael Schroeder [Mon, 4 Aug 2025 09:14:31 +0000 (11:14 +0200)] 
Add changes, bump version to 0.7.35

8 months agoRename pool_dep_fulfilled_in_map to pool_satisfieddep_map
Michael Schroeder [Fri, 1 Aug 2025 13:35:01 +0000 (15:35 +0200)] 
Rename pool_dep_fulfilled_in_map to pool_satisfieddep_map

This is more similar to the other functions we already have.

8 months agoMove pool_dep_fulfilled_in_map into pooldep.c
Michael Schroeder [Wed, 30 Jul 2025 10:40:59 +0000 (12:40 +0200)] 
Move pool_dep_fulfilled_in_map into pooldep.c

8 months agoMerge pull request #596 from m-blaha/doc-solver-flag-strong-recommends
Michael Schroeder [Wed, 30 Jul 2025 07:49:26 +0000 (09:49 +0200)] 
Merge pull request #596 from m-blaha/doc-solver-flag-strong-recommends

Document SOLVER_FLAG_STRONG_RECOMMENDS flag

8 months agoMerge pull request #592 from kontura/dep_fulfilled
Michael Schroeder [Wed, 30 Jul 2025 07:45:48 +0000 (09:45 +0200)] 
Merge pull request #592 from kontura/dep_fulfilled

Add pool_dep_fulfilled_in_map function

8 months agoSplit off pool_init_rels from pool_create and moveit to poolid.c
Michael Schroeder [Tue, 29 Jul 2025 13:48:33 +0000 (15:48 +0200)] 
Split off pool_init_rels from pool_create and moveit to poolid.c

This allows us to remove the REL_BLOCK definition from
poolid_private.h.

8 months agoSplit grow_whatprovides_rel from pool_rel2id
Michael Schroeder [Tue, 29 Jul 2025 13:34:59 +0000 (15:34 +0200)] 
Split grow_whatprovides_rel from pool_rel2id

8 months agoMove dependency matching from pool.c to pooldep.c
Michael Schroeder [Tue, 29 Jul 2025 13:34:09 +0000 (15:34 +0200)] 
Move dependency matching from pool.c to pooldep.c

8 months agoDocument SOLVER_FLAG_STRONG_RECOMMENDS flag 596/head
Marek Blaha [Tue, 29 Jul 2025 12:37:49 +0000 (14:37 +0200)] 
Document SOLVER_FLAG_STRONG_RECOMMENDS flag

8 months agoAdd comments to explain the whatprovidesaux a bit
Michael Schroeder [Tue, 29 Jul 2025 11:21:34 +0000 (13:21 +0200)] 
Add comments to explain the whatprovidesaux a bit

8 months agoDo not inline pool_is_kind
Michael Schroeder [Tue, 29 Jul 2025 10:04:58 +0000 (12:04 +0200)] 
Do not inline pool_is_kind

8 months agoMove whatprovides handling from pool.c to poolwhatprovides.c
Michael Schroeder [Tue, 29 Jul 2025 09:52:42 +0000 (11:52 +0200)] 
Move whatprovides handling from pool.c to poolwhatprovides.c

8 months agoFix potential access of freed mem in the genid testcase
Michael Schroeder [Tue, 29 Jul 2025 08:02:04 +0000 (10:02 +0200)] 
Fix potential access of freed mem in the genid testcase

9 months agosolver_addbestrules: recalculate pointer to current rule after adding a new rule
Michael Schroeder [Fri, 25 Jul 2025 09:08:59 +0000 (11:08 +0200)] 
solver_addbestrules: recalculate pointer to current rule after adding a new rule

The code adds new rules in a FOR_RULELITERALS loop. The iterator needs
to access elements of the rule it iterates over, so if we add a new
rule in the loop body, we have to make sure that the pointer to the
current rule stays valid.

Fixes issue #594

9 months agoMerge pull request #593 from Redbeanw44602/master
Michael Schroeder [Thu, 24 Jul 2025 13:04:47 +0000 (15:04 +0200)] 
Merge pull request #593 from Redbeanw44602/master

Fix build on win32 & mingw.

9 months agofix compile on mingw-w64. 593/head
Redbeanw44602 [Thu, 24 Jul 2025 05:43:26 +0000 (13:43 +0800)] 
fix compile on mingw-w64.

9 months agofix msvc c2036.
Redbeanw44602 [Thu, 24 Jul 2025 05:42:07 +0000 (13:42 +0800)] 
fix msvc c2036.

9 months agoAdd changes, bump version to 0.7.34 0.7.34
Michael Schroeder [Mon, 7 Jul 2025 11:51:03 +0000 (13:51 +0200)] 
Add changes, bump version to 0.7.34

9 months agorepo_autopattern: support creation of obsoletes for product packages
Michael Schroeder [Mon, 7 Jul 2025 11:27:04 +0000 (13:27 +0200)] 
repo_autopattern: support creation of obsoletes for product packages

This adds support for provides of the type "product-obsoletes(name)".
We translate this to "Obsoletes: product:<name>" in the generated
product pseudo package.

We need this because people used "Obsoletes: product:name" in the
"release" package, but this is no longer allowed in newer rpm versions.
Besides, the obsoletes is kind of wrong in the "release" package
anyway, it belongs in the generated "product:" package.

9 months agoAdd pool_dep_fulfilled_in_map function 592/head
Aleš Matěj [Tue, 1 Jul 2025 12:25:38 +0000 (14:25 +0200)] 
Add pool_dep_fulfilled_in_map function

This is can be used to determine dependency closure on a given set of
packages (even with complex dependencies).

10 months agoMerge pull request #591 from AntoinePrv/missing-headers
Michael Schroeder [Wed, 4 Jun 2025 15:13:53 +0000 (17:13 +0200)] 
Merge pull request #591 from AntoinePrv/missing-headers

Fix Unix header on Windows

10 months agoFix Unix header on Windows 591/head
AntoinePrv [Wed, 4 Jun 2025 12:55:53 +0000 (14:55 +0200)] 
Fix Unix header on Windows

10 months agoAdd changes, bump version to 0.7.33 0.7.33
Michael Schroeder [Tue, 3 Jun 2025 11:40:58 +0000 (13:40 +0200)] 
Add changes, bump version to 0.7.33

10 months agoSupport orderwithrequires dependencies in susedata.xml
Michael Schroeder [Tue, 3 Jun 2025 11:20:20 +0000 (13:20 +0200)] 
Support orderwithrequires dependencies in susedata.xml

10 months agorepo parsers: use strtoull instead of atoi to parse the time
Michael Schroeder [Tue, 3 Jun 2025 09:47:54 +0000 (11:47 +0200)] 
repo parsers: use strtoull instead of atoi to parse the time

10 months agoTransaction ordering: Allow more uninst->uninst edges
Michael Schroeder [Mon, 2 Jun 2025 09:30:59 +0000 (11:30 +0200)] 
Transaction ordering: Allow more uninst->uninst edges

Only skip uninst->uninst edges if both elements are build to
inst elements.

11 months agoMerge pull request #590 from gruenich/feature/cppcheck-warnings
Michael Schroeder [Fri, 16 May 2025 08:19:15 +0000 (10:19 +0200)] 
Merge pull request #590 from gruenich/feature/cppcheck-warnings

Simlify some if conditions to fix Cppcheck warnings

11 months agopool.c: Remove identical if condition 590/head
Christoph Grüninger [Wed, 14 May 2025 19:31:56 +0000 (21:31 +0200)] 
pool.c: Remove identical if condition

It is always true.
Found by Cppcheck (identicalInnerCondition).

11 months agoorder.c: Combine if's with identical conditions
Christoph Grüninger [Wed, 14 May 2025 19:24:05 +0000 (21:24 +0200)] 
order.c: Combine if's with identical conditions

Found by Cppcheck (duplicateCondition).

11 months agorules.c: Simplify if condition
Christoph Grüninger [Wed, 14 May 2025 19:21:31 +0000 (21:21 +0200)] 
rules.c: Simplify if condition

rid <=0 is checked two lines before.
Found by Cppcheck (knownConditionTrueFalse).

11 months agodecision.c: Simplify else condition
Christoph Grüninger [Wed, 14 May 2025 19:16:19 +0000 (21:16 +0200)] 
decision.c: Simplify else condition

Found by Cppcheck: "Expression is always true because
'else if' condition is opposite to previous condition
at line 608." (multiCondition)

11 months agoMerge pull request #589 from gruenich/feature/implicit-function-declaration
Michael Schroeder [Wed, 14 May 2025 12:06:52 +0000 (14:06 +0200)] 
Merge pull request #589 from gruenich/feature/implicit-function-declaration

Add includes for getopt() and strcasecmp()

11 months agoMerge pull request #588 from gruenich/feature/decision-return-void
Michael Schroeder [Wed, 14 May 2025 12:06:11 +0000 (14:06 +0200)] 
Merge pull request #588 from gruenich/feature/decision-return-void

decision.c: void function should not return anything

11 months agoAdd includes for getopt() and strcasecmp() 589/head
Christoph Grüninger [Tue, 13 May 2025 17:34:04 +0000 (19:34 +0200)] 
Add includes for getopt() and strcasecmp()

Found by GCC in C23 mode (implicit-function-declaration).

11 months agodecision.c: void function should not return anything 588/head
Christoph Grüninger [Tue, 13 May 2025 17:11:35 +0000 (19:11 +0200)] 
decision.c: void function should not return anything

Do not call to solver_get_proof as part of return statement

Found by GCC ("ISO C forbids ‘return’ with expression, in
function returning void", pedantic).

12 months agoAdd apk2solv man page
Michael Schroeder [Tue, 15 Apr 2025 11:11:30 +0000 (13:11 +0200)] 
Add apk2solv man page

12 months agoAdd regression test for last commit
Michael Schroeder [Tue, 15 Apr 2025 10:52:47 +0000 (12:52 +0200)] 
Add regression test for last commit

12 months agoMerge pull request #584 from AntoinePrv/missing-headers
Michael Schroeder [Mon, 14 Apr 2025 13:18:14 +0000 (15:18 +0200)] 
Merge pull request #584 from AntoinePrv/missing-headers

Add missing headers

12 months agoadd missing headers 584/head
AntoinePrv [Mon, 14 Apr 2025 12:15:53 +0000 (14:15 +0200)] 
add missing headers

12 months agoImplement color filtering when adding update targets
Michael Schroeder [Mon, 14 Apr 2025 12:14:59 +0000 (14:14 +0200)] 
Implement color filtering when adding update targets

The old code created update jobs spanning multiple architectures
even if "implicitobsoleteusescolors" was set.
Also add color filtering in replaces_installed_package, where it
seems to be also missing

Fixes issue #583.

12 months agorpms2solv: add -i option to include the pkgid
Michael Schroeder [Thu, 10 Apr 2025 13:43:09 +0000 (15:43 +0200)] 
rpms2solv: add -i option to include the pkgid

12 months agoUse the truncated sha256 sigtag if there is no header+payload md5
Michael Schroeder [Thu, 10 Apr 2025 13:40:59 +0000 (15:40 +0200)] 
Use the truncated sha256 sigtag if there is no header+payload md5

Rpmv6 will no longer have a header+payload digest.

12 months agoAdd changes, bump version to 0.7.32 0.7.32
Michael Schroeder [Thu, 3 Apr 2025 11:10:26 +0000 (13:10 +0200)] 
Add changes, bump version to 0.7.32

12 months agoAdd dataiterator_final_{solvable,repo} functions
Michael Schroeder [Thu, 3 Apr 2025 11:05:54 +0000 (13:05 +0200)] 
Add dataiterator_final_{solvable,repo} functions

Those are needed by libzypp. They tell the dataiterator that it
should stay in the solvable/repository.

12 months agoMerge pull request #578 from bmwiedemann/yastruby
Michael Schroeder [Thu, 3 Apr 2025 09:36:00 +0000 (11:36 +0200)] 
Merge pull request #578 from bmwiedemann/yastruby

Provide a symbol specific for the ruby-version