[MS-GPSB] 2.2 Message Syntax says that you have to write a BOM which I
didn't do up until this patch. UTF-16 as input encoding was marked much
higher up in the inheritance tree, which got overriden with the Python 3
fixes. I've now marked the encoding much more obviously for this file.
Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Fri Jul 19 02:20:47 UTC 2019 on sn-devel-184
lib:util: Use GnuTLS random number generator in genrand.c
FIPS requires that a random number generator from a certified crypto
library is used.
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jul 18 01:30:20 UTC 2019 on sn-devel-184
Volker Lendecke [Wed, 1 May 2019 13:34:22 +0000 (15:34 +0200)]
lib: Optimize file_compare
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 <vl@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Wed Jul 17 12:45:51 UTC 2019 on sn-devel-184
Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Wed Jul 17 06:17:10 UTC 2019 on sn-devel-184
Noel Power [Wed, 10 Jul 2019 11:50:18 +0000 (11:50 +0000)]
s3/lib/smbconf: clang: 'Value stored during its initialization is never read'
Fixes:
source3/lib/smbconf/smbconf_reg.c:123:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
WERROR werr = WERR_OK;
^~~~ ~~~~~~~
source3/lib/smbconf/smbconf_reg.c:178:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
WERROR werr = WERR_OK;
^~~~ ~~~~~~~
source3/lib/smbconf/smbconf_reg.c:444:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
WERROR werr = WERR_OK;
^~~~ ~~~~~~~
source3/lib/smbconf/smbconf_reg.c:583:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
WERROR werr = WERR_OK;
^~~~ ~~~~~~~
source3/lib/smbconf/smbconf_reg.c:712:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
WERROR werr = WERR_OK;
^~~~ ~~~~~~~
source3/lib/smbconf/smbconf_reg.c:995:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
WERROR werr = WERR_OK;
^~~~ ~~~~~~~
source3/lib/smbconf/smbconf_reg.c:1103:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
WERROR werr = WERR_OK;
^~~~ ~~~~~~~
7 warnings generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Wed Jul 17 00:07:48 UTC 2019 on sn-devel-184
Noel Power [Wed, 10 Jul 2019 11:35:35 +0000 (11:35 +0000)]
s3/registry: clang: Fix 'initialization value is never read'
Fixes:
source3/registry/reg_backend_db.c:853:9: warning: Value stored to 'result' during its initialization is never read <--[clang]
WERROR result = WERR_OK;
^~~~~~ ~~~~~~~
source3/registry/reg_backend_db.c:1677:2: warning: Value stored to 'len' is never read <--[clang]
len = 0;
^ ~
2 warnings generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Noel Power [Wed, 10 Jul 2019 11:26:06 +0000 (11:26 +0000)]
s3/registry: clang: Fix 'initialization value is never read'
Fixes:
source3/registry/reg_api.c:139:14: warning: Value stored to 'result' during its initialization is never read <--[clang]
WERROR result = WERR_OK;
^~~~~~ ~~~~~~~
ource3/registry/reg_api.c:958:9: warning: Value stored to 'werr' during its initialization is never read <--[clang]
WERROR werr = WERR_OK;
^~~~ ~~~~~~~
2 warnings generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Noel Power [Wed, 10 Jul 2019 10:46:44 +0000 (10:46 +0000)]
libcli/smb: clang: Fix ' 2nd function call argument is an uninitialized value'
Fixes:
/home/samba/samba/libcli/smb/smbXcli_base.c:5120:8: warning: 2nd function call argument is an uninitialized value <--[clang]
rc = gnutls_hash(hash_hnd,
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Noel Power [Thu, 11 Jul 2019 12:00:27 +0000 (12:00 +0000)]
s4/libcli/raw: Fix 'Value stored to 'p' is never read'
Fixes:
source4/libcli/raw/clitree.c:138:3: warning: Value stored to 'p' is never read <--[clang]
p += smbcli_req_pull_string(&req->in.bufinfo, mem_ctx, &parms->tconx.out.fs_type,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Noel Power [Thu, 11 Jul 2019 11:36:46 +0000 (11:36 +0000)]
s3/param: clang: Fix 'Value stored to 'bRetval' is never read'
Fixes:
source3/param/loadparm.c:2770:2: warning: Value stored to 'bRetval' is never read <--[clang]
bRetval = false;
^ ~~~~~
source3/param/loadparm.c:3868:2: warning: Value stored to 'bRetval' is never read <--[clang]
bRetval = false;
^ ~~~~~
2 warnings generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Noel Power [Thu, 11 Jul 2019 11:33:18 +0000 (11:33 +0000)]
s4/libcli/raw: clang: Fix 'initialization value is never read'
Fixes:
source4/libcli/raw/rawnegotiate.c:157:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_INTERNAL_ERROR;
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Noel Power [Thu, 11 Jul 2019 11:31:03 +0000 (11:31 +0000)]
s4/libcli: clang: Fix 'initialization value is never read'
Fixes:
source4/libcli/smb_composite/fetchfile.c:91:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Noel Power [Wed, 10 Jul 2019 15:34:56 +0000 (16:34 +0100)]
libcls/netlogon: clang: Fix 'initialization value is never read'
Fixes:
libcli/netlogon/netlogon.c:183:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_INVALID_NETWORK_RESPONSE;
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libcli/netlogon/netlogon.c:224:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_INVALID_NETWORK_RESPONSE;
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
Note: although use of default seems unecessary but gcc
(with --picky-developer) detects the possibiliy still that status
may be undefined (presumably by a non enum value leaking
into the switch)
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Noel Power [Wed, 10 Jul 2019 15:13:38 +0000 (16:13 +0100)]
s4/libcli/ldab: clang: Fix 'Access results in a deref of a null pointer'
Fixes:
source4/libcli/ldap/ldap_client.c:1023:6: warning: Access to field 'type' results in a dereference of a null pointer <--[clang]
if ((*msg)->type != type) {
^~~~~~~~~~~~
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Noel Power [Wed, 10 Jul 2019 15:07:35 +0000 (16:07 +0100)]
s3/lib: clang: Fix 'Value stored to 'b' is never read'
Fixes:
source3/lib/substitute.c:516:7: warning: Value stored to 'b' is never read <--[clang]
for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) {
^ ~~~~~~~~~~~~
source3/lib/substitute.c:709:7: warning: Value stored to 'b' is never read <--[clang]
for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) {
^ ~~~~~~~~~~~~
source3/lib/substitute.c:811:7: warning: Value stored to 'b' is never read <--[clang]
for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) {
^ ~~~~~~~~~~~~
3 warnings generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Noel Power [Wed, 10 Jul 2019 14:49:11 +0000 (15:49 +0100)]
s3/lib: clang: Fix 'Value stored during its initialization is never read'
Fixes:
source3/lib/messages.c:483:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jul 16 17:20:31 UTC 2019 on sn-devel-184
Gary Lockyer [Wed, 10 Jul 2019 21:31:31 +0000 (09:31 +1200)]
prefork tests: re-enable restart tests for MIT Kerberos
Previously the restart back off tests were disabled for MIT Kerberos, as
they used the kdc, which is not run in that case. Tests now use the
echo server.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jul 16 10:10:23 UTC 2019 on sn-devel-184
Gary Lockyer [Wed, 10 Jul 2019 21:28:30 +0000 (09:28 +1200)]
prefork restart tests: Use echo server for back off
Use the echo server for the restart back off tests in the
samba.tests.prefork_restart tests instead of the kdc. The kdc is not enabled
when the ADDC is built to run MIT Kerberos. Changing the test to use
the echo server means it can be run when MIT Kerberos is enabled.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
Michael Adam [Sat, 18 May 2019 09:28:54 +0000 (11:28 +0200)]
vfs:glusterfs_fuse: ensure fileids are constant across nodes
Instead of adding a new gluster-specific mode to the fileid module,
this patches provides a fileid algorithm as part of the glusterfs_fuse
vfs module. This can not be configured further, simply adding the
glusterfs_fuse vfs module to the vfs objects configuration will enable
the new fileid mode.
Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Sat Jul 13 22:54:56 UTC 2019 on sn-devel-184
Ralph Boehme [Thu, 11 Jul 2019 14:23:53 +0000 (16:23 +0200)]
s3:net: add 'net vfs getntacl' command
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jul 12 22:59:58 UTC 2019 on sn-devel-184
Ralph Boehme [Fri, 5 Jul 2019 09:42:11 +0000 (11:42 +0200)]
adouble: remove xattrs after successfull conversion
This ensure the subsequent ad_fset() does not attempt to put back the xattrs on
disk in the AppleDouble file. It's not yet a problem as we don't have the code
that would do that, but that will be added in the next commit...
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Thu, 4 Jul 2019 09:37:10 +0000 (11:37 +0200)]
adouble: use runtime size when writing out AppleDouble header
We're calling SMB_VFS_NEXT_PWRITE() to write out the AppleDouble header
data. Until now this header always had a fixed sizeof AD_DATASZ_DOT_UND bytes,
but a subsequent commit will change that. Use the correct size which is the
offset of the begining of the resource fork data.
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Mon, 1 Jul 2019 13:53:36 +0000 (15:53 +0200)]
s3:lib: move Mac streams util functions to s3/lib
While at it, change the functions to work on the stream name directly instead of
struct smb_filename. A later commit wants to use the function on the resulting
stream names coming from vfs_streaminfo().
Also use the simple string compare version, not the multibyte ones, as the afp*
stream names are simple ASCII string, so there's no need to become fancy.
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Tue, 9 Jul 2019 11:10:00 +0000 (13:10 +0200)]
vfs_fruit: move AppleDouble functionality to a dedicated subsystem
It's still tied to the VFS, therefor it lives in source3/modules/. Reduces code
bloat in vfs_fruit and makes it possible to use it from other parts of the
codebase in future.
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Mon, 27 May 2019 15:55:07 +0000 (17:55 +0200)]
vfs_fruit: pass catia mappings as argument to ad_convert()
This removes the direct use of fruit_catia_maps from ad_convert(), to make it
possible to move the whole AppleDouble functionality to a dedicated subsystem.
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Mon, 27 May 2019 14:57:51 +0000 (16:57 +0200)]
vfs_fruit: add flags to ad_convert()
A subsequent commmit will move all AppleDouble related functionality, including
ad_convert(), to a different compilation unit. We must therefor remove the
dependency on struct fruit_config_data.
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Fri, 24 May 2019 15:50:52 +0000 (17:50 +0200)]
vfs_fruit: convert adouble accessor macros to functions
The functions will be moved to a different compilation unit in a subsequent
commit and struct adouble will become a private struct so callers can't access
it directly.
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Thu Jul 11 05:25:26 UTC 2019 on sn-devel-184
Noel Power [Mon, 8 Jul 2019 15:19:51 +0000 (15:19 +0000)]
libcl/smb: clang: Fix 'Value stored to 'next_offset' is never read'
Fixes:
libcli/smb/smb2_create_blob.c:146:3: warning: Value stored to 'next_offset' is never read <--[clang]
next_offset += next_pad;
^ ~~~~~~~~
1 warning generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Noel Power [Mon, 8 Jul 2019 15:16:57 +0000 (15:16 +0000)]
libcli/smb: clang: Fix 'value stored to 'p' is never read'
Fixes:
libcli/smb/smb1cli_session.c:226:2: warning: Value stored to 'p' is never read <--[clang]
p += ret;
^ ~~~
libcli/smb/smb1cli_session.c:517:2: warning: Value stored to 'p' is never read <--[clang]
p += ret;
^ ~~~ Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Noel Power [Mon, 8 Jul 2019 13:49:30 +0000 (13:49 +0000)]
s4/auth/gensec: clang: Fix 'initialization value is never read'
Fixes:
source4/auth/gensec/gensec_gssapi.c:431:11: warning: Value stored to 'nt_status' during its initialization is never read <--[clang]
NTSTATUS nt_status = NT_STATUS_LOGON_FAILURE;
^~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Noel Power [Mon, 8 Jul 2019 13:46:39 +0000 (13:46 +0000)]
nsswitch/libwbclient: clang: Fix Value stored to 'wbc_status' is never read
Fixes:
nsswitch/libwbclient/wbc_util.c:123:3: warning: Value stored to 'wbc_status' is never read <--[clang]
wbc_status = WBC_ERR_SUCCESS;
^ ~~~~~~~~~~~~~~~
1 warning generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Noel Power [Mon, 8 Jul 2019 13:43:20 +0000 (13:43 +0000)]
s4/dsdb/common: clang: Fix access results in null pointer deref.
Fixes:
source4/dsdb/common/util_trusts.c:2915:21: warning: Access to field 'sid' results in a dereference of a null pointer (loaded from field 'tdo') <--[clang]
d->di.domain_sid = d->tdo->sid;
^ ~~~
1 warning generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Noel Power [Mon, 8 Jul 2019 12:12:59 +0000 (12:12 +0000)]
nsswitch/libwbclient: clang Fix Potential leak of memory
Fixes:
nsswitch/libwbclient/wbc_sid.c:848:2: warning: Potential leak of memory pointed to by 'extra_data'
free(extra_data);
^
1 warning generated. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Douglas Bagnall [Sun, 7 Jul 2019 00:49:57 +0000 (12:49 +1200)]
ldb ABI bump for pyldb_Ldb_AsLdbContext change
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Jul 10 05:48:52 UTC 2019 on sn-devel-184
Douglas Bagnall [Fri, 20 Apr 2018 04:23:42 +0000 (16:23 +1200)]
pyldb: fork pyldb_Ldb_AsLdbContext macro to reflect unsafeness
In the Python/C API, conversion functions which check the types of their arguments
have names like:
double PyFloat_AsDouble(PyObject *pyfloat);
while conversion macros that don't check have names like:
PyFloat_AS_DOUBLE(pyfloat)
The pyldb_Ldb_AsLdbContext() macro looks like one of the checking functions
but it actually isn't. This has fooled us more than once. Here we fork
the macro into two -- one which performs checks and keeps the camel
case, and one with a shouty name that keeps the check-free behaviour.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Jeremy Allison [Mon, 8 Jul 2019 22:28:51 +0000 (15:28 -0700)]
s3: smbd: Remove ifdef'ed out dptr_close_oldest().
No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jul 10 00:28:51 UTC 2019 on sn-devel-184