<feed xmlns='http://www.w3.org/2005/Atom'>
<title>samba.git/source3/registry, branch master</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>s3: talloc_destroy() -&gt; TALLOC_FREE()</title>
<updated>2025-11-10T13:29:30+00:00</updated>
<author>
<name>Volker Lendecke</name>
<email>vl@samba.org</email>
</author>
<published>2025-10-17T12:39:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=38b76366888ab366c6ea13382f93b443cbee1e8e'/>
<id>38b76366888ab366c6ea13382f93b443cbee1e8e</id>
<content type='text'>
Sweeping change, I know. Should not change compiled code in most
cases, the compiler should be smart enough to elide the assignment
right before a return. In the cases where this is not right before the
return, TALLOC_FREE() is safer as it makes use-after-free crash.

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Anoop C S &lt;anoopcs@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sweeping change, I know. Should not change compiled code in most
cases, the compiler should be smart enough to elide the assignment
right before a return. In the cases where this is not right before the
return, TALLOC_FREE() is safer as it makes use-after-free crash.

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Anoop C S &lt;anoopcs@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rpc registry: add ProductType for AD DC</title>
<updated>2025-07-01T09:17:08+00:00</updated>
<author>
<name>Michael Saxl</name>
<email>mike@mwsys.mine.bz</email>
</author>
<published>2025-05-28T14:49:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=d0be58d4c2191209da4fc313618ecf5478ff1f16'/>
<id>d0be58d4c2191209da4fc313618ecf5478ff1f16</id>
<content type='text'>
HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions contains a key
ProductType

The value of that key should be LanmanNT on a domain controller (of any
type).
The switch had no case for ROLE_ACTIVE_DIRECTORY_DC

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15863
Signed-off-by: Michael Saxl &lt;mike@mwsys.mine.bz&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;

Autobuild-User(master): Andreas Schneider &lt;asn@cryptomilk.org&gt;
Autobuild-Date(master): Tue Jul  1 09:17:08 UTC 2025 on atb-devel-224
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions contains a key
ProductType

The value of that key should be LanmanNT on a domain controller (of any
type).
The switch had no case for ROLE_ACTIVE_DIRECTORY_DC

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15863
Signed-off-by: Michael Saxl &lt;mike@mwsys.mine.bz&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;

Autobuild-User(master): Andreas Schneider &lt;asn@cryptomilk.org&gt;
Autobuild-Date(master): Tue Jul  1 09:17:08 UTC 2025 on atb-devel-224
</pre>
</div>
</content>
</entry>
<entry>
<title>lib: Save lines by avoiding explicit ZERO_STRUCTP calls</title>
<updated>2025-05-15T14:03:34+00:00</updated>
<author>
<name>Volker Lendecke</name>
<email>vl@samba.org</email>
</author>
<published>2025-04-04T10:24:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=0a0abbf2939bac2ffcf340aab35b9b1b98bcac96'/>
<id>0a0abbf2939bac2ffcf340aab35b9b1b98bcac96</id>
<content type='text'>
SMB_CALLOC_ARRAY(..., 1) does this.

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SMB_CALLOC_ARRAY(..., 1) does this.

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib: Add a few explicit includes</title>
<updated>2024-08-27T07:19:32+00:00</updated>
<author>
<name>Volker Lendecke</name>
<email>vl@samba.org</email>
</author>
<published>2024-08-22T16:25:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=56ec6fe5ed02fb37ea80216d468746d6c77edb7a'/>
<id>56ec6fe5ed02fb37ea80216d468746d6c77edb7a</id>
<content type='text'>
Required to trim down includes from gen_ndr/*security*

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Jennifer Sutton &lt;jsutton@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Required to trim down includes from gen_ndr/*security*

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Jennifer Sutton &lt;jsutton@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>s3:registry: Use correct integer sizes</title>
<updated>2024-07-08T07:36:32+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2024-06-26T12:32:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=8abda0a134168c63f70877f120fc0b02bf557a02'/>
<id>8abda0a134168c63f70877f120fc0b02bf557a02</id>
<content type='text'>
Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Volker Lendecke &lt;vl@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: Volker Lendecke &lt;vl@samba.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>s3:registry: Check for integer overflow</title>
<updated>2024-07-08T07:36:32+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2024-06-26T12:31:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=6cadb1d695ef1d45d2b64c8ad95cc442658f0991'/>
<id>6cadb1d695ef1d45d2b64c8ad95cc442658f0991</id>
<content type='text'>
"Error: INTEGER_OVERFLOW (CWE-190):
samba-4.20.0rc2/source3/registry/regfio.c:175: tainted_data_argument: The check ""bytes_read &lt; block_size"" contains the tainted expression ""bytes_read"" which causes ""block_size"" to be considered tainted.
samba-4.20.0rc2/source3/registry/regfio.c:176: overflow: The expression ""block_size - bytes_read"" is deemed overflowed because at least one of its arguments has overflowed.
samba-4.20.0rc2/source3/registry/regfio.c:176: overflow_sink: ""block_size - bytes_read"", which might have underflowed, is passed to ""read(file-&gt;fd, buffer + bytes_read, block_size - bytes_read)"". [Note: The source code implementation of the function has been overridden by a builtin model.]
  174|
  175|   	while ( bytes_read &lt; block_size ) {
  176|-&gt; 		if ( (returned = read( file-&gt;fd, buffer+bytes_read, block_size-bytes_read )) == -1 ) {
  177|   			DEBUG(0,(""read_block: read() failed (%s)\n"", strerror(errno) ));
  178|   			return False;"

Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Volker Lendecke &lt;vl@samba.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
"Error: INTEGER_OVERFLOW (CWE-190):
samba-4.20.0rc2/source3/registry/regfio.c:175: tainted_data_argument: The check ""bytes_read &lt; block_size"" contains the tainted expression ""bytes_read"" which causes ""block_size"" to be considered tainted.
samba-4.20.0rc2/source3/registry/regfio.c:176: overflow: The expression ""block_size - bytes_read"" is deemed overflowed because at least one of its arguments has overflowed.
samba-4.20.0rc2/source3/registry/regfio.c:176: overflow_sink: ""block_size - bytes_read"", which might have underflowed, is passed to ""read(file-&gt;fd, buffer + bytes_read, block_size - bytes_read)"". [Note: The source code implementation of the function has been overridden by a builtin model.]
  174|
  175|   	while ( bytes_read &lt; block_size ) {
  176|-&gt; 		if ( (returned = read( file-&gt;fd, buffer+bytes_read, block_size-bytes_read )) == -1 ) {
  177|   			DEBUG(0,(""read_block: read() failed (%s)\n"", strerror(errno) ));
  178|   			return False;"

Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Volker Lendecke &lt;vl@samba.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>s3:registry: Initialize struct security_ace ace[]</title>
<updated>2024-07-05T07:45:32+00:00</updated>
<author>
<name>Pavel Filipenský</name>
<email>pfilipensky@samba.org</email>
</author>
<published>2024-07-03T15:34:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=fd4afa309efc97b75d032ca8f59b16b08c51f1c8'/>
<id>fd4afa309efc97b75d032ca8f59b16b08c51f1c8</id>
<content type='text'>
Error: UNINIT (CWE-457):
samba-4.20.0rc2/source3/registry/reg_dispatcher.c:43: var_decl: Declaring variable "ace" without initializer.
samba-4.20.0rc2/source3/registry/reg_dispatcher.c:66: uninit_use_in_call: Using uninitialized value "*ace". Field "ace-&gt;object" is uninitialized when calling "make_sec_acl".
  64|           /* create the security descriptor */
  65|
  66|-&gt;         theacl = make_sec_acl(ctx, NT4_ACL_REVISION, i, ace);
  67|           if (theacl == NULL) {
  68|                   return WERR_NOT_ENOUGH_MEMORY;

Signed-off-by: Pavel Filipenský &lt;pfilipensky@samba.org&gt;
Reviewed-by: Volker Lendecke &lt;vl@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Error: UNINIT (CWE-457):
samba-4.20.0rc2/source3/registry/reg_dispatcher.c:43: var_decl: Declaring variable "ace" without initializer.
samba-4.20.0rc2/source3/registry/reg_dispatcher.c:66: uninit_use_in_call: Using uninitialized value "*ace". Field "ace-&gt;object" is uninitialized when calling "make_sec_acl".
  64|           /* create the security descriptor */
  65|
  66|-&gt;         theacl = make_sec_acl(ctx, NT4_ACL_REVISION, i, ace);
  67|           if (theacl == NULL) {
  68|                   return WERR_NOT_ENOUGH_MEMORY;

Signed-off-by: Pavel Filipenský &lt;pfilipensky@samba.org&gt;
Reviewed-by: Volker Lendecke &lt;vl@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>s3:registry: Add missing return value checks</title>
<updated>2024-06-24T06:14:36+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2024-06-19T09:47:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=b57bddacd765c48f3f427095ba4a474dbaf51c23'/>
<id>b57bddacd765c48f3f427095ba4a474dbaf51c23</id>
<content type='text'>
Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&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: Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>s3:registry: Avoid possible double frees</title>
<updated>2024-06-24T06:14:36+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2024-06-19T09:46:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=8c4f807350d6815582019bb0c52358e7db43ea24'/>
<id>8c4f807350d6815582019bb0c52358e7db43ea24</id>
<content type='text'>
Found by Covscan.

"Error: USE_AFTER_FREE (CWE-416):
samba-4.20.0rc2/source3/registry/reg_perfcount.c:309: freed_arg: ""_reg_perfcount_multi_sz_from_tdb"" frees ""*retbuf"".
samba-4.20.0rc2/source3/registry/reg_perfcount.c:313: double_free: Calling ""_reg_perfcount_multi_sz_from_tdb"" frees pointer ""*retbuf"" which has already been freed.
  311|   	for(i = 1; i &lt;= base_index; i++)
  312|   	{
  313|-&gt; 		buffer_size = _reg_perfcount_multi_sz_from_tdb(names, i*2, retbuf, buffer_size);
  314|   	}
  315|   	tdb_close(names);"

Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Found by Covscan.

"Error: USE_AFTER_FREE (CWE-416):
samba-4.20.0rc2/source3/registry/reg_perfcount.c:309: freed_arg: ""_reg_perfcount_multi_sz_from_tdb"" frees ""*retbuf"".
samba-4.20.0rc2/source3/registry/reg_perfcount.c:313: double_free: Calling ""_reg_perfcount_multi_sz_from_tdb"" frees pointer ""*retbuf"" which has already been freed.
  311|   	for(i = 1; i &lt;= base_index; i++)
  312|   	{
  313|-&gt; 		buffer_size = _reg_perfcount_multi_sz_from_tdb(names, i*2, retbuf, buffer_size);
  314|   	}
  315|   	tdb_close(names);"

Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>s3:registry: Remove trailing spaces in reg_perfcount.c</title>
<updated>2024-06-24T06:14:36+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2024-06-19T09:45:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=10b95ff436866e484755fc2c5189263394029a29'/>
<id>10b95ff436866e484755fc2c5189263394029a29</id>
<content type='text'>
Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&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: Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;</pre>
</div>
</content>
</entry>
</feed>
