<feed xmlns='http://www.w3.org/2005/Atom'>
<title>samba.git/lib/util/util_file.c, branch talloc-2.3.0</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>lib: Optimize file_compare</title>
<updated>2019-07-17T12:45:51+00:00</updated>
<author>
<name>Volker Lendecke</name>
<email>vl@samba.org</email>
</author>
<published>2019-05-01T13:34:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=69cca061a4e176c3d23f5f0771893011adafc940'/>
<id>69cca061a4e176c3d23f5f0771893011adafc940</id>
<content type='text'>
Triggered by two coverity false positives. Loading both files into
talloc'ed memory seems inefficient to me. Rely on stdio to do proper
buffering. This removes the restriction from ae95d611: "It is meant for
small files".

This is more lines, but to me it has less implicit complexity.

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Uri Simchoni &lt;uri@samba.org&gt;

Autobuild-User(master): Uri Simchoni &lt;uri@samba.org&gt;
Autobuild-Date(master): Wed Jul 17 12:45:51 UTC 2019 on sn-devel-184
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Triggered by two coverity false positives. Loading both files into
talloc'ed memory seems inefficient to me. Rely on stdio to do proper
buffering. This removes the restriction from ae95d611: "It is meant for
small files".

This is more lines, but to me it has less implicit complexity.

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Uri Simchoni &lt;uri@samba.org&gt;

Autobuild-User(master): Uri Simchoni &lt;uri@samba.org&gt;
Autobuild-Date(master): Wed Jul 17 12:45:51 UTC 2019 on sn-devel-184
</pre>
</div>
</content>
</entry>
<entry>
<title>util: Fix signed/unsigned comparisons by casting</title>
<updated>2019-07-01T08:00:29+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>martin@meltin.net</email>
</author>
<published>2019-06-21T05:11:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=043334f2eb67ec82c3c6b757fef5eb986d58ad25'/>
<id>043334f2eb67ec82c3c6b757fef5eb986d58ad25</id>
<content type='text'>
One case needs a variable declared, so it can be compared to -1 and
then cast to size_t for comparison.

Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;

Autobuild-User(master): Andreas Schneider &lt;asn@cryptomilk.org&gt;
Autobuild-Date(master): Mon Jul  1 08:00:29 UTC 2019 on sn-devel-184
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
One case needs a variable declared, so it can be compared to -1 and
then cast to size_t for comparison.

Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;

Autobuild-User(master): Andreas Schneider &lt;asn@cryptomilk.org&gt;
Autobuild-Date(master): Mon Jul  1 08:00:29 UTC 2019 on sn-devel-184
</pre>
</div>
</content>
</entry>
<entry>
<title>util: Fix signed/unsigned comparisons by declaring as size_t</title>
<updated>2019-07-01T06:44:13+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>martin@meltin.net</email>
</author>
<published>2019-06-21T05:10:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=abea597b7fc5c221205143d537cf5fb009a234bf'/>
<id>abea597b7fc5c221205143d537cf5fb009a234bf</id>
<content type='text'>
Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib: util: Remove file_pload()</title>
<updated>2019-05-24T19:00:05+00:00</updated>
<author>
<name>Jeremy Allison</name>
<email>jra@samba.org</email>
</author>
<published>2019-05-18T18:14:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=c5729ae44219ec81008040d4d50f0f5fdf254201'/>
<id>c5729ae44219ec81008040d4d50f0f5fdf254201</id>
<content type='text'>
No longer used.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13964

Signed-off-by: Jeremy Allison &lt;jra@samba.org&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No longer used.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13964

Signed-off-by: Jeremy Allison &lt;jra@samba.org&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib: util: Add file_ploadv().</title>
<updated>2019-05-24T19:00:05+00:00</updated>
<author>
<name>Jeremy Allison</name>
<email>jra@samba.org</email>
</author>
<published>2019-05-17T04:56:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=5c34fa0b85e4d9a3c5fd4fa0b39af4772ec023db'/>
<id>5c34fa0b85e4d9a3c5fd4fa0b39af4772ec023db</id>
<content type='text'>
Not yet used.

Duplicate code to file_pload() except uses vectored
argument list. file_pload() will be removed once all
callers are converted.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13964

Signed-off-by: Jeremy Allison &lt;jra@samba.org&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Not yet used.

Duplicate code to file_pload() except uses vectored
argument list. file_pload() will be removed once all
callers are converted.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13964

Signed-off-by: Jeremy Allison &lt;jra@samba.org&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib: Make fd_load work for non-regular files</title>
<updated>2019-03-26T04:43:40+00:00</updated>
<author>
<name>Volker Lendecke</name>
<email>vl@samba.org</email>
</author>
<published>2019-02-21T17:37:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=ac487bf4d04c9771ada1ca7eeb9dac4e5fe34185'/>
<id>ac487bf4d04c9771ada1ca7eeb9dac4e5fe34185</id>
<content type='text'>
Follow-up to

https://lists.samba.org/archive/samba/2018-September/217992.html

and following. This also fixes a small and very theoretical race: Between the
fstat and the read call the file size might change. This would make us fail on
potentially legitimate files.

This is more complex and probably slower, but looking at the use cases I don't
think the speed matters.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13859

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;

Autobuild-User(master): Andrew Bartlett &lt;abartlet@samba.org&gt;
Autobuild-Date(master): Tue Mar 26 04:43:40 UTC 2019 on sn-devel-144
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow-up to

https://lists.samba.org/archive/samba/2018-September/217992.html

and following. This also fixes a small and very theoretical race: Between the
fstat and the read call the file size might change. This would make us fail on
potentially legitimate files.

This is more complex and probably slower, but looking at the use cases I don't
think the speed matters.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13859

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;

Autobuild-User(master): Andrew Bartlett &lt;abartlet@samba.org&gt;
Autobuild-Date(master): Tue Mar 26 04:43:40 UTC 2019 on sn-devel-144
</pre>
</div>
</content>
</entry>
<entry>
<title>s3:util: Move static file_pload() function to lib/util</title>
<updated>2019-02-11T06:43:31+00:00</updated>
<author>
<name>Aliaksei Karaliou</name>
<email>akaraliou@panasas.com</email>
</author>
<published>2018-12-27T09:25:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=d21fc7d8b86b0cddc619ffe528d9cd93eeedbb0b'/>
<id>d21fc7d8b86b0cddc619ffe528d9cd93eeedbb0b</id>
<content type='text'>
file_pload() is static private function in Samba3 library, however it
does not have any special dependencies and might be widely used as
common function, so moving it into common samba-util library.

Signed-off-by: Aliaksei Karaliou &lt;akaraliou@panasas.com&gt;
Reviewed-by: Garming Sam &lt;garming@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>
file_pload() is static private function in Samba3 library, however it
does not have any special dependencies and might be widely used as
common function, so moving it into common samba-util library.

Signed-off-by: Aliaksei Karaliou &lt;akaraliou@panasas.com&gt;
Reviewed-by: Garming Sam &lt;garming@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/util: Count a trailing line that doesn't end in a newline</title>
<updated>2018-12-19T07:08:28+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>martin@meltin.net</email>
</author>
<published>2018-12-14T03:43:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=5118985841aa0363147d552f243ab5a7d90dbdaf'/>
<id>5118985841aa0363147d552f243ab5a7d90dbdaf</id>
<content type='text'>
If the final line of a file does not contain a newline then it isn't
included in the line count.

Change i to point to the next slot in the array instead of the current
one.  This means that that the current line won't be thrown away if no
newline is seen.

Without changing i to unsigned int, the -O3 --picky -developer build
fails with:

[ 745/4136] Compiling lib/util/util_file.c

==&gt; /builds/samba-team/devel/samba/samba-o3.stderr &lt;==
../../lib/util/util_file.c: In function ‘file_lines_parse’:
../../lib/util/util_file.c:251:8: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
  while (i &gt; 0 &amp;&amp; ret[i-1][0] == 0) {
        ^
cc1: all warnings being treated as errors

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13717

Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;

Autobuild-User(master): Andrew Bartlett &lt;abartlet@samba.org&gt;
Autobuild-Date(master): Wed Dec 19 08:08:28 CET 2018 on sn-devel-144
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the final line of a file does not contain a newline then it isn't
included in the line count.

Change i to point to the next slot in the array instead of the current
one.  This means that that the current line won't be thrown away if no
newline is seen.

Without changing i to unsigned int, the -O3 --picky -developer build
fails with:

[ 745/4136] Compiling lib/util/util_file.c

==&gt; /builds/samba-team/devel/samba/samba-o3.stderr &lt;==
../../lib/util/util_file.c: In function ‘file_lines_parse’:
../../lib/util/util_file.c:251:8: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
  while (i &gt; 0 &amp;&amp; ret[i-1][0] == 0) {
        ^
cc1: all warnings being treated as errors

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13717

Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;

Autobuild-User(master): Andrew Bartlett &lt;abartlet@samba.org&gt;
Autobuild-Date(master): Wed Dec 19 08:08:28 CET 2018 on sn-devel-144
</pre>
</div>
</content>
</entry>
<entry>
<title>lib:util: Fix size types in fgets_slash()</title>
<updated>2018-04-03T18:20:10+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2018-03-21T11:49:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=bc3834d6910c71159ee5e6dc3b04475706d9e846'/>
<id>bc3834d6910c71159ee5e6dc3b04475706d9e846</id>
<content type='text'>
This fixes compilation with -Wstrict-overflow=2.

Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes compilation with -Wstrict-overflow=2.

Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib:util: Add FALL_THROUGH statements in util_file.c</title>
<updated>2018-03-01T03:37:41+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2017-07-26T16:41:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=a3fffd970c38e288476643fbea6cfa1943213b8d'/>
<id>a3fffd970c38e288476643fbea6cfa1943213b8d</id>
<content type='text'>
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>
Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
