<feed xmlns='http://www.w3.org/2005/Atom'>
<title>samba.git/lib/compression, branch talloc-2.4.2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/'/>
<entry>
<title>Use python.h from libreplace</title>
<updated>2023-11-20T15:37:33+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2023-11-09T10:35:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=9621a3d7a6949aa833425884cd22379387738cfa'/>
<id>9621a3d7a6949aa833425884cd22379387738cfa</id>
<content type='text'>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15513

Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15513

Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>lib:compression: Correctly fix sign extension of long matches (CID 1517275)</title>
<updated>2023-10-13T02:18:30+00:00</updated>
<author>
<name>Joseph Sutton</name>
<email>josephsutton@catalyst.net.nz</email>
</author>
<published>2023-10-06T02:18:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=03ca8c25d09c1d6bae914c2f64d0c1e96b2b272c'/>
<id>03ca8c25d09c1d6bae914c2f64d0c1e96b2b272c</id>
<content type='text'>
Commit 6b4d94c9877ec59081b9da946c00fa2647cad928 was a previous attempt
to fix this issue.

Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 6b4d94c9877ec59081b9da946c00fa2647cad928 was a previous attempt
to fix this issue.

Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib:compression: Fix building with FORTIFY_SOURCE=2</title>
<updated>2023-10-01T22:45:38+00:00</updated>
<author>
<name>Joseph Sutton</name>
<email>josephsutton@catalyst.net.nz</email>
</author>
<published>2022-12-15T03:04:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=e961783add974c3bc4a0fc89e5db32b3ce39ff55'/>
<id>e961783add974c3bc4a0fc89e5db32b3ce39ff55</id>
<content type='text'>
Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib:compression: Fix code spelling</title>
<updated>2023-09-11T02:42:41+00:00</updated>
<author>
<name>Joseph Sutton</name>
<email>josephsutton@catalyst.net.nz</email>
</author>
<published>2023-09-04T04:43:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=1c35195ff764de7ee011b54b6d3017d61b673583'/>
<id>1c35195ff764de7ee011b54b6d3017d61b673583</id>
<content type='text'>
Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib:compression: Fix code spelling</title>
<updated>2023-04-03T03:56:35+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2023-03-31T09:04:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=3d409c16ee7d00012f954e8e819f0f9d48aedb73'/>
<id>3d409c16ee7d00012f954e8e819f0f9d48aedb73</id>
<content type='text'>
Best reviewed with: `git show --word-diff`.

Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Best reviewed with: `git show --word-diff`.

Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/compression: Fix documentation of lzxpress_huffman_compress()</title>
<updated>2023-03-31T01:48:30+00:00</updated>
<author>
<name>Andrew Bartlett</name>
<email>abartlet@samba.org</email>
</author>
<published>2023-03-28T02:10:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=e37f20fb36a1bda3e121dba5d8042efeb84ed7e3'/>
<id>e37f20fb36a1bda3e121dba5d8042efeb84ed7e3</id>
<content type='text'>
The "inconvenience function" takes one type, and converts it to another
but the documentation was not updated.

Signed-off-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The "inconvenience function" takes one type, and converts it to another
but the documentation was not updated.

Signed-off-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/compression: Add helper function lzxpress_huffman_max_compressed_size()</title>
<updated>2023-03-31T01:48:30+00:00</updated>
<author>
<name>Andrew Bartlett</name>
<email>abartlet@samba.org</email>
</author>
<published>2023-03-28T02:42:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=0ab5552c8c32e7d7196b5a33eaa5533ccac53d0e'/>
<id>0ab5552c8c32e7d7196b5a33eaa5533ccac53d0e</id>
<content type='text'>
This allows the calculation of the worst case to be shared with callers.

Signed-off-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows the calculation of the worst case to be shared with callers.

Signed-off-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/compression: Fix length check</title>
<updated>2023-01-10T20:22:32+00:00</updated>
<author>
<name>Joseph Sutton</name>
<email>josephsutton@catalyst.net.nz</email>
</author>
<published>2023-01-09T02:00:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=ae6e76c082d476c260f156ab1eb2501320b8a65e'/>
<id>ae6e76c082d476c260f156ab1eb2501320b8a65e</id>
<content type='text'>
Put the division on the correct side of the inequality.

Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Put the division on the correct side of the inequality.

Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/compression: add simple python bindings</title>
<updated>2022-12-22T19:50:33+00:00</updated>
<author>
<name>Douglas Bagnall</name>
<email>douglas.bagnall@catalyst.net.nz</email>
</author>
<published>2022-11-25T03:43:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=41249302a389e4e9c2c79a679d033d2331782f5b'/>
<id>41249302a389e4e9c2c79a679d033d2331782f5b</id>
<content type='text'>
There are four functions, allowing compression and decompression in
the two formats we support so far. The functions will accept bytes or
unicode strings which are treated as utf-8.

The LZ77+Huffman decompression algorithm requires an exact target
length to decompress, so this is mandatory.

The plain decompression algorithm does not need an exact length, but
you can provide one to help it know how much space to allocate. As
currently written, you can provide a short length and it will often
succeed in decompressing to a different shorter string.

These bindings are intended to make ad-hoc investigation easier, not
for production use. This is reflected in the guesses about output size
that plain_decompress() makes if you don't supply one -- either they
are stupidly wasteful or ridiculously insufficient, depending on
whether or not you were trying to decompress a 20MB string.

&gt;&gt;&gt; a = '12345678'
&gt;&gt;&gt; import compression
&gt;&gt;&gt; b = compression.huffman_compress(a)
&gt;&gt;&gt; b
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00  #....
&gt;&gt;&gt; len(b)
262
&gt;&gt;&gt; c = compression.huffman_decompress(b, len(a))
&gt;&gt;&gt; c
b'12345678'                                   # note, c is bytes, a is str
&gt;&gt;&gt; a
'12345678'
&gt;&gt;&gt; d = compression.plain_compress(a)
&gt;&gt;&gt; d
b'\xff\xff\xff\x0012345678'
&gt;&gt;&gt; compression.plain_decompress(d)           # no size specified, guesses
b'12345678'
&gt;&gt;&gt; compression.plain_decompress(d,5)
b'12345'
&gt;&gt;&gt; compression.plain_decompress(d,0)         # 0 for auto
b'12345678'
&gt;&gt;&gt; compression.plain_decompress(d,1)
b'1'
&gt;&gt;&gt; compression.plain_decompress(a,444)
Traceback (most recent call last):
   compression.CompressionError: unable to decompress data into a buffer of 444 bytes.
&gt;&gt;&gt; compression.plain_decompress(b,444)
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 #...

That last one decompresses the Huffman compressed file with the plain
compressor; pretty much any string is valid for plain decompression.

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are four functions, allowing compression and decompression in
the two formats we support so far. The functions will accept bytes or
unicode strings which are treated as utf-8.

The LZ77+Huffman decompression algorithm requires an exact target
length to decompress, so this is mandatory.

The plain decompression algorithm does not need an exact length, but
you can provide one to help it know how much space to allocate. As
currently written, you can provide a short length and it will often
succeed in decompressing to a different shorter string.

These bindings are intended to make ad-hoc investigation easier, not
for production use. This is reflected in the guesses about output size
that plain_decompress() makes if you don't supply one -- either they
are stupidly wasteful or ridiculously insufficient, depending on
whether or not you were trying to decompress a 20MB string.

&gt;&gt;&gt; a = '12345678'
&gt;&gt;&gt; import compression
&gt;&gt;&gt; b = compression.huffman_compress(a)
&gt;&gt;&gt; b
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00  #....
&gt;&gt;&gt; len(b)
262
&gt;&gt;&gt; c = compression.huffman_decompress(b, len(a))
&gt;&gt;&gt; c
b'12345678'                                   # note, c is bytes, a is str
&gt;&gt;&gt; a
'12345678'
&gt;&gt;&gt; d = compression.plain_compress(a)
&gt;&gt;&gt; d
b'\xff\xff\xff\x0012345678'
&gt;&gt;&gt; compression.plain_decompress(d)           # no size specified, guesses
b'12345678'
&gt;&gt;&gt; compression.plain_decompress(d,5)
b'12345'
&gt;&gt;&gt; compression.plain_decompress(d,0)         # 0 for auto
b'12345678'
&gt;&gt;&gt; compression.plain_decompress(d,1)
b'1'
&gt;&gt;&gt; compression.plain_decompress(a,444)
Traceback (most recent call last):
   compression.CompressionError: unable to decompress data into a buffer of 444 bytes.
&gt;&gt;&gt; compression.plain_decompress(b,444)
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 #...

That last one decompresses the Huffman compressed file with the plain
compressor; pretty much any string is valid for plain decompression.

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>compression/huffman: debug function bails upon disaster (CID 1517261)</title>
<updated>2022-12-19T23:29:04+00:00</updated>
<author>
<name>Douglas Bagnall</name>
<email>douglas.bagnall@catalyst.net.nz</email>
</author>
<published>2022-12-06T20:27:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=44a44005a6b3222c599d4757d60af924b9cea459'/>
<id>44a44005a6b3222c599d4757d60af924b9cea459</id>
<content type='text'>
We shouldn't get a node with a zero code, and there's probably nothing
to do but stop.

   CID 1517261 (#1-2 of 2): Bad bit shift operation
   (BAD_SHIFT)11. negative_shift: In expression j &gt;&gt; offset - k,
   shifting by a negative amount has undefined behavior. The shift
   amount, offset - k, is -3.

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;

Autobuild-User(master): Jeremy Allison &lt;jra@samba.org&gt;
Autobuild-Date(master): Mon Dec 19 23:29:04 UTC 2022 on sn-devel-184
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We shouldn't get a node with a zero code, and there's probably nothing
to do but stop.

   CID 1517261 (#1-2 of 2): Bad bit shift operation
   (BAD_SHIFT)11. negative_shift: In expression j &gt;&gt; offset - k,
   shifting by a negative amount has undefined behavior. The shift
   amount, offset - k, is -3.

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;

Autobuild-User(master): Jeremy Allison &lt;jra@samba.org&gt;
Autobuild-Date(master): Mon Dec 19 23:29:04 UTC 2022 on sn-devel-184
</pre>
</div>
</content>
</entry>
</feed>
